diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 16:49:08 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 16:49:08 +0100 |
commit | 8d3cd5fd96b6566609a22f36eed40f3275a07479 (patch) | |
tree | 39c0943838e465b2eb4a4cbb4dd481456806f850 /unotools/source | |
parent | f89817da62023a4228dc5c4652d51d1c036d60a5 (diff) | |
parent | d5fef25425e61f4209d95fd3d1aff2d5f6422775 (diff) |
CWS-TOOLING: integrate CWS sw34bf01
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index e77dc529e410..87fddc0c65cd 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -198,19 +198,19 @@ String ConstructTempDir_Impl( const String* pParent ) void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_True ) { // add a suitable tempname - // Prefix can have 5 chars, leaving 3 for numbers. 26 ** 3 == 17576 - // ER 13.07.00 why not radix 36 [0-9A-Z] ?!? - const unsigned nRadix = 26; + // 36 ** 6 == 2176782336 + unsigned const nRadix = 36; + unsigned long const nMax = (nRadix*nRadix*nRadix*nRadix*nRadix*nRadix); String aName( rName ); aName += String::CreateFromAscii( "sv" ); rName.Erase(); - static unsigned long u = Time::GetSystemTicks(); - for ( unsigned long nOld = u; ++u != nOld; ) + unsigned long nSeed = Time::GetSystemTicks() % nMax; + for ( unsigned long u = nSeed; ++u != nSeed; ) { - u %= (nRadix*nRadix*nRadix); + u %= nMax; String aTmp( aName ); - aTmp += String::CreateFromInt32( (sal_Int32) (unsigned) u, nRadix ); + aTmp += String::CreateFromInt64( static_cast<sal_Int64>(u), nRadix ); aTmp += String::CreateFromAscii( ".tmp" ); if ( bDir ) |