summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-11 11:11:40 +0200
committerNoel Grandin <noel@peralex.com>2016-05-11 11:12:30 +0200
commit08234bab5e3287724344cd127ea88090561d9fc0 (patch)
tree5941786567e0da48741f5a75557d0a29a89e525f /cui
parent307ab87fecb702b3aa72525ce4556b9c49fa5515 (diff)
Convert MESS_BTN to scoped enum
Change-Id: I9332216f58268b20b3b8e9488471279d70c519ad
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/dlgname.cxx9
-rw-r--r--cui/source/inc/defdlgname.hxx4
-rw-r--r--cui/source/inc/dlgname.hxx6
-rw-r--r--cui/source/tabpages/tpbitmap.cxx4
-rw-r--r--cui/source/tabpages/tpcolor.cxx4
-rw-r--r--cui/source/tabpages/tpgradnt.cxx4
-rw-r--r--cui/source/tabpages/tphatch.cxx4
-rw-r--r--cui/source/tabpages/tplnedef.cxx4
8 files changed, 18 insertions, 21 deletions
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 3ff72b728f6a..6772f445f3ea 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -202,20 +202,17 @@ IMPL_LINK_NOARG_TYPED(SvxMessDialog, Button2Hdl, Button*, void)
/*************************************************************************/
-void SvxMessDialog::SetButtonText( sal_uInt16 nBtnId, const OUString& rNewTxt )
+void SvxMessDialog::SetButtonText( SvxMessDialogButton nBtnId, const OUString& rNewTxt )
{
switch ( nBtnId )
{
- case MESS_BTN_1:
+ case SvxMessDialogButton::N1:
pBtn1->SetText( rNewTxt );
break;
- case MESS_BTN_2:
+ case SvxMessDialogButton::N2:
pBtn2->SetText( rNewTxt );
break;
-
- default:
- OSL_FAIL( "Invalid button number!!!" );
}
}
diff --git a/cui/source/inc/defdlgname.hxx b/cui/source/inc/defdlgname.hxx
index 432ba460d830..08aa4249754b 100644
--- a/cui/source/inc/defdlgname.hxx
+++ b/cui/source/inc/defdlgname.hxx
@@ -19,10 +19,6 @@
#ifndef INCLUDED_CUI_SOURCE_INC_DEFDLGNAME_HXX
#define INCLUDED_CUI_SOURCE_INC_DEFDLGNAME_HXX
-// define ----------------------------------------------------------------
-
-#define MESS_BTN_1 ((sal_uInt16)0)
-#define MESS_BTN_2 ((sal_uInt16)1)
// const -----------------------------------------------------------------
diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx
index 3576b29ce9e7..ac183a88e7fc 100644
--- a/cui/source/inc/dlgname.hxx
+++ b/cui/source/inc/dlgname.hxx
@@ -124,6 +124,10 @@ public:
void GetDescription(OUString& rDescription) {rDescription = pEdtDescription->GetText(); }
};
+enum class SvxMessDialogButton {
+ N1, N2
+};
+
/// Dialog to cancel, save, or add
class SvxMessDialog : public ModalDialog
{
@@ -142,7 +146,7 @@ public:
virtual ~SvxMessDialog();
virtual void dispose() override;
- void SetButtonText( sal_uInt16 nBtnId, const OUString& rNewTxt );
+ void SetButtonText( SvxMessDialogButton nBtnId, const OUString& rNewTxt );
};
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 0733247fc1af..163c0cf3e66b 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -440,8 +440,8 @@ long SvxBitmapTabPage::CheckChanges_Impl()
CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ),
&aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
- aMessDlg->SetButtonText( MESS_BTN_1, ResId( RID_SVXSTR_CHANGE, rMgr ) );
- aMessDlg->SetButtonText( MESS_BTN_2, ResId( RID_SVXSTR_ADD, rMgr ) );
+ aMessDlg->SetButtonText( SvxMessDialogButton::N1, ResId( RID_SVXSTR_CHANGE, rMgr ) );
+ aMessDlg->SetButtonText( SvxMessDialogButton::N2, ResId( RID_SVXSTR_ADD, rMgr ) );
short nRet = aMessDlg->Execute();
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 033dbf109d85..a84a182d2a19 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -540,9 +540,9 @@ long SvxColorTabPage::CheckChanges_Impl()
SVX_RESSTR( RID_SVXSTR_COLOR ),
ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ),
&aWarningBoxImage );
- aMessDlg->SetButtonText( MESS_BTN_1,
+ aMessDlg->SetButtonText( SvxMessDialogButton::N1,
ResId( RID_SVXSTR_CHANGE, rMgr ) );
- aMessDlg->SetButtonText( MESS_BTN_2,
+ aMessDlg->SetButtonText( SvxMessDialogButton::N2,
ResId( RID_SVXSTR_ADD, rMgr ) );
short nRet = aMessDlg->Execute();
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index b7fee0d412ed..e23564012423 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -292,9 +292,9 @@ long SvxGradientTabPage::CheckChanges_Impl()
CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ),
&aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
- aMessDlg->SetButtonText( MESS_BTN_1,
+ aMessDlg->SetButtonText( SvxMessDialogButton::N1,
OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2,
+ aMessDlg->SetButtonText( SvxMessDialogButton::N2,
OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) );
short nRet = aMessDlg->Execute();
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 6700093b6400..766ac7a5102c 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -262,9 +262,9 @@ long SvxHatchTabPage::CheckChanges_Impl()
CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ),
&aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
- aMessDlg->SetButtonText( MESS_BTN_1,
+ aMessDlg->SetButtonText( SvxMessDialogButton::N1,
OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2,
+ aMessDlg->SetButtonText( SvxMessDialogButton::N2,
OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) );
short nRet = aMessDlg->Execute();
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 46198f999830..daa5b3e0ff74 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -246,8 +246,8 @@ void SvxLineDefTabPage::CheckChanges_Impl()
OUString( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ),
&aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
- aMessDlg->SetButtonText( MESS_BTN_1, OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2, OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) );
+ aMessDlg->SetButtonText( SvxMessDialogButton::N1, OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
+ aMessDlg->SetButtonText( SvxMessDialogButton::N2, OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) );
short nRet = aMessDlg->Execute();