diff options
Diffstat (limited to 'sw/source/core/doc/docnew.cxx')
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index cba769405977..294a4d49ae74 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -39,6 +39,7 @@ #include <vcl/svapp.hxx> #include <vcl/virdev.hxx> #include <rtl/logfile.hxx> +#include <rtl/random.h> #include <sfx2/printer.hxx> #include <sfx2/docfile.hxx> #include <sfx2/frame.hxx> @@ -431,6 +432,14 @@ SwDoc::SwDoc() pStyleAccess = createStyleManager( &aIgnorableParagraphItems ); } + // Initialize the session id of the current document to a random number + // smaller than 2^21. + static rtlRandomPool aPool = rtl_random_createPool(); + rtl_random_getBytes( aPool, &nRsid, sizeof ( nRsid ) ); + nRsid &= ( 1<<21 ) - 1; + nRsid++; + nRsidRoot = nRsid; + ResetModified(); } |