diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-23 13:34:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-24 08:05:55 +0200 |
commit | 0e04b531448d7915b40c59dccef7a9313bd28c11 (patch) | |
tree | ed7c568e3279b8e7b83cac022f903a8cae4b2ea2 | |
parent | 06dd5b9c9e34ad932b0a111c0ecb9f1e99008a19 (diff) |
convert SFXWB_ constants to scoped enum
Change-Id: I63d442e51b7e22093da1c232e1b575bc961c0e69
-rw-r--r-- | include/sfx2/new.hxx | 7 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdpreslt.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/new.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmdocselectpage.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx index 7ce3c8207da7..6113215f8af7 100644 --- a/include/sfx2/new.hxx +++ b/include/sfx2/new.hxx @@ -34,8 +34,9 @@ class SfxObjectShellLock; class SfxObjectShell; -#define SFXWB_PREVIEW 0x0003 -#define SFXWB_LOAD_TEMPLATE 0x0004 +enum class SfxNewFileDialogMode { + NONE, Preview, LoadTemplate +}; enum class SfxTemplateFlags { @@ -63,7 +64,7 @@ private: public: - SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags); + SfxNewFileDialog(vcl::Window *pParent, SfxNewFileDialogMode nFlags); virtual ~SfxNewFileDialog() override; virtual void dispose() override; diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 6ee9b9a24b20..e406177a91ec 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -178,7 +178,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLayoutHdl, ValueSet*, void) */ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl, Button*, void) { - VclPtrInstance< SfxNewFileDialog > pDlg(this, SFXWB_PREVIEW); + VclPtrInstance< SfxNewFileDialog > pDlg(this, SfxNewFileDialogMode::Preview); pDlg->SetText(SD_RESSTR(STR_LOAD_PRESENTATION_LAYOUT)); if(!IsReallyVisible()) diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 0a7f60b219e0..5d55b9c1ab39 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -140,7 +140,7 @@ class SfxNewFileDialog_Impl OUString aNone; OUString sLoadTemplate; - sal_uInt16 nFlags; + SfxNewFileDialogMode nFlags; SfxDocumentTemplates aTemplates; SfxObjectShellLock xDocShell; VclPtr<SfxNewFileDialog> pAntiImpl; @@ -156,7 +156,7 @@ class SfxNewFileDialog_Impl public: - SfxNewFileDialog_Impl(SfxNewFileDialog* pAntiImplP, sal_uInt16 nFlags); + SfxNewFileDialog_Impl(SfxNewFileDialog* pAntiImplP, SfxNewFileDialogMode nFlags); ~SfxNewFileDialog_Impl(); // Returns sal_False if '- No -' is set as a template @@ -186,7 +186,7 @@ IMPL_LINK_NOARG(SfxNewFileDialog_Impl, Update, Idle*, void) return; } - if (m_pMoreBt->get_expanded() && (nFlags & SFXWB_PREVIEW) == SFXWB_PREVIEW) + if (m_pMoreBt->get_expanded() && (nFlags == SfxNewFileDialogMode::Preview)) { OUString aFileName = aTemplates.GetPath(m_pRegionLb->GetSelectEntryPos(), nEntry - 1); @@ -342,7 +342,7 @@ void SfxNewFileDialog_Impl::SetTemplateFlags(SfxTemplateFlags nSet) SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( - SfxNewFileDialog* pAntiImplP, sal_uInt16 nFl) + SfxNewFileDialog* pAntiImplP, SfxNewFileDialogMode nFl) : aNone(SfxResId(STR_NONE).toString()) , nFlags(nFl) , pAntiImpl(pAntiImplP) @@ -366,9 +366,9 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( pAntiImplP->get(m_pLoadFilePB, "fromfile"); sLoadTemplate = pAntiImplP->get<FixedText>("alttitle")->GetText(); - if (!nFlags) + if (nFlags == SfxNewFileDialogMode::NONE) m_pMoreBt->Hide(); - else if(SFXWB_LOAD_TEMPLATE == nFlags) + else if(SfxNewFileDialogMode::LoadTemplate == nFlags) { m_pLoadFilePB->SetClickHdl(LINK(this, SfxNewFileDialog_Impl, LoadFile)); m_pLoadFilePB->Show(); @@ -389,7 +389,7 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( OUString &rExtra = pAntiImplP->GetExtraData(); bool bExpand = !rExtra.isEmpty() && rExtra[0] == 'Y'; - m_pMoreBt->set_expanded(bExpand && nFlags); + m_pMoreBt->set_expanded(bExpand && (nFlags != SfxNewFileDialogMode::NONE)); m_pTemplateLb->SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect)); m_pTemplateLb->SetDoubleClickHdl(LINK(this, SfxNewFileDialog_Impl, DoubleClick)); @@ -421,7 +421,7 @@ SfxNewFileDialog_Impl::~SfxNewFileDialog_Impl() rExtra = m_pMoreBt->get_expanded() ? OUString("Y") : OUString("N"); } -SfxNewFileDialog::SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags) +SfxNewFileDialog::SfxNewFileDialog(vcl::Window *pParent, SfxNewFileDialogMode nFlags) : SfxModalDialog(pParent, "LoadTemplateDialog", "sfx/ui/loadtemplatedialog.ui"), pImpl( new SfxNewFileDialog_Impl(this, nFlags) ) diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index 4a6ed92e73b2..195e7ea7cd02 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -123,7 +123,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, Button*, pButton, void) if(bTemplate) { m_pLoadTemplateRB->Check(); - VclPtrInstance< SfxNewFileDialog > pNewFileDlg(this, 0); + VclPtrInstance< SfxNewFileDialog > pNewFileDlg(this, SfxNewFileDialogMode::NONE); sal_uInt16 nRet = pNewFileDlg->Execute(); if(RET_TEMPLATE_LOAD == nRet) bTemplate = false; diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index c1f8a658ff5b..eff2461e784c 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -497,7 +497,7 @@ void SwDocShell::Execute(SfxRequest& rReq) { SvtPathOptions aPathOpt; ScopedVclPtr<SfxNewFileDialog> pNewFileDlg( - VclPtr<SfxNewFileDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), SFXWB_LOAD_TEMPLATE)); + VclPtr<SfxNewFileDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), SfxNewFileDialogMode::LoadTemplate)); pNewFileDlg->SetTemplateFlags(nFlags); nRet = pNewFileDlg->Execute(); |