[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Mark Page
aptitude at btconnect.com
Wed Jul 13 19:17:36 UTC 2016
include/sfx2/objface.hxx | 10 ----------
sfx2/source/control/msgpool.cxx | 8 ++++----
2 files changed, 4 insertions(+), 14 deletions(-)
New commits:
commit 9641e51cd71d537313f9b238a0bab73701128b3b
Author: Mark Page <aptitude at btconnect.com>
Date: Wed Jul 13 13:21:03 2016 +0100
Remove SfxInterface::operator[]
This operator can be confusing when reading the SfxSlotPool source
Also this operator could return nullptr that SfxSlotPool doesn't
check or require.
Change-Id: I8d6009ea1b1f18e7022f1e7065c27f31feb02a6a
Reviewed-on: https://gerrit.libreoffice.org/27185
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx
index 0ec0938..babbc9f 100644
--- a/include/sfx2/objface.hxx
+++ b/include/sfx2/objface.hxx
@@ -43,8 +43,6 @@ friend class SfxSlotPool;
bool bSuperClass; // Whether children inherit its toolbars etc
std::unique_ptr<SfxInterface_Impl> pImplData;
- SfxSlot* operator[]( sal_uInt16 nPos ) const;
-
public:
SfxInterface( const char *pClass,
bool bSuperClass,
@@ -97,14 +95,6 @@ inline sal_uInt16 SfxInterface::Count() const
return nCount;
}
-
-// returns a function by position in the array
-
-inline SfxSlot* SfxInterface::operator[]( sal_uInt16 nPos ) const
-{
- return nPos < nCount? pSlots+nPos: nullptr;
-}
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx
index ab832d6..1f9dec0 100644
--- a/sfx2/source/control/msgpool.cxx
+++ b/sfx2/source/control/msgpool.cxx
@@ -60,7 +60,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface )
// Stop at a (single) Null-slot (for syntactic reasons the interfaces
// always contain at least one slot)
- if ( rInterface.Count() != 0 && !rInterface[0]->nSlotId )
+ if ( rInterface.Count() != 0 && !rInterface.pSlots[0].nSlotId )
return;
// possibly add Interface-id and group-ids of funcs to the list of groups
@@ -77,7 +77,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface )
for ( size_t nFunc = 0; nFunc < rInterface.Count(); ++nFunc )
{
- SfxSlot *pDef = rInterface[nFunc];
+ SfxSlot *pDef = &rInterface.pSlots[nFunc];
if ( pDef->GetGroupId() && /* pDef->GetGroupId() != GID_INTERN && */
_pGroups->find(pDef->GetGroupId()) == SfxSlotGroupArr_Impl::npos )
{
@@ -216,7 +216,7 @@ const SfxSlot* SfxSlotPool::SeekSlot( sal_uInt16 nStartInterface )
_nCurMsg < pInterface->Count();
++_nCurMsg )
{
- const SfxSlot* pMsg = (*pInterface)[_nCurMsg];
+ const SfxSlot* pMsg = &pInterface->pSlots[_nCurMsg];
if ( pMsg->GetGroupId() == _pGroups->at(_nCurGroup) )
return pMsg;
}
@@ -261,7 +261,7 @@ const SfxSlot* SfxSlotPool::NextSlot()
SfxInterface* pInterface = (*_pInterfaces)[nInterface];
while ( ++_nCurMsg < pInterface->Count() )
{
- SfxSlot* pMsg = (*pInterface)[_nCurMsg];
+ SfxSlot* pMsg = &pInterface->pSlots[_nCurMsg];
if ( pMsg->GetGroupId() == _pGroups->at(_nCurGroup) )
return pMsg;
}
More information about the Libreoffice-commits
mailing list