include/sfx2/objface.hxx | 6 +++--- sfx2/source/control/msgpool.cxx | 4 ++-- sfx2/source/control/objface.cxx | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-)
New commits: commit 15fbb59dd30a8d03fd79fcbf9a6d21526b25942e Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Jul 9 15:35:46 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Jul 9 17:47:13 2025 +0200 const up SfxSlot member Change-Id: Id666c62e25bf05169f488585a83d1278aef11cc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187581 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx index d537069ca0f3..0a1745d66578 100644 --- a/include/sfx2/objface.hxx +++ b/include/sfx2/objface.hxx @@ -57,7 +57,7 @@ friend class SfxSlotPool; const char* pName; // Sfx-internal name of interface const SfxInterface* pGenoType; // base interface - SfxSlot* pSlots; // SlotMap + const SfxSlot* pSlots; // SlotMap sal_uInt16 nCount; // number of slots in SlotMap SfxInterfaceId nClassId; // Id of interface bool bSuperClass; // Whether children inherit its toolbars etc @@ -68,10 +68,10 @@ public: bool bSuperClass, SfxInterfaceId nClassId, const SfxInterface* pGeno, - SfxSlot &rMessages, sal_uInt16 nMsgCount ); + const SfxSlot &rMessages, sal_uInt16 nMsgCount ); ~SfxInterface(); - void SetSlotMap( SfxSlot& rMessages, sal_uInt16 nMsgCount ); + void SetSlotMap( const SfxSlot& rMessages, sal_uInt16 nMsgCount ); inline sal_uInt16 Count() const; const SfxSlot* GetRealSlot( const SfxSlot * ) const; diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index f7a94203e6b7..a54f93e63a26 100644 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -130,7 +130,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) for ( size_t nFunc = 0; nFunc < rInterface.Count(); ++nFunc ) { - SfxSlot &rDef = rInterface.pSlots[nFunc]; + const SfxSlot &rDef = rInterface.pSlots[nFunc]; if ( rDef.GetGroupId() != SfxGroupId::NONE && std::find(_vGroups.begin(), _vGroups.end(), rDef.GetGroupId()) == _vGroups.end() ) { @@ -285,7 +285,7 @@ const SfxSlot* SfxSlotPool::NextSlot() SfxInterface* pInterface = _vInterfaces[nInterface]; while ( ++_nCurMsg < pInterface->Count() ) { - SfxSlot& rMsg = pInterface->pSlots[_nCurMsg]; + const SfxSlot& rMsg = pInterface->pSlots[_nCurMsg]; if (rMsg.GetGroupId() == _vGroups.at(_nCurGroup)) return &rMsg; } diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 96afa430ac4e..8fa5bbc55b62 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -84,7 +84,7 @@ SfxInterface::SfxInterface( const char *pClassName, bool bUsableSuperClass, SfxInterfaceId nId, const SfxInterface* pParent, - SfxSlot &rSlotMap, sal_uInt16 nSlotCount ): + const SfxSlot &rSlotMap, sal_uInt16 nSlotCount ): pName(pClassName), pGenoType(pParent), nClassId(nId), @@ -102,11 +102,11 @@ void SfxInterface::Register( const SfxModule* pMod ) SfxGetpApp()->GetAppSlotPool_Impl().RegisterInterface(*this); } -void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) +void SfxInterface::SetSlotMap( const SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) { pSlots = &rSlotMap; nCount = nSlotCount; - SfxSlot* pIter = pSlots; + const SfxSlot* pIter = pSlots; if ( !pIter->pNextSlot ) { @@ -120,7 +120,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) else { sal_uInt16 nIter = 1; - for ( SfxSlot *pNext = pIter+1; nIter < nCount; ++pNext, ++nIter ) + for (const SfxSlot *pNext = pIter+1; nIter < nCount; ++pNext, ++nIter) { if ( pNext->GetSlotId() <= pIter->GetSlotId() )