diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-03-21 20:09:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-22 06:46:10 +0000 |
commit | e9c7d259e8ed3144d4226aef7c3de351e4706b79 (patch) | |
tree | 155034670744a756c45d122652092871281c82bf /sfx2 | |
parent | bdf41d8aeb53a298780f3633a76d71598a695bab (diff) |
create SfxDisableFlags enum
Change-Id: Ib59c7886017247977b916a8e140853fb8310582f
Reviewed-on: https://gerrit.libreoffice.org/35514
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 15 | ||||
-rw-r--r-- | sfx2/source/control/shell.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 2 |
4 files changed, 14 insertions, 13 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 37a1726b5abf..f6d19173b3c7 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -141,7 +141,7 @@ struct SfxDispatcher_Impl // 2==ReadOnlyDoc overturned sal_uInt16 nFilterCount; // Number of SIDs in pFilterSIDs const sal_uInt16* pFilterSIDs; // sorted Array of SIDs - sal_uInt32 nDisableFlags; + SfxDisableFlags nDisableFlags; bool bFlushed; std::deque< std::deque<SfxToDo_Impl> > aToDoCopyStack; }; @@ -437,7 +437,7 @@ void SfxDispatcher::Construct_Impl() xImp->nFilterEnabling = SfxSlotFilterState::DISABLED; xImp->nFilterCount = 0; xImp->pFilterSIDs = nullptr; - xImp->nDisableFlags = 0; + xImp->nDisableFlags = SfxDisableFlags::NONE; xImp->pParent = nullptr; @@ -1540,7 +1540,7 @@ void SfxDispatcher::FlushImpl() DBG_ASSERT( !xImp->aStack.empty(), "popping from empty stack" ); pPopped = xImp->aStack.back(); xImp->aStack.pop_back(); - pPopped->SetDisableFlags( 0 ); + pPopped->SetDisableFlags( SfxDisableFlags::NONE ); bFound = (pPopped == i->pCluster); // Mark the moved Shell @@ -1807,7 +1807,8 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, SfxSlotServer& rServer, bool b SfxInterface *pIFace = pObjShell->GetInterface(); const SfxSlot *pSlot = pIFace->GetSlot(nSlot); - if ( pSlot && pSlot->nDisableFlags && ( pSlot->nDisableFlags & pObjShell->GetDisableFlags() ) != 0 ) + if ( pSlot && pSlot->nDisableFlags != SfxDisableFlags::NONE && + ( (int)pSlot->nDisableFlags & (int)pObjShell->GetDisableFlags() ) != 0 ) return false; if ( pSlot && !( pSlot->nFlags & SfxSlotMode::READONLYDOC ) && bReadOnly ) @@ -2148,7 +2149,7 @@ void SfxDispatcher::RemoveShell_Impl( SfxShell& rShell ) if ( xImp->aStack[n] == &rShell ) { xImp->aStack.erase( xImp->aStack.begin() + n ); - rShell.SetDisableFlags( 0 ); + rShell.SetDisableFlags( SfxDisableFlags::NONE ); rShell.DoDeactivate_Impl(xImp->pFrame, true); break; } @@ -2192,14 +2193,14 @@ bool SfxDispatcher::IsUpdated_Impl() const return xImp->bUpdated; } -void SfxDispatcher::SetDisableFlags( sal_uInt32 nFlags ) +void SfxDispatcher::SetDisableFlags( SfxDisableFlags nFlags ) { xImp->nDisableFlags = nFlags; for ( SfxShellStack_Impl::reverse_iterator it = xImp->aStack.rbegin(); it != xImp->aStack.rend(); ++it ) (*it)->SetDisableFlags( nFlags ); } -sal_uInt32 SfxDispatcher::GetDisableFlags() const +SfxDisableFlags SfxDispatcher::GetDisableFlags() const { return xImp->nDisableFlags; } diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 4703f7921972..a1a69b6cf169 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -61,7 +61,7 @@ struct SfxShell_Impl: public SfxBroadcaster SfxViewFrame* pFrame; // Frame, if <UI-active> SfxRepeatTarget* pRepeatTarget; // SbxObjectRef xParent; bool bActive; - sal_uIntPtr nDisableFlags; + SfxDisableFlags nDisableFlags; sal_uIntPtr nHelpId; svtools::AsynchronLink* pExecuter; svtools::AsynchronLink* pUpdater; @@ -75,7 +75,7 @@ struct SfxShell_Impl: public SfxBroadcaster , pFrame(nullptr) , pRepeatTarget(nullptr) , bActive(false) - , nDisableFlags(0) + , nDisableFlags(SfxDisableFlags::NONE) , nHelpId(0) , pExecuter(nullptr) , pUpdater(nullptr) @@ -684,12 +684,12 @@ void SfxShell::UIFeatureChanged() } } -void SfxShell::SetDisableFlags( sal_uIntPtr nFlags ) +void SfxShell::SetDisableFlags( SfxDisableFlags nFlags ) { pImpl->nDisableFlags = nFlags; } -sal_uIntPtr SfxShell::GetDisableFlags() const +SfxDisableFlags SfxShell::GetDisableFlags() const { return pImpl->nDisableFlags; } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 5d46a2db7c60..75fe7d357dad 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4135,7 +4135,7 @@ Reference< frame::XController2 > SAL_CALL SfxBaseModel::createViewController( ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" ); // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also - pViewFrame->GetDispatcher()->SetDisableFlags( 0 ); + pViewFrame->GetDispatcher()->SetDisableFlags( SfxDisableFlags::NONE ); pViewFrame->SetViewShell_Impl( pViewShell ); // remember ViewID diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index a16fda352944..35ccfbebc980 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1027,7 +1027,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl() } } - GetDispatcher()->SetDisableFlags( 0 ); + GetDispatcher()->SetDisableFlags( SfxDisableFlags::NONE ); } bool SfxViewFrame::Close() |