diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-10-31 12:06:21 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-10-31 12:21:19 +0100 |
commit | 1e467fa8ae06ee4953511973f1785f41d8ba9e31 (patch) | |
tree | 0a8533f9f74acc3b4d5f02ae049e0538d6aa5cae /sfx2 | |
parent | 0b4118854c61db75b5a52ecc2cdf8a36c89c9fdb (diff) |
sfx2: Metadata has no need for cryptographic randomness
Change-Id: I911c15c0ea7a3cae0269c67d8bd6fd79e9b6d8c6
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/Metadatable.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 45775b413fa9..03dd8bf10ee7 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -24,8 +24,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> -#include <rtl/random.h> - +#include <comphelper/random.hxx> #include <algorithm> #include <list> @@ -406,12 +405,11 @@ template< typename T > } else { - static rtlRandomPool s_Pool( rtl_random_createPool() ); do { - sal_Int32 n; - rtl_random_getBytes(s_Pool, & n, sizeof(n)); - id = prefix + OUString::number(abs(n)); + unsigned int const n(comphelper::rng::uniform_uint_distribution(0, + std::numeric_limits<unsigned int>::max())); + id = prefix + OUString::number(n); iter = i_rXmlIdMap.find(id); } while (iter != i_rXmlIdMap.end()); |