summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-05-17 21:05:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-05-20 15:23:08 +0100
commit415b8e8e577b388b0b76f73c32066f8efa39d896 (patch)
treea2a645df2636f207bfdf58ffe91f41d60a79b19d /sfx2/source/appl
parent85cfb6009aa8ab4a4901d6b09c5da5096499d446 (diff)
return by reference instead of pointer
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index dfcc03c9d3..7b43139475 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -170,7 +170,7 @@ SfxPickList::PickListEntry* SfxPickList::GetPickListEntry( sal_uInt32 nIndex )
return 0;
}
-SfxPickList* SfxPickList::GetOrCreate( const sal_uInt32 nMenuSize )
+SfxPickList& SfxPickList::GetOrCreate( const sal_uInt32 nMenuSize )
{
if ( !pUniqueInstance )
{
@@ -179,13 +179,13 @@ SfxPickList* SfxPickList::GetOrCreate( const sal_uInt32 nMenuSize )
pUniqueInstance = new SfxPickList( nMenuSize );
}
- return pUniqueInstance;
+ return *pUniqueInstance;
}
-SfxPickList* SfxPickList::Get()
+SfxPickList& SfxPickList::Get()
{
::osl::MutexGuard aGuard( thePickListMutex::get() );
- return pUniqueInstance;
+ return *pUniqueInstance;
}
void SfxPickList::Delete()
@@ -258,10 +258,10 @@ void SfxPickList::CreatePickListEntries()
void SfxPickList::CreateMenuEntries( Menu* pMenu )
{
- static sal_Bool bPickListMenuInitializing = sal_False;
-
::osl::MutexGuard aGuard( thePickListMutex::get() );
+ static sal_Bool bPickListMenuInitializing = sal_False;
+
if ( bPickListMenuInitializing ) // method is not reentrant!
return;
@@ -295,7 +295,7 @@ void SfxPickList::ExecuteEntry( sal_uInt32 nIndex )
{
::osl::ClearableMutexGuard aGuard( thePickListMutex::get() );
- PickListEntry *pPick = SfxPickList::Get()->GetPickListEntry( nIndex );
+ PickListEntry *pPick = SfxPickList::Get().GetPickListEntry( nIndex );
if ( pPick )
{
@@ -327,7 +327,7 @@ void SfxPickList::ExecuteMenuEntry( sal_uInt16 nId )
String SfxPickList::GetMenuEntryTitle( sal_uInt32 nIndex )
{
- PickListEntry *pPick = SfxPickList::Get()->GetPickListEntry( nIndex );
+ PickListEntry *pPick = SfxPickList::Get().GetPickListEntry( nIndex );
if ( pPick )
return pPick->aTitle;