summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-09 14:48:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-10 08:58:20 +0100
commit5b2f8231945fedc46425e00f1234dcac90628c1d (patch)
tree7cdee4b82bd29d59292d0a4bd4df4e816317192c /sc
parent315afb12853624bdaac553a8528390c3a61c8351 (diff)
add a SAL_RAND_REPEATABLE for repeatable random nums
merge the formula and comphelper ones together Change-Id: I2e7e2cdb176afc6982e384fa1e007da5b914e6f0
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx4
-rw-r--r--sc/source/core/tool/interpr1.cxx3
2 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 98c95e7cad99..ed03cce25350 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -16,7 +16,7 @@
#include "tokenarray.hxx"
#include "compiler.hxx"
#include "interpre.hxx"
-#include <formula/random.hxx>
+#include <comphelper/random.hxx>
#include <formula/vectortoken.hxx>
#include "scmatrix.hxx"
@@ -738,7 +738,7 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t k)\n\
/// Create buffer and pass the buffer to a given kernel
virtual size_t Marshal( cl_kernel k, int argno, int, cl_program ) SAL_OVERRIDE
{
- cl_int seed = formula::rng::nRandom(0, SAL_MAX_INT32);
+ cl_int seed = comphelper::rng::uniform_int_distribution(0, SAL_MAX_INT32);
// Pass the scalar result back to the rest of the formula kernel
SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_int: " << seed);
cl_int err = clSetKernelArg(k, argno, sizeof(cl_int), static_cast<void*>(&seed));
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index e1dfd2afa93d..78922695f522 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -22,7 +22,6 @@
#include "scitems.hxx"
#include <editeng/langitem.hxx>
#include <editeng/justifyitem.hxx>
-#include <formula/random.hxx>
#include <osl/thread.h>
#include <svx/algitem.hxx>
#include <unotools/textsearch.hxx>
@@ -1653,7 +1652,7 @@ void ScInterpreter::ScPi()
void ScInterpreter::ScRandom()
{
- PushDouble(formula::rng::fRandom(0, 1));
+ PushDouble(::comphelper::rng::uniform_real_distribution());
}
void ScInterpreter::ScTrue()