summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-22 14:30:32 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-22 14:30:32 +0100
commit22ea168b2014bbefe00a52de59f52b669abd8909 (patch)
tree28c2b4b65e46df5389b00399d21b9d475636fb69 /unotools
parente275aa2d11ae62ca665a2abe0baa55e970adb4c0 (diff)
parent8dc3743ca56382374183bec5cd1a11d53f3085b8 (diff)
dba34b: merge after pulling DEV300.m94
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx14
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 )