diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-05-19 21:48:55 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-20 14:03:34 +0000 |
commit | 0e5aa443f8f603be6e5ad4ddcec12e5b6fbdff8a (patch) | |
tree | fa75898cf5c53c5cfcc204ae5055c6914486c154 /sw/source/core | |
parent | 5b63043dbc12476ad1c1e69558b53d9493c855f1 (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
(cherry picked from commit 564fc483931c0aa2872a33023473c7ac36bfedf1)
Reviewed-on: https://gerrit.libreoffice.org/15818
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core')
0 files changed, 0 insertions, 0 deletions