Kaydet (Commit) 3d7ac24d authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

tdf#84938 convert DLG_CHAR_ constants to scoped enum

Change-Id: Ia58860f3f106d332596d2a682638edae6a270213
üst 2cc5877a
...@@ -73,6 +73,7 @@ struct SfxChildWinInfo; ...@@ -73,6 +73,7 @@ struct SfxChildWinInfo;
class SwTOXMark; class SwTOXMark;
struct SwDocStat; struct SwDocStat;
enum class SwBorderModes; enum class SwBorderModes;
enum class SwCharDlgMode;
#include <cnttab.hxx> #include <cnttab.hxx>
namespace com{namespace sun{namespace star{ namespace com{namespace sun{namespace star{
...@@ -336,7 +337,7 @@ public: ...@@ -336,7 +337,7 @@ public:
virtual AbstractSwBreakDlg * CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) = 0; virtual AbstractSwBreakDlg * CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) = 0;
virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw) = 0; virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw) = 0;
virtual SfxAbstractTabDialog * CreateSwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, 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 AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0;
virtual VclAbstractDialog * CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) = 0; virtual VclAbstractDialog * CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) = 0;
......
...@@ -60,7 +60,7 @@ using namespace ::com::sun::star::uno; ...@@ -60,7 +60,7 @@ using namespace ::com::sun::star::uno;
using namespace ::sfx2; using namespace ::sfx2;
SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet, SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
sal_uInt8 nDialogMode, const OUString* pStr) SwCharDlgMode nDialogMode, const OUString* pStr)
: SfxTabDialog(pParent, "CharacterPropertiesDialog", : SfxTabDialog(pParent, "CharacterPropertiesDialog",
"modules/swriter/ui/characterproperties.ui", &rCoreSet, pStr != nullptr) "modules/swriter/ui/characterproperties.ui", &rCoreSet, pStr != nullptr)
, m_rView(rVw) , m_rView(rVw)
...@@ -81,7 +81,7 @@ SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreS ...@@ -81,7 +81,7 @@ SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreS
m_nCharBrdId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), nullptr ); m_nCharBrdId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), nullptr );
SvtCJKOptions aCJKOptions; 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_nCharUrlId);
RemoveTabPage(m_nCharBgdId); RemoveTabPage(m_nCharBgdId);
...@@ -90,7 +90,7 @@ SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreS ...@@ -90,7 +90,7 @@ SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreS
else if(!aCJKOptions.IsDoubleLinesEnabled()) else if(!aCJKOptions.IsDoubleLinesEnabled())
RemoveTabPage(m_nCharTwoId); RemoveTabPage(m_nCharTwoId);
if(m_nDialogMode != DLG_CHAR_STD) if(m_nDialogMode != SwCharDlgMode::Std)
RemoveTabPage(m_nCharBrdId); RemoveTabPage(m_nCharBrdId);
} }
...@@ -107,7 +107,7 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) ...@@ -107,7 +107,7 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
SvxFontListItem aFontListItem( *static_cast<const SvxFontListItem*>( SvxFontListItem aFontListItem( *static_cast<const SvxFontListItem*>(
( m_rView.GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) ); ( m_rView.GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) );
aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), 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)); aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
......
...@@ -707,7 +707,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& ...@@ -707,7 +707,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView&
} }
SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(vcl::Window* pParent, SwView& pVw, 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); VclPtr<SfxTabDialog> pDlg = VclPtr<SwCharDlg>::Create(pParent, pVw, rCoreSet, nDialogMode, pFormatStr);
return new AbstractTabDialog_Impl(pDlg); return new AbstractTabDialog_Impl(pDlg);
......
...@@ -382,7 +382,7 @@ public: ...@@ -382,7 +382,7 @@ public:
virtual AbstractSwBreakDlg * CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) override; virtual AbstractSwBreakDlg * CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) override;
virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw) override; virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw) override;
virtual SfxAbstractTabDialog * CreateSwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, 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 AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) override;
virtual VclAbstractDialog * CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) override; virtual VclAbstractDialog * CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) override;
......
...@@ -283,7 +283,7 @@ IMPL_LINK_TYPED( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void ) ...@@ -283,7 +283,7 @@ IMPL_LINK_TYPED( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void )
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
const OUString sFormatStr = pColl->GetName(); 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!"); OSL_ENSURE(pDlg, "Dialog creation failed!");
if (pDlg->Execute() == RET_OK) if (pDlg->Execute() == RET_OK)
{ {
......
...@@ -1437,7 +1437,7 @@ void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView) ...@@ -1437,7 +1437,7 @@ void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView)
SfxItemSet aDlgAttr(*pPool, EE_ITEMS_START, EE_ITEMS_END); SfxItemSet aDlgAttr(*pPool, EE_ITEMS_START, EE_ITEMS_END);
aDlgAttr.Put(aEditAttr); aDlgAttr.Put(aEditAttr);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 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(); sal_uInt16 nRet = pDlg->Execute();
if (RET_OK == nRet) if (RET_OK == nRet)
{ {
......
...@@ -18,19 +18,15 @@ ...@@ -18,19 +18,15 @@
*/ */
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLG_HXX #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLG_HXX
#define 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/group.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <vcl/combobox.hxx> #include <vcl/combobox.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <chrdlgmodes.hxx>
class SwView; class SwView;
class SvxMacroItem; class SvxMacroItem;
...@@ -38,7 +34,7 @@ class SvxMacroItem; ...@@ -38,7 +34,7 @@ class SvxMacroItem;
class SwCharDlg: public SfxTabDialog class SwCharDlg: public SfxTabDialog
{ {
SwView& m_rView; SwView& m_rView;
sal_uInt8 m_nDialogMode; SwCharDlgMode m_nDialogMode;
sal_uInt16 m_nCharStdId; sal_uInt16 m_nCharStdId;
sal_uInt16 m_nCharExtId; sal_uInt16 m_nCharExtId;
...@@ -50,7 +46,7 @@ class SwCharDlg: public SfxTabDialog ...@@ -50,7 +46,7 @@ class SwCharDlg: public SfxTabDialog
public: public:
SwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, SwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
sal_uInt8 nDialogMode, const OUString* pFormatStr = nullptr); SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr);
virtual ~SwCharDlg(); virtual ~SwCharDlg();
......
...@@ -11,10 +11,9 @@ ...@@ -11,10 +11,9 @@
#define INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLGMODES_HXX #define INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLGMODES_HXX
// DialogModes for SwCharDlg // DialogModes for SwCharDlg
#define DLG_CHAR_STD 0 enum class SwCharDlgMode {
#define DLG_CHAR_DRAW 1 Std, Draw, Env, Ann
#define DLG_CHAR_ENV 2 };
#define DLG_CHAR_ANN 3
#endif // INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLGMODES_HXX #endif // INCLUDED_SW_SOURCE_UIBASE_INC_CHRDLGMODES_HXX
......
...@@ -490,7 +490,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) ...@@ -490,7 +490,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); 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!"); OSL_ENSURE(pDlg, "Dialog creation failed!");
if (nSlot == SID_CHAR_DLG_EFFECT) if (nSlot == SID_CHAR_DLG_EFFECT)
{ {
......
...@@ -345,7 +345,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) ...@@ -345,7 +345,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
assert(pFact && "SwAbstractDialogFactory fail!"); 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!"); assert(pDlg && "Dialog creation failed!");
if (nSlot == SID_CHAR_DLG_EFFECT) if (nSlot == SID_CHAR_DLG_EFFECT)
{ {
......
...@@ -173,7 +173,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const ...@@ -173,7 +173,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); 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!"); OSL_ENSURE(pDlg, "Dialog creation failed!");
if( FN_INSERT_HYPERLINK == nSlot ) if( FN_INSERT_HYPERLINK == nSlot )
pDlg->SetCurPageId("hyperlink"); pDlg->SetCurPageId("hyperlink");
......
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