Kaydet (Commit) 81fbf138 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

tdf#84938 convert VIEWOPT_ constants to scoped enum

Change-Id: I7d72ed66ea2cf920a0a03a2aa71b5de079f0cf6e
üst 77c494de
......@@ -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);
......
......@@ -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 )
......
......@@ -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())) )
......
......@@ -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 )
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment