sw/source/core/doc/docnum.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
New commits: commit b95a901089ac096131bb6a4fe9c1f1346ffdde6f Author: Tor Lillqvist <t...@collabora.com> Date: Wed Oct 2 13:09:23 2013 +0300 Avoid randomness in one more place in the LIBO_ONEWAY_STABLE_ODF_EXPORT case Change-Id: Ia77979cd998549ae9641c52bd4253f207e479b68 diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index bf5952d..235db1d 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2210,10 +2210,20 @@ OUString SwDoc::GetUniqueNumRuleName( const OUString* pChkStr, bool bAutoNum ) c OUString aName; if( bAutoNum ) { - static rtlRandomPool s_RandomPool( rtl_random_createPool() ); - sal_Int64 n; - rtl_random_getBytes( s_RandomPool, &n, sizeof(n) ); - aName = OUString::number( (n < 0 ? -n : n) ); + static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != NULL); + + if (bHack) + { + static sal_Int64 nIdCounter = SAL_CONST_INT64(8000000000); + aName = OUString::number(nIdCounter++); + } + else + { + static rtlRandomPool s_RandomPool( rtl_random_createPool() ); + sal_Int64 n; + rtl_random_getBytes( s_RandomPool, &n, sizeof(n) ); + aName = OUString::number( (n < 0 ? -n : n) ); + } if( pChkStr && pChkStr->isEmpty() ) pChkStr = 0; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits