summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-31 09:06:20 +0200
committerNoel Grandin <noel@peralex.com>2016-03-31 13:23:04 +0200
commit81fbf1386a36972be7d3eff3f7a0c6bab80be764 (patch)
treec0d3a8c6f55d00ebf2024fe69bba403528008f8b
parent77c494de9bf9191a66fb6f90cc2148f60c25c088 (diff)
tdf#84938 convert VIEWOPT_ constants to scoped enum
Change-Id: I7d72ed66ea2cf920a0a03a2aa71b5de079f0cf6e
-rw-r--r--sw/inc/swmodule.hxx13
-rw-r--r--sw/source/uibase/app/appopt.cxx2
-rw-r--r--sw/source/uibase/app/swmodul1.cxx8
-rw-r--r--sw/source/uibase/uiview/view0.cxx2
-rw-r--r--sw/source/uibase/uno/unomod.cxx6
5 files changed, 17 insertions, 14 deletions
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 4dedce760946..05b74ee71a07 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -54,10 +54,13 @@ class SvtCTLOptions;
class SvtUserOptions;
struct SwDBData;
-#define VIEWOPT_DEST_VIEW 0
-#define VIEWOPT_DEST_TEXT 1
-#define VIEWOPT_DEST_WEB 2
-#define VIEWOPT_DEST_VIEW_ONLY 3 //ViewOptions are set only at View, not at the appl.
+
+enum class SvViewOpt {
+ DestView,
+ DestText,
+ DestWeb,
+ DestViewOnly //ViewOptions are set only at View, not at the appl.
+};
namespace com{ namespace sun{ namespace star{ namespace scanner{
class XScannerManager2;
@@ -145,7 +148,7 @@ public:
const SwMasterUsrPref *GetUsrPref(bool bWeb) const;
const SwViewOption* GetViewOption(bool bWeb);
void ApplyUsrPref(const SwViewOption &, SwView*,
- sal_uInt16 nDest = VIEWOPT_DEST_VIEW );
+ SvViewOpt nDest = SvViewOpt::DestView );
void ApplyUserMetric( FieldUnit eMetric, bool bWeb );
void ApplyRulerMetric( FieldUnit eMetric, bool bHorizontal, bool bWeb );
void ApplyFieldUpdateFlags(SwFieldUpdateFlags eFieldFlags);
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index 51ca86c97b31..f4f31a2d9fd6 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -414,7 +414,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
aViewOpt.SetIgnoreProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
// set elements for the current view and shell
- ApplyUsrPref( aViewOpt, pAppView, bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB);
+ ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
}
VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx
index ad02fe812c8b..c30b361db2a6 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -136,18 +136,18 @@ SwView* SwModule::GetNextView(SwView* pView)
// New Master for the settings is set; this affects the current view and all following.
void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
- sal_uInt16 nDest )
+ SvViewOpt nDest )
{
SwView* pCurrView = pActView;
SwViewShell* pSh = pCurrView ? &pCurrView->GetWrtShell() : nullptr;
SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(GetUsrPref(
- nDest == VIEWOPT_DEST_WEB
- || (nDest != VIEWOPT_DEST_TEXT
+ nDest == SvViewOpt::DestWeb
+ || (nDest != SvViewOpt::DestText
&& pCurrView && dynamic_cast< const SwWebView *>( pCurrView ) != nullptr) ));
// with Uno, only sdbcx::View, but not the Module should be changed
- bool bViewOnly = VIEWOPT_DEST_VIEW_ONLY == nDest;
+ bool bViewOnly = SvViewOpt::DestViewOnly == nDest;
// fob Preview off
SwPagePreview* pPPView;
if( !pCurrView && nullptr != (pPPView = dynamic_cast<SwPagePreview*>( SfxViewShell::Current())) )
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index 37631c6480a0..297189b7ef3a 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -591,7 +591,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
if( !bModified )
rSh.ResetModified();
- pModule->ApplyUsrPref( *pOpt, this, bWebView ? VIEWOPT_DEST_WEB : VIEWOPT_DEST_TEXT );
+ pModule->ApplyUsrPref( *pOpt, this, bWebView ? SvViewOpt::DestWeb : SvViewOpt::DestText );
// #i6193# let postits know about new spellcheck setting
if ( nSlot == SID_AUTOSPELL_CHECK )
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index 195dfcee2479..1d5e87b44d21 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -810,9 +810,9 @@ void SwXViewSettings::_postSetValues()
SW_MOD()->ApplyRulerMetric( (FieldUnit)eVRulerUnit, false, bWeb );
}
- SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? VIEWOPT_DEST_VIEW_ONLY
- : bWeb ? VIEWOPT_DEST_WEB
- : VIEWOPT_DEST_TEXT );
+ SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? SvViewOpt::DestViewOnly
+ : bWeb ? SvViewOpt::DestWeb
+ : SvViewOpt::DestText );
delete mpViewOption;
mpViewOption = nullptr;