diff options
-rw-r--r-- | sfx2/source/appl/appinit.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/sfxpicklist.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/inc/sfxpicklist.hxx | 2 |
3 files changed, 2 insertions, 25 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 6b8b5710e648..4120759de462 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -264,9 +264,6 @@ bool SfxApplication::Initialize_Impl() pAppData_Impl->m_pSbxErrorHdl = new SfxErrorHandler( RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END ); - // diverse Pointer - SfxPickList::GetOrCreate( SvtHistoryOptions().GetSize( ePICKLIST ) ); - DBG_ASSERT( !pAppData_Impl->pAppDispat, "AppDispatcher already exists" ); pAppData_Impl->pAppDispat = new SfxDispatcher((SfxDispatcher*)0); pAppData_Impl->pSlotPool = new SfxSlotPool; diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 16cbd6f25818..ed4c98638440 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -170,28 +170,10 @@ SfxPickList::PickListEntry* SfxPickList::GetPickListEntry( sal_uInt32 nIndex ) return 0; } -SfxPickList& SfxPickList::GetOrCreate( const sal_uInt32 nMenuSize ) -{ - if ( !pUniqueInstance ) - { - ::osl::MutexGuard aGuard( thePickListMutex::get() ); - if ( !pUniqueInstance ) - pUniqueInstance = new SfxPickList( nMenuSize ); - } - - return *pUniqueInstance; -} - SfxPickList& SfxPickList::Get() { - ::osl::MutexGuard aGuard( thePickListMutex::get() ); - return *pUniqueInstance; -} - -void SfxPickList::Delete() -{ - ::osl::MutexGuard aGuard( thePickListMutex::get() ); - DELETEZ( pUniqueInstance ); + static SfxPickList aUniqueInstance(SvtHistoryOptions().GetSize(ePICKLIST)); + return aUniqueInstance; } SfxPickList::SfxPickList( sal_uInt32 nAllowedMenuSize ) : diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx index 9a6723ad6b75..2ac9d8b2d2c5 100644 --- a/sfx2/source/inc/sfxpicklist.hxx +++ b/sfx2/source/inc/sfxpicklist.hxx @@ -67,9 +67,7 @@ class SfxPickList : public SfxListener void RemovePickListEntries(); public: - static SfxPickList& GetOrCreate( const sal_uInt32 nMenuSize ); static SfxPickList& Get(); - static void Delete(); sal_uInt32 GetAllowedMenuSize() { return m_nAllowedMenuSize; } sal_uInt32 GetNumOfEntries() const { return m_aPicklistVector.size(); } |