diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-08 10:20:47 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-08 14:00:37 +0200 |
commit | 98fa826a51a67d278c7c81f728c35753ffefe1b5 (patch) | |
tree | d81d489b43e483734684371de231e9bff312ec44 /sfx2 | |
parent | e137c4028ce5ceb2bbf988f47875e6b5e2c9764f (diff) |
convert SfxSlotKind to scoped enum
Change-Id: I742e83bd455bc0efa4ad5a34575d3255c3a9a16f
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/bindings.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/control/msg.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/control/objface.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/shell.cxx | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 843169fb91e7..c1d7e5f837a4 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -1181,7 +1181,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell { SfxItemPool &rPool = pShell->GetPool(); - if ( SFX_KIND_ENUM == pSlot->GetKind() ) + if ( SfxSlotKind::Enum == pSlot->GetKind() ) { // for Enum-Slots, the Master has to be executed with the value // of the enums @@ -1191,7 +1191,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell aReq.AppendItem( SfxAllEnumItem( rPool.GetWhich(nSlotId), pSlot->GetValue() ) ); pDispatcher->_Execute( *pShell, *pRealSlot, aReq, aReq.GetCallMode() | SfxCallMode::RECORD ); } - else if ( SFX_KIND_ATTR == pSlot->GetKind() ) + else if ( SfxSlotKind::Attribute == pSlot->GetKind() ) { // Which value has to be mapped for Attribute slots const sal_uInt16 nSlotId = pSlot->GetSlotId(); @@ -1339,7 +1339,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl // get the status method, which is served by the pCache SfxStateFunc pFnc = nullptr; const SfxInterface *pInterface = pShell->GetInterface(); - if ( SFX_KIND_ENUM == pMsgSvr->GetSlot()->GetKind() ) + if ( SfxSlotKind::Enum == pMsgSvr->GetSlot()->GetKind() ) { pRealSlot = pInterface->GetRealSlot(pMsgSvr->GetSlot()); pCache = GetStateCache( pRealSlot->GetSlotId() ); @@ -1451,7 +1451,7 @@ void SfxBindings::UpdateControllers_Impl SfxItemState eState // state of item ) { - DBG_ASSERT( !rFound.pSlot || SFX_KIND_ENUM != rFound.pSlot->GetKind(), + DBG_ASSERT( !rFound.pSlot || SfxSlotKind::Enum != rFound.pSlot->GetKind(), "direct update of enum slot isn't allowed" ); SfxStateCache* pCache = rFound.pCache; @@ -1498,7 +1498,7 @@ void SfxBindings::UpdateControllers_Impl for ( const SfxSlot *pSlave = pFirstSlave; pSlave; pSlave = pSlave->GetNextSlot() ) { DBG_ASSERT(pSlave, "Wrong SlaveSlot binding!"); - DBG_ASSERT(SFX_KIND_ENUM == pSlave->GetKind(),"non enum slaves aren't allowed"); + DBG_ASSERT(SfxSlotKind::Enum == pSlave->GetKind(),"non enum slaves aren't allowed"); DBG_ASSERT(pSlave->GetMasterSlotId() == pSlot->GetSlotId(),"Wrong MasterSlot!"); // Binding exist for function ? diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index 574182c3cc98..688c948b5def 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -26,19 +26,19 @@ SfxSlotKind SfxSlot::GetKind() const { if( !nMasterSlotId && !nValue) - return (SfxSlotKind) SFX_KIND_STANDARD; + return SfxSlotKind::Standard; if ( nMasterSlotId && fnExec==nullptr && fnState==nullptr ) { if ( *pType->pType == typeid(SfxBoolItem) ) - return (SfxSlotKind) SFX_KIND_ENUM; + return SfxSlotKind::Enum; else { OSL_FAIL( "invalid slot kind detected" ); - return SFX_KIND_ENUM; + return SfxSlotKind::Enum; } } else - return (SfxSlotKind) SFX_KIND_ATTR; + return SfxSlotKind::Attribute; } diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index cd51b0a303b9..ecaebd93e416 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -153,7 +153,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) // every master refers to his first slave (ENUM), // all slaves refer to their master. // Slaves refer in a circle to the other slaves with the same master - if ( pIter->GetKind() == SFX_KIND_ENUM ) + if ( pIter->GetKind() == SfxSlotKind::Enum ) { pIter->pLinkedSlot = GetSlot( pIter->nMasterSlotId ); assert( pIter->pLinkedSlot ); @@ -203,7 +203,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) if ( pNext->GetSlotId() <= pIter->GetSlotId() ) SAL_WARN( "sfx.control", "Wrong order" ); - if ( pIter->GetKind() == SFX_KIND_ENUM ) + if ( pIter->GetKind() == SfxSlotKind::Enum ) { const SfxSlot *pMasterSlot = GetSlot(pIter->nMasterSlotId); const SfxSlot *pFirstSlave = pMasterSlot->pLinkedSlot; @@ -240,7 +240,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) { if ( pIter->pLinkedSlot ) { - if ( pIter->pLinkedSlot->GetKind() != SFX_KIND_ENUM ) + if ( pIter->pLinkedSlot->GetKind() != SfxSlotKind::Enum ) { OStringBuffer aStr("Slave is no enum: "); aStr.append(static_cast<sal_Int32>(pIter->GetSlotId())); diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index c37c41d26ea2..d009c0cc283f 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -272,7 +272,7 @@ void SfxShell::Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId ) if ( pSlot ) { // At Enum-Slots invalidate the Master-Slot - if ( SFX_KIND_ENUM == pSlot->GetKind() ) + if ( SfxSlotKind::Enum == pSlot->GetKind() ) pSlot = pSlot->GetLinkedSlot(); // Invalidate the Slot itself and possible also all Slave-Slots |