summaryrefslogtreecommitdiff
path: root/tools/source/fsys
diff options
context:
space:
mode:
authorHans-Joachim Lankenau <hjs@openoffice.org>2004-06-25 16:11:09 +0000
committerHans-Joachim Lankenau <hjs@openoffice.org>2004-06-25 16:11:09 +0000
commit70d3039d8e51e18b56295bd6ca6d34cc752749dc (patch)
tree1a324b8254ce279ba5d36d706f91d2670f13e3ea /tools/source/fsys
parent7c7bc4193bb47e1371de1a99bb6ebb79db48762d (diff)
INTEGRATION: CWS tune04 (1.15.46); FILE MERGED
2004/06/10 12:08:28 cmc 1.15.46.1: #i29636# turn global objects into local static data protected with swishy double-locked templated template
Diffstat (limited to 'tools/source/fsys')
-rw-r--r--tools/source/fsys/dirent.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index ec9ab60dfd52..918579b973b5 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -2,8 +2,8 @@
*
* $RCSfile: dirent.cxx,v $
*
- * $Revision: 1.17 $
- * last change: $Author: rt $ $Date: 2004-06-17 11:37:34 $
+ * $Revision: 1.18 $
+ * last change: $Author: hjs $ $Date: 2004-06-25 17:11:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -125,6 +125,11 @@
#endif
#include <osl/file.hxx>
+#ifndef INCLUDED_RTL_INSTANCE_HXX
+#include <rtl/instance.hxx>
+#endif
+
+
using namespace osl;
using namespace rtl;
@@ -2176,8 +2181,7 @@ USHORT DirEntry::GetMaxNameLen( FSysPathStyle eFormatter )
|* Letzte Aenderung MI 06.02.98
|*
*************************************************************************/
-
-DirEntry aTempNameBase_Impl;
+namespace { struct TempNameBase_Impl : public rtl::Static< DirEntry, TempNameBase_Impl > {}; }
const DirEntry& DirEntry::SetTempNameBase( const String &rBase )
{
@@ -2202,17 +2206,19 @@ const DirEntry& DirEntry::SetTempNameBase( const String &rBase )
#else
aTempDir.MakeDir();
#endif
- aTempNameBase_Impl = aTempDir.TempName( FSYS_KIND_DIR );
- return aTempNameBase_Impl;
+ DirEntry &rEntry = TempNameBase_Impl::get();
+ rEntry = aTempDir.TempName( FSYS_KIND_DIR );
+ return rEntry;
}
DirEntry DirEntry::TempName( DirEntryKind eKind ) const
{
// ggf. Base-Temp-Dir verwenden (macht Remote keinen Sinn => vorher)
- if ( !pParent && FSYS_FLAG_CURRENT != aTempNameBase_Impl.eFlag && FSYS_FLAG_ABSROOT != eFlag )
+ const DirEntry &rEntry = TempNameBase_Impl::get();
+ if ( !pParent && FSYS_FLAG_CURRENT != rEntry.eFlag && FSYS_FLAG_ABSROOT != eFlag )
{
- DirEntry aFactory( aTempNameBase_Impl );
+ DirEntry aFactory( rEntry );
aFactory += GetName();
return aFactory.TempName();
}