From 1e467fa8ae06ee4953511973f1785f41d8ba9e31 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 31 Oct 2016 12:06:21 +0100 Subject: [PATCH] sfx2: Metadata has no need for cryptographic randomness Change-Id: I911c15c0ea7a3cae0269c67d8bd6fd79e9b6d8c6 --- sfx2/source/doc/Metadatable.cxx | 10 ++++------ 1 file 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 #include -#include - +#include #include #include @@ -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::max())); + id = prefix + OUString::number(n); iter = i_rXmlIdMap.find(id); } while (iter != i_rXmlIdMap.end());