From 3b921a2cd7c2b29245af4e975da6c60f72384237 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 31 Oct 2016 10:00:11 +0100 Subject: sw: bookmark names don't need cryptographic randomness Change-Id: I6cecbf9b5a8b66de2e0e2d90fdecf6b389caad25 --- sw/source/core/crsr/bookmrk.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 2ba5c115b8f3..3b93e30592b8 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -31,10 +31,10 @@ #include #include #include -#include #include #include #include +#include #include using namespace ::sw::mark; @@ -206,15 +206,14 @@ namespace sw { namespace mark } else { - static rtlRandomPool aPool = rtl_random_createPool(); static OUString sUniquePostfix; static sal_Int32 nCount = SAL_MAX_INT32; OUStringBuffer aResult(rPrefix); if(nCount == SAL_MAX_INT32) { - sal_Int32 nRandom; - rtl_random_getBytes(aPool, &nRandom, sizeof(nRandom)); - sUniquePostfix = OUStringBuffer(13).append('_').append(static_cast(abs(nRandom))).makeStringAndClear(); + unsigned int const n(comphelper::rng::uniform_uint_distribution(0, + std::numeric_limits::max())); + sUniquePostfix = "_" + OUString::number(n); nCount = 0; } // putting the counter in front of the random parts will speed up string comparisons -- cgit