summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-31 09:22:57 +0200
committerNoel Grandin <noel@peralex.com>2016-03-31 13:23:04 +0200
commit3d7ac24d2f2ffbd2f5919916534601c140aa82e8 (patch)
treeba030bd45515b1bf5decc91e93ba70f52f1cc9b3
parent2cc5877a0cd08560478fe1f4206d7904e61e0557 (diff)
tdf#84938 convert DLG_CHAR_ constants to scoped enum
Change-Id: Ia58860f3f106d332596d2a682638edae6a270213
-rw-r--r--sw/inc/swabstdlg.hxx3
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx8
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/envelp/envfmt.cxx2
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx2
-rw-r--r--sw/source/uibase/inc/chrdlg.hxx12
-rw-r--r--sw/source/uibase/inc/chrdlgmodes.hxx7
-rw-r--r--sw/source/uibase/shells/annotsh.cxx2
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx2
-rw-r--r--sw/source/uibase/shells/textsh1.cxx2
11 files changed, 20 insertions, 24 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index e0ae20760f77..12f00c861f47 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -73,6 +73,7 @@ struct SfxChildWinInfo;
class SwTOXMark;
struct SwDocStat;
enum class SwBorderModes;
+enum class SwCharDlgMode;
#include <cnttab.hxx>
namespace com{namespace sun{namespace star{
@@ -336,7 +337,7 @@ public:
virtual AbstractSwBreakDlg * CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) = 0;
virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw) = 0;
virtual SfxAbstractTabDialog * CreateSwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
- sal_uInt8 nDialogMode, const OUString* pFormatStr = nullptr) = 0;
+ SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr) = 0;
virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0;
virtual VclAbstractDialog * CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) = 0;
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index fa8a26a92a0c..9ebfad1f79c6 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -60,7 +60,7 @@ using namespace ::com::sun::star::uno;
using namespace ::sfx2;
SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
- sal_uInt8 nDialogMode, const OUString* pStr)
+ SwCharDlgMode nDialogMode, const OUString* pStr)
: SfxTabDialog(pParent, "CharacterPropertiesDialog",
"modules/swriter/ui/characterproperties.ui", &rCoreSet, pStr != nullptr)
, m_rView(rVw)
@@ -81,7 +81,7 @@ SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreS
m_nCharBrdId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), nullptr );
SvtCJKOptions aCJKOptions;
- if(m_nDialogMode == DLG_CHAR_DRAW || m_nDialogMode == DLG_CHAR_ANN)
+ if(m_nDialogMode == SwCharDlgMode::Draw || m_nDialogMode == SwCharDlgMode::Ann)
{
RemoveTabPage(m_nCharUrlId);
RemoveTabPage(m_nCharBgdId);
@@ -90,7 +90,7 @@ SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreS
else if(!aCJKOptions.IsDoubleLinesEnabled())
RemoveTabPage(m_nCharTwoId);
- if(m_nDialogMode != DLG_CHAR_STD)
+ if(m_nDialogMode != SwCharDlgMode::Std)
RemoveTabPage(m_nCharBrdId);
}
@@ -107,7 +107,7 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
SvxFontListItem aFontListItem( *static_cast<const SvxFontListItem*>(
( m_rView.GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) );
aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
- if(m_nDialogMode != DLG_CHAR_DRAW && m_nDialogMode != DLG_CHAR_ANN)
+ if(m_nDialogMode != SwCharDlgMode::Draw && m_nDialogMode != SwCharDlgMode::Ann)
aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
rPage.PageCreated(aSet);
}
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 9a1888fe0b17..d810c719935f 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -707,7 +707,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView&
}
SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(vcl::Window* pParent, SwView& pVw,
- const SfxItemSet& rCoreSet, sal_uInt8 nDialogMode, const OUString* pFormatStr)
+ const SfxItemSet& rCoreSet, SwCharDlgMode nDialogMode, const OUString* pFormatStr)
{
VclPtr<SfxTabDialog> pDlg = VclPtr<SwCharDlg>::Create(pParent, pVw, rCoreSet, nDialogMode, pFormatStr);
return new AbstractTabDialog_Impl(pDlg);
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index eedba0552bc7..62d0ccb1caa6 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -382,7 +382,7 @@ public:
virtual AbstractSwBreakDlg * CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) override;
virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw) override;
virtual SfxAbstractTabDialog * CreateSwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
- sal_uInt8 nDialogMode, const OUString* pFormatStr = nullptr) override;
+ SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr) override;
virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) override;
virtual VclAbstractDialog * CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) override;
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 7d3bbb9b0dfd..a7183f1299d0 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -283,7 +283,7 @@ IMPL_LINK_TYPED( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void )
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
const OUString sFormatStr = pColl->GetName();
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, DLG_CHAR_ENV, &sFormatStr));
+ std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, SwCharDlgMode::Env, &sFormatStr));
OSL_ENSURE(pDlg, "Dialog creation failed!");
if (pDlg->Execute() == RET_OK)
{
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index f37e52536266..36acfa22a632 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1437,7 +1437,7 @@ void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView)
SfxItemSet aDlgAttr(*pPool, EE_ITEMS_START, EE_ITEMS_END);
aDlgAttr.Put(aEditAttr);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(rView.GetWindow(), rView, aDlgAttr, DLG_CHAR_ANN));
+ std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(rView.GetWindow(), rView, aDlgAttr, SwCharDlgMode::Ann));
sal_uInt16 nRet = pDlg->Execute();
if (RET_OK == nRet)
{
diff --git a/sw/source/uibase/inc/chrdlg.hxx b/sw/source/uibase/inc/chrdlg.hxx
index dbe87433b4f2..5f1482806f77 100644
--- a/sw/source/uibase/inc/chrdlg.hxx
+++ b/sw/source/uibase/inc/chrdlg.hxx
@@ -18,19 +18,15 @@
*/
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLG_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLG_HXX
-#include <sfx2/tabdlg.hxx>
+#include <sfx2/tabdlg.hxx>
#include <vcl/group.hxx>
-
#include <vcl/fixed.hxx>
-
#include <vcl/edit.hxx>
-
#include <vcl/combobox.hxx>
-
#include <vcl/button.hxx>
-
#include <vcl/lstbox.hxx>
+#include <chrdlgmodes.hxx>
class SwView;
class SvxMacroItem;
@@ -38,7 +34,7 @@ class SvxMacroItem;
class SwCharDlg: public SfxTabDialog
{
SwView& m_rView;
- sal_uInt8 m_nDialogMode;
+ SwCharDlgMode m_nDialogMode;
sal_uInt16 m_nCharStdId;
sal_uInt16 m_nCharExtId;
@@ -50,7 +46,7 @@ class SwCharDlg: public SfxTabDialog
public:
SwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
- sal_uInt8 nDialogMode, const OUString* pFormatStr = nullptr);
+ SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr);
virtual ~SwCharDlg();
diff --git a/sw/source/uibase/inc/chrdlgmodes.hxx b/sw/source/uibase/inc/chrdlgmodes.hxx
index e4b9fb34285a..cddb6a9c2983 100644
--- a/sw/source/uibase/inc/chrdlgmodes.hxx
+++ b/sw/source/uibase/inc/chrdlgmodes.hxx
@@ -11,10 +11,9 @@
#define INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLGMODES_HXX
// DialogModes for SwCharDlg
-#define DLG_CHAR_STD 0
-#define DLG_CHAR_DRAW 1
-#define DLG_CHAR_ENV 2
-#define DLG_CHAR_ANN 3
+enum class SwCharDlgMode {
+ Std, Draw, Env, Ann
+};
#endif // INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLGMODES_HXX
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 2876d0b1a650..0470216eaca5 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -490,7 +490,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR_ANN));
+ std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, SwCharDlgMode::Ann));
OSL_ENSURE(pDlg, "Dialog creation failed!");
if (nSlot == SID_CHAR_DLG_EFFECT)
{
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 00b10a52d151..4bbd6a958dce 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -345,7 +345,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
assert(pFact && "SwAbstractDialogFactory fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR_DRAW));
+ std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(pView->GetWindow(), *pView, aDlgAttr, SwCharDlgMode::Draw));
assert(pDlg && "Dialog creation failed!");
if (nSlot == SID_CHAR_DLG_EFFECT)
{
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 70ddbcfccb63..c61f88ad1329 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -173,7 +173,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- pDlg.reset(pFact->CreateSwCharDlg(rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, DLG_CHAR_STD));
+ pDlg.reset(pFact->CreateSwCharDlg(rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, SwCharDlgMode::Std));
OSL_ENSURE(pDlg, "Dialog creation failed!");
if( FN_INSERT_HYPERLINK == nSlot )
pDlg->SetCurPageId("hyperlink");