comphelper/Library_comphelper.mk | 1 comphelper/inc/pch/precompiled_comphelper.hxx | 3 comphelper/source/misc/random.cxx | 54 ++++++++++ include/comphelper/random.hxx | 33 ++++++ sc/Library_sc.mk | 1 sc/source/core/data/global.cxx | 4 sc/source/core/inc/random.hxx | 29 ----- sc/source/core/tool/interpr1.cxx | 4 sc/source/core/tool/random.cxx | 54 ---------- sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx | 1 sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx | 1 sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx | 1 sc/source/ui/StatisticsDialogs/FTestDialog.cxx | 1 sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx | 1 sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx | 1 sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 1 sc/source/ui/StatisticsDialogs/SamplingDialog.cxx | 1 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx | 1 sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx | 1 sc/source/ui/StatisticsDialogs/TTestDialog.cxx | 1 20 files changed, 94 insertions(+), 100 deletions(-)
New commits: commit 9c3e819f066acaf9f5a416630fa7dd83fdc2539d Author: Thomas Arnhold <tho...@arnhold.org> Date: Tue May 13 08:42:21 2014 +0200 move boost rng wrapper from sc to comphelper so we can re-use it in other modules Change-Id: I6057b1e955f745019fd48f91a754279df0f2b948 Reviewed-on: https://gerrit.libreoffice.org/9348 Reviewed-by: Thomas Arnhold <tho...@arnhold.org> Tested-by: Thomas Arnhold <tho...@arnhold.org> diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk index 623bac6..cfe48f6 100644 --- a/comphelper/Library_comphelper.mk +++ b/comphelper/Library_comphelper.mk @@ -99,6 +99,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/misc/officeresourcebundle \ comphelper/source/misc/officerestartmanager \ comphelper/source/misc/proxyaggregation \ + comphelper/source/misc/random \ comphelper/source/misc/scopeguard \ comphelper/source/misc/SelectionMultiplex \ comphelper/source/misc/sequenceashashmap \ diff --git a/comphelper/inc/pch/precompiled_comphelper.hxx b/comphelper/inc/pch/precompiled_comphelper.hxx index ab660b1..36ec107 100644 --- a/comphelper/inc/pch/precompiled_comphelper.hxx +++ b/comphelper/inc/pch/precompiled_comphelper.hxx @@ -18,6 +18,7 @@ #include <boost/bind.hpp> #include <boost/current_function.hpp> #include <boost/noncopyable.hpp> +#include <boost/random.hpp> #include <boost/scoped_array.hpp> #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> @@ -62,7 +63,6 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/datatransfer/XTransferable.hpp> -#include <com/sun/star/document/NoSuchFilterRequest.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XTypeDetection.hpp> @@ -225,4 +225,5 @@ #include <unicode/uchar.h> #include <uno/data.h> #include <vector> + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/random.cxx b/comphelper/source/misc/random.cxx similarity index 96% rename from sc/source/core/tool/random.cxx rename to comphelper/source/misc/random.cxx index 5affe37..a976086 100644 --- a/sc/source/core/tool/random.cxx +++ b/comphelper/source/misc/random.cxx @@ -12,12 +12,12 @@ #include <boost/random.hpp> -#include <random.hxx> +#include <comphelper/random.hxx> // this is nothing but a simple wrapper around // the boost random generators -namespace sc +namespace comphelper { namespace rng { diff --git a/sc/source/core/inc/random.hxx b/include/comphelper/random.hxx similarity index 60% rename from sc/source/core/inc/random.hxx rename to include/comphelper/random.hxx index 00765db..6b5d6eb 100644 --- a/sc/source/core/inc/random.hxx +++ b/include/comphelper/random.hxx @@ -7,18 +7,22 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_SC_SOURCE_CORE_INC_RANDOM_HXX -#define INCLUDED_SC_SOURCE_CORE_INC_RANDOM_HXX +#ifndef INCLUDED_COMPHELPER_RANDOM_HXX +#define INCLUDED_COMPHELPER_RANDOM_HXX -namespace sc +#include <comphelper/comphelperdllapi.h> + +namespace comphelper { namespace rng { -void seed(int i); // set initial seed (equivalent of libc srand()) +/// set initial seed (equivalent of libc srand()) +COMPHELPER_DLLPUBLIC void seed(int i); -double uniform(); // uniform distribution in [0,1) +/// uniform distribution in [0,1) +COMPHELPER_DLLPUBLIC double uniform(); } // namespace diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index ef09280..9b55aa4 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -249,7 +249,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/core/tool/progress \ sc/source/core/tool/queryentry \ sc/source/core/tool/queryparam \ - sc/source/core/tool/random \ sc/source/core/tool/rangelst \ sc/source/core/tool/rangenam \ sc/source/core/tool/rangeseq \ diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index d3b2bd1..5e081a0 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -49,6 +49,7 @@ #include <i18nlangtag/mslangid.hxx> #include <com/sun/star/lang/Locale.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/random.hxx> #include <comphelper/string.hxx> #include <unotools/calendarwrapper.hxx> #include <unotools/collatorwrapper.hxx> @@ -77,7 +78,6 @@ #include "sc.hrc" #include "scmod.hxx" #include "appoptio.hxx" -#include "random.hxx" #include "editutil.hxx" @@ -529,7 +529,7 @@ void ScGlobal::Init() // names from the compiler. ScParameterClassification::Init(); srand( (unsigned) time( NULL ) ); // Random Seed Init fuer Interpreter - sc::rng::seed( time( NULL ) ); // seed for libc rand() replacement + ::comphelper::rng::seed( time( NULL ) ); // seed for libc rand() replacement InitAddIns(); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index ab82fc3..9223dc6 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -46,7 +46,6 @@ #include "globstr.hrc" #include "attrib.hxx" #include "jumpmatrix.hxx" -#include "random.hxx" #include "cellkeytranslator.hxx" #include "lookupcache.hxx" #include "rangenam.hxx" @@ -61,6 +60,7 @@ #include "compare.hxx" #include <comphelper/processfactory.hxx> +#include <comphelper/random.hxx> #include <comphelper/string.hxx> #include <svl/sharedstringpool.hxx> @@ -1680,7 +1680,7 @@ void ScInterpreter::ScPi() void ScInterpreter::ScRandom() { - PushDouble(sc::rng::uniform()); + PushDouble(::comphelper::rng::uniform()); } diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index 77a8f55..0961760 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -20,7 +20,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" #include "TableFillingAndNavigationTools.hxx" diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index 84d493a..3c56be5 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -22,7 +22,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" #include "TableFillingAndNavigationTools.hxx" diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx index a97a48c..9f2b8e2 100644 --- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx @@ -20,7 +20,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" #include "TableFillingAndNavigationTools.hxx" diff --git a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx index feba4eb..4070376 100644 --- a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx @@ -22,7 +22,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" #include "TableFillingAndNavigationTools.hxx" diff --git a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx index 8757c2e..d779f67 100644 --- a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx +++ b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx @@ -20,7 +20,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" #include "TableFillingAndNavigationTools.hxx" diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx index fe0cf52..aafe290 100644 --- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx @@ -20,7 +20,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" #include "TableFillingAndNavigationTools.hxx" diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index b58d34a..35b72f8 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -20,7 +20,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index 3602376..24eb99d 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -19,7 +19,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index 0b20ae0..5d2518b 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -20,7 +20,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "scresid.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "strload.hxx" diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx index fa9ce72..5d9d5b0 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx @@ -20,7 +20,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "scresid.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "strload.hxx" diff --git a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx index c79ff5e..228063d 100644 --- a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx @@ -22,7 +22,6 @@ #include "uiitems.hxx" #include "reffact.hxx" #include "strload.hxx" -#include "random.hxx" #include "docfunc.hxx" #include "StatisticsDialogs.hrc" #include "TableFillingAndNavigationTools.hxx" _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits