summaryrefslogtreecommitdiff
path: root/unotools/source/config/workingsetoptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/config/workingsetoptions.cxx')
-rw-r--r--unotools/source/config/workingsetoptions.cxx39
1 files changed, 12 insertions, 27 deletions
diff --git a/unotools/source/config/workingsetoptions.cxx b/unotools/source/config/workingsetoptions.cxx
index aebac3377510..e465ac439981 100644
--- a/unotools/source/config/workingsetoptions.cxx
+++ b/unotools/source/config/workingsetoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/workingsetoptions.hxx>
#include <unotools/configmgr.hxx>
@@ -295,13 +290,13 @@ void SvtWorkingSetOptions_Impl::SetWindowList( const Sequence< OUString >& seqWi
//*****************************************************************************************************************
Sequence< OUString > SvtWorkingSetOptions_Impl::GetPropertyNames()
{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
+ // Build list of configuration key names.
+ const OUString pProperties[] =
{
PROPERTYNAME_WINDOWLIST ,
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
@@ -367,27 +362,17 @@ void SvtWorkingSetOptions::SetWindowList( const Sequence< OUString >& seqWindowL
m_pDataContainer->SetWindowList( seqWindowList );
}
+namespace
+{
+ class theWorkingSetOptionsMutex : public rtl::Static<osl::Mutex, theWorkingSetOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtWorkingSetOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theWorkingSetOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */