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 /include/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 'include/sfx2')
-rw-r--r-- | include/sfx2/dispatch.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/msg.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/shell.hxx | 14 |
3 files changed, 16 insertions, 6 deletions
diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx index 441254a5490f..2487d3e7f90e 100644 --- a/include/sfx2/dispatch.hxx +++ b/include/sfx2/dispatch.hxx @@ -165,8 +165,8 @@ public: SfxItemState QueryState( sal_uInt16 nSID, const SfxPoolItem* &rpState ); SfxItemState QueryState( sal_uInt16 nSID, css::uno::Any& rAny ); - void SetDisableFlags( sal_uInt32 nFlags ); - sal_uInt32 GetDisableFlags() const; + void SetDisableFlags( SfxDisableFlags nFlags ); + SfxDisableFlags GetDisableFlags() const; SAL_DLLPRIVATE void SetMenu_Impl(); SAL_DLLPRIVATE void Update_Impl( bool bForce = false ); // ObjectBars etc. diff --git a/include/sfx2/msg.hxx b/include/sfx2/msg.hxx index d29e21f4b4fc..13b5e25e8c41 100644 --- a/include/sfx2/msg.hxx +++ b/include/sfx2/msg.hxx @@ -156,7 +156,7 @@ SFX_DECL_TYPE(23); // for SvxSearchItem StateMethodPtr, \ (const SfxType*) &a##ItemClass##_Impl, \ 0, 0, \ - &a##aShellClass##Args_Impl[nArg0], nArgs, 0, Name \ + &a##aShellClass##Args_Impl[nArg0], nArgs, SfxDisableFlags::NONE, Name \ } #define SFX_SLOT( aShellClass, id, GroupId, ExecMethodPtr, StateMethodPtr, Flags, ItemClass ) \ @@ -220,7 +220,7 @@ public: const SfxFormalArgument* pFirstArgDef; // first formal Argument-Definition sal_uInt16 nArgDefCount; // Number of formal Arguments - long nDisableFlags; // DisableFlags that need to be + SfxDisableFlags nDisableFlags; // DisableFlags that need to be // present, so that the Slot // can be enabled const char* pUnoName; // UnoName for the Slots diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx index 9d10117f26cb..d6df8ab36717 100644 --- a/include/sfx2/shell.hxx +++ b/include/sfx2/shell.hxx @@ -123,6 +123,16 @@ namespace o3tl template<> struct typed_flags<SfxShellFeature> : is_typed_flags<SfxShellFeature, 0x3ffd> {}; } +/* Flags that are being used in the slot definitions for the disable-features */ +enum class SfxDisableFlags { + NONE, + SwOnProtectedCursor = 0x0001, + SwOnMailboxEditor = 0x0002, +}; +namespace o3tl { + template<> struct typed_flags<SfxDisableFlags> : is_typed_flags<SfxDisableFlags, 0x0003> {}; +} + typedef void (*SfxExecFunc)(SfxShell *, SfxRequest &rReq); typedef void (*SfxStateFunc)(SfxShell *, SfxItemSet &rSet); @@ -453,8 +463,8 @@ public: void SetHelpId(sal_uIntPtr nId); sal_uIntPtr GetHelpId() const; virtual SfxObjectShell* GetObjectShell(); - void SetDisableFlags( sal_uIntPtr nFlags ); - sal_uIntPtr GetDisableFlags() const; + void SetDisableFlags( SfxDisableFlags nFlags ); + SfxDisableFlags GetDisableFlags() const; virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ); virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ); |