diff options
Diffstat (limited to 'unotools/source/config/printwarningoptions.cxx')
-rw-r--r-- | unotools/source/config/printwarningoptions.cxx | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/unotools/source/config/printwarningoptions.cxx b/unotools/source/config/printwarningoptions.cxx index d723b3c068d4..bf8b5738c818 100644 --- a/unotools/source/config/printwarningoptions.cxx +++ b/unotools/source/config/printwarningoptions.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/printwarningoptions.hxx> #include <unotools/configmgr.hxx> @@ -249,8 +244,8 @@ void SvtPrintWarningOptions_Impl::Notify( const Sequence< rtl::OUString >& ) //***************************************************************************************************************** Sequence< OUString > SvtPrintWarningOptions_Impl::impl_GetPropertyNames() { - // Build static list of configuration key names. - static const OUString pProperties[] = + // Build list of configuration key names. + const OUString pProperties[] = { PROPERTYNAME_PAPERSIZE, PROPERTYNAME_PAPERORIENTATION, @@ -260,7 +255,7 @@ Sequence< OUString > SvtPrintWarningOptions_Impl::impl_GetPropertyNames() }; // Initialize return sequence with these list ... - static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT ); + const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT ); return seqPropertyNames; } @@ -395,27 +390,17 @@ void SvtPrintWarningOptions::SetModifyDocumentOnPrintingAllowed( sal_Bool bState m_pDataContainer->SetModifyDocumentOnPrintingAllowed( bState ) ; } +namespace +{ + class thePrintWarningOptionsMutex : public rtl::Static<osl::Mutex, thePrintWarningOptionsMutex>{}; +} + //***************************************************************************************************************** // private method //***************************************************************************************************************** Mutex& SvtPrintWarningOptions::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 thePrintWarningOptionsMutex::get(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |