summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-07 10:27:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-07 10:27:52 +0000
commit22e3da098ce19fe3463af67b44a4529fe555a181 (patch)
treee4bfb35146390f1d7a990955f15d944dcbf9db3c /sfx2
parent80c2c0b496494bc648e49f49349a46648f97f689 (diff)
can use a reference here
Change-Id: I3e9599e92679a66cae410090b5d17651a3698cce
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appdispatchprovider.cxx53
1 files changed, 25 insertions, 28 deletions
diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx
index 5a8fb6b2104d..51e8bb8c95c8 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -173,15 +173,15 @@ Sequence< sal_Int16 > SAL_CALL SfxAppDispatchProvider::getSupportedCommandGroups
SolarMutexGuard aGuard;
std::vector< sal_Int16 > aGroupList;
- SfxSlotPool* pAppSlotPool = &SfxGetpApp()->GetAppSlotPool_Impl();
+ SfxSlotPool& rAppSlotPool = SfxGetpApp()->GetAppSlotPool_Impl();
const SfxSlotMode nMode( SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG );
// Gruppe anw"ahlen ( Gruppe 0 ist intern )
- for ( sal_uInt16 i=0; i<pAppSlotPool->GetGroupCount(); i++ )
+ for (sal_uInt16 i=0; i< rAppSlotPool.GetGroupCount(); ++i)
{
- pAppSlotPool->SeekGroup( i );
- const SfxSlot* pSfxSlot = pAppSlotPool->FirstSlot();
+ rAppSlotPool.SeekGroup(i);
+ const SfxSlot* pSfxSlot = rAppSlotPool.FirstSlot();
while ( pSfxSlot )
{
if ( pSfxSlot->GetMode() & nMode )
@@ -190,7 +190,7 @@ Sequence< sal_Int16 > SAL_CALL SfxAppDispatchProvider::getSupportedCommandGroups
aGroupList.push_back( nCommandGroup );
break;
}
- pSfxSlot = pAppSlotPool->NextSlot();
+ pSfxSlot = rAppSlotPool.NextSlot();
}
}
@@ -202,36 +202,33 @@ Sequence< frame::DispatchInformation > SAL_CALL SfxAppDispatchProvider::getConfi
std::list< frame::DispatchInformation > aCmdList;
SolarMutexGuard aGuard;
- SfxSlotPool* pAppSlotPool = &SfxGetpApp()->GetAppSlotPool_Impl();
+ SfxSlotPool& rAppSlotPool = SfxGetpApp()->GetAppSlotPool_Impl();
- if ( pAppSlotPool )
- {
- const SfxSlotMode nMode( SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG );
- OUString aCmdPrefix( ".uno:" );
+ const SfxSlotMode nMode( SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG );
+ OUString aCmdPrefix( ".uno:" );
- // Gruppe anw"ahlen ( Gruppe 0 ist intern )
- for ( sal_uInt16 i=0; i<pAppSlotPool->GetGroupCount(); i++ )
+ // Gruppe anw"ahlen ( Gruppe 0 ist intern )
+ for (sal_uInt16 i=0; i< rAppSlotPool.GetGroupCount(); ++i)
+ {
+ rAppSlotPool.SeekGroup(i);
+ const SfxSlot* pSfxSlot = rAppSlotPool.FirstSlot();
+ if ( pSfxSlot )
{
- pAppSlotPool->SeekGroup( i );
- const SfxSlot* pSfxSlot = pAppSlotPool->FirstSlot();
- if ( pSfxSlot )
+ sal_Int16 nCommandGroup = MapGroupIDToCommandGroup( pSfxSlot->GetGroupId() );
+ if ( nCommandGroup == nCmdGroup )
{
- sal_Int16 nCommandGroup = MapGroupIDToCommandGroup( pSfxSlot->GetGroupId() );
- if ( nCommandGroup == nCmdGroup )
+ while ( pSfxSlot )
{
- while ( pSfxSlot )
+ if ( pSfxSlot->GetMode() & nMode )
{
- if ( pSfxSlot->GetMode() & nMode )
- {
- frame::DispatchInformation aCmdInfo;
- OUStringBuffer aBuf( aCmdPrefix );
- aBuf.appendAscii( pSfxSlot->GetUnoName() );
- aCmdInfo.Command = aBuf.makeStringAndClear();
- aCmdInfo.GroupId = nCommandGroup;
- aCmdList.push_back( aCmdInfo );
- }
- pSfxSlot = pAppSlotPool->NextSlot();
+ frame::DispatchInformation aCmdInfo;
+ OUStringBuffer aBuf( aCmdPrefix );
+ aBuf.appendAscii( pSfxSlot->GetUnoName() );
+ aCmdInfo.Command = aBuf.makeStringAndClear();
+ aCmdInfo.GroupId = nCommandGroup;
+ aCmdList.push_back( aCmdInfo );
}
+ pSfxSlot = rAppSlotPool.NextSlot();
}
}
}