summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/dispatch.hxx23
-rw-r--r--sfx2/source/appl/appquit.cxx2
-rw-r--r--sfx2/source/control/dispatch.cxx16
-rw-r--r--sfx2/source/view/viewfrm.cxx6
-rw-r--r--sfx2/source/view/viewsh.cxx2
-rw-r--r--sw/source/uibase/uiview/view.cxx2
-rw-r--r--sw/source/uibase/web/wview.cxx2
7 files changed, 30 insertions, 23 deletions
diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
index 274c0c2444cd..dc9c5a79ef0b 100644
--- a/include/sfx2/dispatch.hxx
+++ b/include/sfx2/dispatch.hxx
@@ -27,6 +27,7 @@
#include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx>
+#include <o3tl/typed_flags_set.hxx>
class SfxSlotServer;
class SfxShell;
@@ -54,11 +55,17 @@ namespace com
}
-
-#define SFX_SHELL_POP_UNTIL 4
-#define SFX_SHELL_POP_DELETE 2
-#define SFX_SHELL_PUSH 1
-
+enum class SfxDispatcherPopFlags
+{
+ NONE = 0,
+ POP_UNTIL = 4,
+ POP_DELETE = 2,
+ PUSH = 1,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SfxDispatcherPopFlags> : is_typed_flags<SfxDispatcherPopFlags, 0x07> {};
+}
enum SfxSlotFilterState
{
@@ -143,11 +150,11 @@ public:
SfxBindings* GetBindings() const;
void Push( SfxShell& rShell );
- void Pop( SfxShell& rShell, sal_uInt16 nMode = 0 );
+ void Pop( SfxShell& rShell, SfxDispatcherPopFlags nMode = SfxDispatcherPopFlags::NONE );
SfxShell* GetShell(sal_uInt16 nIdx) const;
SfxViewFrame* GetFrame() const;
- SfxModule* GetModule() const;
+ SfxModule* GetModule() const;
// caller has to clean up the Manager on his own
static SfxPopupMenuManager* Popup( sal_uInt16 nConfigId, vcl::Window *pWin, const Point *pPos );
@@ -173,7 +180,7 @@ public:
::com::sun::star::frame::XDispatch* GetDispatchInterface( const OUString& );
void SetDisableFlags( sal_uInt32 nFlags );
- sal_uInt32 GetDisableFlags() const;
+ sal_uInt32 GetDisableFlags() const;
SAL_DLLPRIVATE void SetMenu_Impl();
SAL_DLLPRIVATE void Update_Impl( bool bForce = false ); // ObjectBars etc.
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index e49675d7f4a9..641392b008fc 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -85,7 +85,7 @@ void SfxApplication::Deinitialize()
"existing SfxViewFrame after Execute" );
DBG_ASSERT( !SfxObjectShell::GetFirst(),
"existing SfxObjectShell after Execute" );
- pAppData_Impl->pAppDispat->Pop( *this, SFX_SHELL_POP_UNTIL );
+ pAppData_Impl->pAppDispat->Pop( *this, SfxDispatcherPopFlags::POP_UNTIL );
pAppData_Impl->pAppDispat->Flush();
pAppData_Impl->bDowning = true;
pAppData_Impl->pAppDispat->DoDeactivate_Impl( true, NULL );
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 081d1a635383..987ef969b0ef 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -169,7 +169,7 @@ void SfxDispatcher::Flush()
void SfxDispatcher::Push(SfxShell& rShell)
{
- Pop( rShell, SFX_SHELL_PUSH );
+ Pop( rShell, SfxDispatcherPopFlags::PUSH );
}
/** This method checks whether a particular <SfxShell> instance is
@@ -411,25 +411,25 @@ SfxDispatcher::~SfxDispatcher()
SfxShell cancel each other out.
@param rShell the stack to take the SfxShell instance.
- @param nMode SFX_SHELL_POP_UNTIL
+ @param nMode SfxDispatcherPopFlags::POP_UNTIL
Also all 'rShell' of SfxShells are taken from the
stack.
- SFX_SHELL_POP_DELETE
+ SfxDispatcherPopFlags::POP_DELETE
All SfxShells actually taken from the stack
will be deleted.
- SFX_SHELL_PUSH (InPlace use only)
+ SfxDispatcherPopFlags::PUSH (InPlace use only)
The Shell is pushed.
*/
-void SfxDispatcher::Pop(SfxShell& rShell, sal_uInt16 nMode)
+void SfxDispatcher::Pop(SfxShell& rShell, SfxDispatcherPopFlags nMode)
{
DBG_ASSERT( rShell.GetInterface(),
"pushing SfxShell without previous RegisterInterface()" );
- bool bDelete = (nMode & SFX_SHELL_POP_DELETE) == SFX_SHELL_POP_DELETE;
- bool bUntil = (nMode & SFX_SHELL_POP_UNTIL) == SFX_SHELL_POP_UNTIL;
- bool bPush = (nMode & SFX_SHELL_PUSH) == SFX_SHELL_PUSH;
+ bool bDelete = bool(nMode & SfxDispatcherPopFlags::POP_DELETE);
+ bool bUntil = bool(nMode & SfxDispatcherPopFlags::POP_UNTIL);
+ bool bPush = bool(nMode & SfxDispatcherPopFlags::PUSH);
SfxApplication *pSfxApp = SfxGetpApp();
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index c36076b522a1..434b387dc50e 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1028,9 +1028,9 @@ void SfxViewFrame::PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell )
SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 );
if ( pSubShell == i_rViewShell.GetSubShell() )
// "real" sub shells will be deleted elsewhere
- pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL );
+ pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL );
else
- pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE );
+ pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE );
}
pDispatcher->Pop( i_rViewShell );
pDispatcher->Flush();
@@ -1519,7 +1519,7 @@ void SfxViewFrame::KillDispatcher_Impl()
if ( pDispatcher )
{
if( pModule )
- pDispatcher->Pop( *pModule, SFX_SHELL_POP_UNTIL );
+ pDispatcher->Pop( *pModule, SfxDispatcherPopFlags::POP_UNTIL );
else
pDispatcher->Pop( *this );
DELETEZ(pDispatcher);
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index e27660c64014..abfbbbce1591 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1474,7 +1474,7 @@ void SfxViewShell::PushSubShells_Impl( bool bPush )
{
SfxShell& rPopUntil = *pImp->aArr[0];
if ( pDisp->GetShellLevel( rPopUntil ) != USHRT_MAX )
- pDisp->Pop( rPopUntil, SFX_SHELL_POP_UNTIL );
+ pDisp->Pop( rPopUntil, SfxDispatcherPopFlags::POP_UNTIL );
}
pDisp->Flush();
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index fb92a818d428..8c16a79f3f5e 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -279,7 +279,7 @@ void SwView::SelectShell()
|| pSfxShell->ISA( SwAnnotationShell )
)
{
- rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_DELETE );
+ rDispatcher.Pop( *pSfxShell, SfxDispatcherPopFlags::POP_DELETE );
}
else if ( pSfxShell->ISA( FmFormShell ) )
{
diff --git a/sw/source/uibase/web/wview.cxx b/sw/source/uibase/web/wview.cxx
index eff5f9b6c713..ecd15c64109a 100644
--- a/sw/source/uibase/web/wview.cxx
+++ b/sw/source/uibase/web/wview.cxx
@@ -148,7 +148,7 @@ void SwWebView::SelectShell()
{
pSfxShell = rDispatcher.GetShell( --i );
OSL_ENSURE( pSfxShell, "My Shell ist lost in space" );
- rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE);
+ rDispatcher.Pop( *pSfxShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE);
}
}