diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-09-14 19:33:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-14 20:05:29 +0000 |
commit | 0f33526ec27a3abcfa1ca9348a46238b1432e5e4 (patch) | |
tree | 07b13b44a6c106275593fa7351f12dda62be9b68 /sw | |
parent | bee4ff508a456a1552aacdf6fc838b8b7cffb9ec (diff) |
put all SfxShell feature flags in one typed_flags class
make values unique across modules.
check if flag used in correct module.
Change-Id: I656ffd3d527dd895777e14e1cc933c8b9b3f6e46
Reviewed-on: https://gerrit.libreoffice.org/28906
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/view.hxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view0.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 13 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index 6222b6a48bc8..46ade150256a 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -95,9 +95,6 @@ const long nScrollY = 30; #define MAX_MARKS 5 -#define CHILDWIN_LABEL 1 -#define CHILDWIN_MAILMERGE 2 - enum ShellModes { SHELL_MODE_TEXT, @@ -378,7 +375,7 @@ public: void GotFocus() const; virtual SdrView* GetDrawView() const override; - virtual bool HasUIFeature( sal_uInt32 nFeature ) override; + virtual bool HasUIFeature(SfxShellFeature nFeature) const override; virtual void ShowCursor( bool bOn = true ) override; virtual ErrCode DoVerb( long nVerb ) override; @@ -613,7 +610,7 @@ public: // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active // or to support printing void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem>& rConfigItem, sal_uInt16 nRestart); - std::shared_ptr<SwMailMergeConfigItem> GetMailMergeConfigItem(); + std::shared_ptr<SwMailMergeConfigItem> GetMailMergeConfigItem() const; std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr, sal_uInt16 nWizardRestartPage = 0); void ExecFormatPaintbrush(SfxRequest &); diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index bd4798e500b6..93430e1bdcb7 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -110,7 +110,7 @@ void SwView::InitInterface_Impl() #endif GetStaticInterface()->RegisterChildWindow(FN_INSERT_FIELD_DATA_ONLY); - GetStaticInterface()->RegisterChildWindow(FN_SYNC_LABELS, false, CHILDWIN_LABEL); + GetStaticInterface()->RegisterChildWindow(FN_SYNC_LABELS, false, SfxShellFeature::SwChildWindowLabel); GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER, RID_TOOLS_TOOLBOX); @@ -146,7 +146,7 @@ void SwView::SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem>& rCon UIFeatureChanged(); } -std::shared_ptr<SwMailMergeConfigItem> SwView::GetMailMergeConfigItem() +std::shared_ptr<SwMailMergeConfigItem> SwView::GetMailMergeConfigItem() const { return m_pViewImpl->GetMailMergeConfigItem(); } diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 39121e85b426..da999bd04e25 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -555,17 +555,20 @@ void SwView::GetDrawState(SfxItemSet &rSet) } } -bool SwView::HasUIFeature( sal_uInt32 nFeature ) +bool SwView::HasUIFeature(SfxShellFeature nFeature) const { - bool bRet = false; + assert((nFeature & ~SfxShellFeature::SwMask) == SfxShellFeature::NONE); switch(nFeature) { - case CHILDWIN_LABEL : bRet = m_pWrtShell->IsLabelDoc(); break; + case SfxShellFeature::SwChildWindowLabel: + return m_pWrtShell->IsLabelDoc(); #if HAVE_FEATURE_DBCONNECTIVITY - case CHILDWIN_MAILMERGE : bRet = nullptr != GetMailMergeConfigItem(); break; + case SfxShellFeature::SwChildWindowMailmerge: + return (nullptr != GetMailMergeConfigItem()); #endif + default: + return false; } - return bRet; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |