diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-05-19 21:48:55 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-05-19 22:02:41 +0200 |
commit | 564fc483931c0aa2872a33023473c7ac36bfedf1 (patch) | |
tree | 6baed6df5dd5154a6fb33893506dd77a4e20a31e /basic/inc | |
parent | e1b1f9537a299e5cdb4bd824513b41ee903b4bda (diff) |
tdf#90110: basic: fix Randomize statement
- time() is used to seed the RNG but since it only has second resolution,
the same values will be generated if it's called multiple times like
in the bug report
- BASIC using the global rng would be fine except that BASIC Randomize
takes an optional parameter to set the seed, which should continue
to be supported, but should not affect the RNG state for non-BASIC
users of comphelper::random
(regression from df466d79cb126667cc9d5c108367bfa4f5ce76c8,
but the old implementation was even more delightfully absurd,
where Randomize was essentially srand((sal_uInt16)rand()) ...)
Change-Id: I0f30e509de08f933c02ac77c5d932b20e79586c5
Diffstat (limited to 'basic/inc')
-rw-r--r-- | basic/inc/pch/precompiled_sb.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx index 8ed406da7931..d797b0b9cc39 100644 --- a/basic/inc/pch/precompiled_sb.hxx +++ b/basic/inc/pch/precompiled_sb.hxx @@ -30,7 +30,6 @@ #include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/util/DateTime.hpp> #include <comphelper/processfactory.hxx> -#include <comphelper/random.hxx> #include <comphelper/string.hxx> #include <config_features.h> #include <config_version.h> @@ -46,6 +45,7 @@ #include <osl/file.hxx> #include <osl/process.h> #include <osl/time.h> +#include <random> #include <rtl/character.hxx> #include <rtl/instance.hxx> #include <rtl/math.hxx> |