diff options
-rw-r--r-- | basctl/source/basicide/baside3.cxx | 6 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 6 | ||||
-rw-r--r-- | cui/source/dialogs/cuifmsearch.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/hldocntp.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/sqlmessage.cxx | 36 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/datasourceconnector.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/relationdesign/RelationTableView.cxx | 2 | ||||
-rw-r--r-- | include/tools/wintypes.hxx | 30 | ||||
-rw-r--r-- | svx/source/dialog/prtqry.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/layctrl.cxx | 2 | ||||
-rw-r--r-- | uui/source/alreadyopen.cxx | 4 | ||||
-rw-r--r-- | uui/source/filechanged.cxx | 2 | ||||
-rw-r--r-- | uui/source/lockfailed.cxx | 4 | ||||
-rw-r--r-- | uui/source/openlocked.cxx | 2 | ||||
-rw-r--r-- | uui/source/trylater.cxx | 2 | ||||
-rw-r--r-- | vcl/generic/app/gensys.cxx | 33 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/morebtn.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/btndlg.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/msgbox.cxx | 28 |
21 files changed, 99 insertions, 96 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 34242c38b3a7..d4f6441a1f5f 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -913,7 +913,7 @@ NameClashQueryBox::NameClashQueryBox( vcl::Window* pParent, AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_RENAME), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_REPLACE), RET_NO, 0 ); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); SetImage( QueryBox::GetStandardImage() ); } @@ -937,8 +937,8 @@ LanguageMismatchQueryBox::LanguageMismatchQueryBox( vcl::Window* pParent, AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_ADD), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_OMIT), RET_NO, 0 ); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); - AddButton( BUTTON_HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 4 ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 4 ); SetImage( QueryBox::GetStandardImage() ); } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index c7367ebd6818..5132ae839911 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -5309,10 +5309,10 @@ MessBox( pWindow, WB_DEF_YES, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_R SetImage( WarningBox::GetStandardImage() ); SetMessText( ReplaceIconName( aMessage ) ); RemoveButton( 1 ); - AddButton( BUTTON_YES, 2, 0 ); + AddButton( StandardButtonType::YES, 2, 0 ); AddButton( CUI_RES( RID_SVXSTR_YESTOALL ), 5, 0 ); - AddButton( BUTTON_NO, 3, 0 ); - AddButton( BUTTON_CANCEL, 4, 0 ); + AddButton( StandardButtonType::NO, 3, 0 ); + AddButton( StandardButtonType::CANCEL, 4, 0 ); } SvxIconReplacementDialog :: SvxIconReplacementDialog( diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index c4d3b3c9089e..673b7de3906f 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -77,7 +77,7 @@ void FmSearchDialog::initCommon( const Reference< XResultSet >& _rxCursor ) FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialText, const ::std::vector< OUString >& _rContexts, sal_Int16 nInitialContext, const Link& lnkContextSupplier) :ModalDialog(pParent, "RecordSearchDialog", "cui/ui/fmsearchdialog.ui") - ,m_sCancel ( Button::GetStandardText( BUTTON_CANCEL ) ) + ,m_sCancel( Button::GetStandardText( StandardButtonType::CANCEL ) ) ,m_pPreSearchFocus( NULL ) ,m_lnkContextSupplier(lnkContextSupplier) ,m_pConfig( NULL ) diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 996cb810c1b8..e981ea402ca1 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -311,7 +311,7 @@ void SvxHyperlinkNewDocTp::DoApply () if( bOk ) { WarningBox aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) ); - bCreate = aWarning.Execute() == BUTTON_YES; + bCreate = aWarning.Execute() == RET_YES; } } diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index f6428a221231..2fcc3bb2f5ea 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -425,12 +425,12 @@ namespace sal_uInt16 nButtonID = 0; switch ( _eType ) { - case BUTTON_YES: nButtonID = RET_YES; break; - case BUTTON_NO: nButtonID = RET_NO; break; - case BUTTON_OK: nButtonID = RET_OK; break; - case BUTTON_CANCEL: nButtonID = RET_CANCEL; break; - case BUTTON_RETRY: nButtonID = RET_RETRY; break; - case BUTTON_HELP: nButtonID = RET_HELP; break; + case StandardButtonType::YES: nButtonID = RET_YES; break; + case StandardButtonType::NO: nButtonID = RET_NO; break; + case StandardButtonType::OK: nButtonID = RET_OK; break; + case StandardButtonType::CANCEL: nButtonID = RET_CANCEL; break; + case StandardButtonType::RETRY: nButtonID = RET_RETRY; break; + case StandardButtonType::HELP: nButtonID = RET_HELP; break; default: OSL_FAIL( "lcl_addButton: invalid button id!" ); break; @@ -564,34 +564,34 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) { if ( _nStyle & WB_YES_NO_CANCEL ) { - lcl_addButton( *this, BUTTON_YES, ( _nStyle & WB_DEF_YES ) != 0 ); - lcl_addButton( *this, BUTTON_NO, ( _nStyle & WB_DEF_NO ) != 0 ); - lcl_addButton( *this, BUTTON_CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 ); + lcl_addButton( *this, StandardButtonType::YES, ( _nStyle & WB_DEF_YES ) != 0 ); + lcl_addButton( *this, StandardButtonType::NO, ( _nStyle & WB_DEF_NO ) != 0 ); + lcl_addButton( *this, StandardButtonType::CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 ); } else if ( _nStyle & WB_OK_CANCEL ) { - lcl_addButton( *this, BUTTON_OK, ( _nStyle & WB_DEF_OK ) != 0 ); - lcl_addButton( *this, BUTTON_CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 ); + lcl_addButton( *this, StandardButtonType::OK, ( _nStyle & WB_DEF_OK ) != 0 ); + lcl_addButton( *this, StandardButtonType::CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 ); } else if ( _nStyle & WB_YES_NO ) { - lcl_addButton( *this, BUTTON_YES, ( _nStyle & WB_DEF_YES ) != 0 ); - lcl_addButton( *this, BUTTON_NO, ( _nStyle & WB_DEF_NO ) != 0 ); + lcl_addButton( *this, StandardButtonType::YES, ( _nStyle & WB_DEF_YES ) != 0 ); + lcl_addButton( *this, StandardButtonType::NO, ( _nStyle & WB_DEF_NO ) != 0 ); } else if ( _nStyle & WB_RETRY_CANCEL ) { - lcl_addButton( *this, BUTTON_RETRY, ( _nStyle & WB_DEF_RETRY ) != 0 ); - lcl_addButton( *this, BUTTON_CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 ); + lcl_addButton( *this, StandardButtonType::RETRY, ( _nStyle & WB_DEF_RETRY ) != 0 ); + lcl_addButton( *this, StandardButtonType::CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 ); } else { OSL_ENSURE( WB_OK & _nStyle, "OSQLMessageBox::impl_createStandardButtons: unsupported dialog style requested!" ); - AddButton( BUTTON_OK, RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON ); + AddButton( StandardButtonType::OK, RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON ); } if ( !m_sHelpURL.isEmpty() ) { - lcl_addButton( *this, BUTTON_HELP, false ); + lcl_addButton( *this, StandardButtonType::HELP, false ); OUString aTmp; INetURLObject aHID( m_sHelpURL ); @@ -628,7 +628,7 @@ void OSQLMessageBox::impl_addDetailsButton() if ( bMoreDetailsAvailable ) { - AddButton( BUTTON_MORE, RET_MORE, 0 ); + AddButton( StandardButtonType::MORE, RET_MORE, 0 ); PushButton* pButton = GetPushButton( RET_MORE ); OSL_ENSURE( pButton, "OSQLMessageBox::impl_addDetailsButton: just added this button, why isn't it there?" ); pButton->SetClickHdl( LINK( this, OSQLMessageBox, ButtonClickHdl ) ); diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index 24eca91203af..bc583fa9b0f1 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -161,7 +161,7 @@ namespace dbaui if ( aWarnings.hasValue() ) { OUString sMessage( ModuleRes( STR_WARNINGS_DURING_CONNECT ) ); - sMessage = sMessage.replaceFirst( "$buttontext$", Button::GetStandardText( BUTTON_MORE ) ); + sMessage = sMessage.replaceFirst( "$buttontext$", Button::GetStandardText( StandardButtonType::MORE ) ); sMessage = OutputDevice::GetNonMnemonicString( sMessage ); SQLWarning aContext; diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index ccee13854046..dd3861ba130e 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -342,7 +342,7 @@ void ORelationTableView::lookForUiActivities() aDlg.RemoveButton(aDlg.GetButtonId(0)); aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON); aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0); - aDlg.AddButton(BUTTON_CANCEL,RET_CANCEL,0); + aDlg.AddButton( StandardButtonType::CANCEL,RET_CANCEL,0); sal_uInt16 nRet = aDlg.Execute(); if( nRet == RET_CANCEL) { diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index 995dcfe8235f..e9282da388a7 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -295,20 +295,22 @@ enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT }; // ButtonDialog-Types -typedef sal_uInt16 StandardButtonType; -#define BUTTON_OK ((StandardButtonType)0) -#define BUTTON_CANCEL ((StandardButtonType)1) -#define BUTTON_YES ((StandardButtonType)2) -#define BUTTON_NO ((StandardButtonType)3) -#define BUTTON_RETRY ((StandardButtonType)4) -#define BUTTON_HELP ((StandardButtonType)5) -#define BUTTON_CLOSE ((StandardButtonType)6) -#define BUTTON_MORE ((StandardButtonType)7) -#define BUTTON_IGNORE ((StandardButtonType)8) -#define BUTTON_ABORT ((StandardButtonType)9) -#define BUTTON_LESS ((StandardButtonType)10) -#define BUTTON_RESET ((StandardButtonType)11) -#define BUTTON_COUNT 12 +enum class StandardButtonType +{ + OK = 0, + CANCEL = 1, + YES = 2, + NO = 3, + RETRY = 4, + HELP = 5, + CLOSE = 6, + MORE = 7, + IGNORE = 8, + ABORT = 9, + LESS = 10, + RESET = 11, + COUNT = 12, +}; // prominent place for ListBox window types diff --git a/svx/source/dialog/prtqry.cxx b/svx/source/dialog/prtqry.cxx index 14a2c9a8d0d5..6d65338ce3ed 100644 --- a/svx/source/dialog/prtqry.cxx +++ b/svx/source/dialog/prtqry.cxx @@ -33,7 +33,7 @@ SvxPrtQryBox::SvxPrtQryBox(vcl::Window* pParent) : BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON); AddButton(SVX_RESSTR(RID_SVXSTR_QRY_PRINT_ALL), 2, 0); - AddButton(BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON); + AddButton(StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON); SetButtonHelpText( RET_OK, OUString() ); } diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index 53ed61eb72e2..3f7cfb924f3e 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -665,7 +665,7 @@ void ColumnsWindow::Paint( const Rectangle& ) if ( nCol ) aText = OUString::number(nCol); else - aText = comphelper::string::remove(Button::GetStandardText(BUTTON_CANCEL), '~'); + aText = comphelper::string::remove(Button::GetStandardText(StandardButtonType::CANCEL), '~'); Size aTextSize(GetTextWidth( aText ), GetTextHeight()); DrawText( Point( ( aSize.Width() - aTextSize.Width() ) / 2, aSize.Height() - nTextHeight + 2 ), aText ); diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx index e53a9b3759ea..d5cf01b0ff02 100644 --- a/uui/source/alreadyopen.cxx +++ b/uui/source/alreadyopen.cxx @@ -32,14 +32,14 @@ AlreadyOpenQueryBox::AlreadyOpenQueryBox( vcl::Window* pParent, ResMgr* pResMgr, AddButton( ResId(STR_ALREADYOPEN_RETRY_SAVE_BTN, *pResMgr).toString(), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); AddButton( ResId(STR_ALREADYOPEN_SAVE_BTN, *pResMgr).toString(), RET_NO, 0 ); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); } else { AddButton( ResId(STR_ALREADYOPEN_READONLY_BTN, *pResMgr).toString(), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); AddButton( ResId(STR_ALREADYOPEN_OPEN_BTN, *pResMgr).toString(), RET_NO, 0 ); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); } SetButtonHelpText( RET_YES, OUString() ); diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx index 0a4bd33c582e..5ab63f708293 100644 --- a/uui/source/filechanged.cxx +++ b/uui/source/filechanged.cxx @@ -29,7 +29,7 @@ FileChangedQueryBox::FileChangedQueryBox( vcl::Window* pParent, ResMgr* pResMgr AddButton(ResId(STR_FILECHANGED_SAVEANYWAY_BTN, *pResMgr).toString(), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); SetButtonHelpText( RET_YES, OUString() ); SetMessText(ResId(STR_FILECHANGED_MSG, *pResMgr).toString()); diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx index 48c4f23a935d..aa75130525eb 100644 --- a/uui/source/lockfailed.cxx +++ b/uui/source/lockfailed.cxx @@ -29,8 +29,8 @@ LockFailedQueryBox::LockFailedQueryBox( vcl::Window* pParent, ResMgr* pResMgr ) { SetImage( ErrorBox::GetStandardImage() ); - AddButton( BUTTON_OK, RET_OK, BUTTONDIALOG_OKBUTTON ); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::OK, RET_OK, BUTTONDIALOG_OKBUTTON ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); SetMessText(ResId(STR_LOCKFAILED_MSG, *pResMgr ).toString()); SetCheckBoxText(ResId(STR_LOCKFAILED_DONTSHOWAGAIN, *pResMgr).toString()); diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx index b4f7ee594f12..a1618bb7ff91 100644 --- a/uui/source/openlocked.cxx +++ b/uui/source/openlocked.cxx @@ -32,7 +32,7 @@ OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, ResMgr* pResMgr, c AddButton(ResId(STR_OPENLOCKED_OPENCOPY_BTN, *pResMgr).toString(), RET_NO, 0); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); SetButtonHelpText( RET_YES, OUString() ); SetButtonHelpText( RET_NO, OUString() ); diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx index 8c1c5705b2d4..1446397e0d19 100644 --- a/uui/source/trylater.cxx +++ b/uui/source/trylater.cxx @@ -30,7 +30,7 @@ TryLaterQueryBox::TryLaterQueryBox( vcl::Window* pParent, ResMgr* pResMgr, const AddButton(ResId(STR_TRYLATER_RETRYSAVING_BTN, *pResMgr).toString(), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON); AddButton(ResId(STR_TRYLATER_SAVEAS_BTN, *pResMgr).toString(), RET_NO, 0); - AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); SetButtonHelpText( RET_YES, OUString() ); SetButtonHelpText( RET_NO, OUString() ); diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx index 9eda402b38dc..ea19ebb04dbb 100644 --- a/vcl/generic/app/gensys.cxx +++ b/vcl/generic/app/gensys.cxx @@ -42,7 +42,7 @@ using namespace com::sun::star; namespace { -OUString GetNativeMessageBoxButtonText( int nButtonId, bool bUseResources ) +OUString GetNativeMessageBoxButtonText( StandardButtonType nButtonId, bool bUseResources ) { OUString aText; if( bUseResources ) @@ -53,27 +53,28 @@ OUString GetNativeMessageBoxButtonText( int nButtonId, bool bUseResources ) { switch( nButtonId ) { - case BUTTON_OK: + case StandardButtonType::OK: aText = "OK"; break; - case BUTTON_CANCEL: + case StandardButtonType::CANCEL: aText = "Cancel"; break; - case BUTTON_ABORT: + case StandardButtonType::ABORT: aText = "Abort"; break; - case BUTTON_RETRY: + case StandardButtonType::RETRY: aText = "Retry"; break; - case BUTTON_IGNORE: + case StandardButtonType::IGNORE: aText = "Ignore"; break; - case BUTTON_YES: + case StandardButtonType::YES: aText = "Yes"; break; - case BUTTON_NO: + case StandardButtonType::NO: aText = "No"; break; + default: break; } } return aText; @@ -102,15 +103,15 @@ int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUStri if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK || nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL ) { - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_OK, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::OK, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; } if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL || nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO ) { - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_YES, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::YES, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_NO, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::NO, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO ) nDefButton = 1; @@ -121,21 +122,21 @@ int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUStri { if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL ) { - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::RETRY, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; } - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_CANCEL, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::CANCEL, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL ) nDefButton = aButtons.size()-1; } if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE ) { - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_ABORT, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::ABORT, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::RETRY, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; - aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_IGNORE, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::IGNORE, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; switch( nDefaultButton ) { diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 83a248a8605d..e6a1d34ffbbd 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -115,7 +115,7 @@ OUString Button::GetStandardText( StandardButtonType eButton ) { sal_uInt32 nResId; const char* pDefText; - } aResIdAry[BUTTON_COUNT] = + } aResIdAry[static_cast<int>(StandardButtonType::COUNT)] = { { SV_BUTTONTEXT_OK, "~OK" }, { SV_BUTTONTEXT_CANCEL, "~Cancel" }, @@ -1653,7 +1653,7 @@ void OKButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) { PushButton::ImplInit( pParent, nStyle ); - SetText( Button::GetStandardText( BUTTON_OK ) ); + SetText( Button::GetStandardText( StandardButtonType::OK ) ); } OKButton::OKButton( vcl::Window* pParent, WinBits nStyle ) : @@ -1698,7 +1698,7 @@ void CancelButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) { PushButton::ImplInit( pParent, nStyle ); - SetText( Button::GetStandardText( BUTTON_CANCEL ) ); + SetText( Button::GetStandardText( StandardButtonType::CANCEL ) ); } CancelButton::CancelButton( vcl::Window* pParent, WinBits nStyle ) : @@ -1742,14 +1742,14 @@ void CancelButton::Click() CloseButton::CloseButton( vcl::Window* pParent, WinBits nStyle ) : CancelButton(pParent, nStyle) { - SetText( Button::GetStandardText( BUTTON_CLOSE ) ); + SetText( Button::GetStandardText( StandardButtonType::CLOSE ) ); } void HelpButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) { PushButton::ImplInit( pParent, nStyle | WB_NOPOINTERFOCUS ); - SetText( Button::GetStandardText( BUTTON_HELP ) ); + SetText( Button::GetStandardText( StandardButtonType::HELP ) ); } HelpButton::HelpButton( vcl::Window* pParent, WinBits nStyle ) : diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index 0b585a1587a8..8e5e9a6a99be 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -42,8 +42,8 @@ void MoreButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) PushButton::ImplInit( pParent, nStyle ); - mpMBData->maMoreText = Button::GetStandardText( BUTTON_MORE ); - mpMBData->maLessText = Button::GetStandardText( BUTTON_LESS ); + mpMBData->maMoreText = Button::GetStandardText( StandardButtonType::MORE ); + mpMBData->maLessText = Button::GetStandardText( StandardButtonType::LESS ); ShowState(); diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index 94862da3826d..b211dcf5e6a0 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -296,18 +296,18 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId, pItem->mbOwnButton = true; pItem->mnSepSize = nSepPixel; - if ( eType == BUTTON_OK ) + if ( eType == StandardButtonType::OK ) nBtnFlags |= BUTTONDIALOG_OKBUTTON; - else if ( eType == BUTTON_HELP ) + else if ( eType == StandardButtonType::HELP ) nBtnFlags |= BUTTONDIALOG_HELPBUTTON; - else if ( (eType == BUTTON_CANCEL) || (eType == BUTTON_CLOSE) ) + else if ( (eType == StandardButtonType::CANCEL) || (eType == StandardButtonType::CLOSE) ) nBtnFlags |= BUTTONDIALOG_CANCELBUTTON; pItem->mpPushButton = ImplCreatePushButton( nBtnFlags ); // Standard-Buttons have the right text already - if ( !((eType == BUTTON_OK) && (pItem->mpPushButton->GetType() == WINDOW_OKBUTTON)) || - !((eType == BUTTON_CANCEL) && (pItem->mpPushButton->GetType() == WINDOW_CANCELBUTTON)) || - !((eType == BUTTON_HELP) && (pItem->mpPushButton->GetType() == WINDOW_HELPBUTTON)) ) + if ( !((eType == StandardButtonType::OK) && (pItem->mpPushButton->GetType() == WINDOW_OKBUTTON)) || + !((eType == StandardButtonType::CANCEL) && (pItem->mpPushButton->GetType() == WINDOW_CANCELBUTTON)) || + !((eType == StandardButtonType::HELP) && (pItem->mpPushButton->GetType() == WINDOW_HELPBUTTON)) ) { pItem->mpPushButton->SetText( Button::GetStandardText( eType ) ); } diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 5495e7c048e8..8548eafd5059 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2171,14 +2171,14 @@ short MessageDialog::Execute() break; case VCL_BUTTONS_YES_NO: pBtn = new PushButton(pButtonBox); - pBtn->SetText(Button::GetStandardText(BUTTON_YES)); + pBtn->SetText(Button::GetStandardText(StandardButtonType::YES)); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_YES; pBtn = new PushButton(pButtonBox); pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON); - pBtn->SetText(Button::GetStandardText(BUTTON_NO)); + pBtn->SetText(Button::GetStandardText(StandardButtonType::NO)); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_NO; diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 035d97f7e968..3fdb64787bc4 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -75,8 +75,8 @@ void MessBox::ImplInitButtons() else // WB_DEF_OK nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; - AddButton( BUTTON_OK, RET_OK, nOKFlags ); - AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags ); + AddButton( StandardButtonType::OK, RET_OK, nOKFlags ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, nCancelFlags ); } else if ( nStyle & WB_YES_NO ) { @@ -86,8 +86,8 @@ void MessBox::ImplInitButtons() nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; nNoFlags |= BUTTONDIALOG_CANCELBUTTON; - AddButton( BUTTON_YES, RET_YES, nYesFlags ); - AddButton( BUTTON_NO, RET_NO, nNoFlags ); + AddButton( StandardButtonType::YES, RET_YES, nYesFlags ); + AddButton( StandardButtonType::NO, RET_NO, nNoFlags ); } else if ( nStyle & WB_YES_NO_CANCEL ) { @@ -98,9 +98,9 @@ void MessBox::ImplInitButtons() else nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; - AddButton( BUTTON_YES, RET_YES, nYesFlags ); - AddButton( BUTTON_NO, RET_NO, nNoFlags ); - AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags ); + AddButton( StandardButtonType::YES, RET_YES, nYesFlags ); + AddButton( StandardButtonType::NO, RET_NO, nNoFlags ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, nCancelFlags ); } else if ( nStyle & WB_RETRY_CANCEL ) { @@ -109,8 +109,8 @@ void MessBox::ImplInitButtons() else // WB_DEF_RETRY nRetryFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; - AddButton( BUTTON_RETRY, RET_RETRY, nRetryFlags ); - AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags ); + AddButton( StandardButtonType::RETRY, RET_RETRY, nRetryFlags ); + AddButton( StandardButtonType::CANCEL, RET_CANCEL, nCancelFlags ); } else if ( nStyle & WB_ABORT_RETRY_IGNORE ) { @@ -124,15 +124,15 @@ void MessBox::ImplInitButtons() else if ( nStyle & WB_DEF_IGNORE ) nIgnoreFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; - AddButton( BUTTON_ABORT, RET_CANCEL, nAbortFlags ); - AddButton( BUTTON_RETRY, RET_RETRY, nRetryFlags ); - AddButton( BUTTON_IGNORE, RET_IGNORE, nIgnoreFlags ); + AddButton( StandardButtonType::ABORT, RET_CANCEL, nAbortFlags ); + AddButton( StandardButtonType::RETRY, RET_RETRY, nRetryFlags ); + AddButton( StandardButtonType::IGNORE, RET_IGNORE, nIgnoreFlags ); } else if ( nStyle & WB_OK ) { nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; - AddButton( BUTTON_OK, RET_OK, nOKFlags ); + AddButton( StandardButtonType::OK, RET_OK, nOKFlags ); } } @@ -162,7 +162,7 @@ void MessBox::ImplPosControls() { if ( !mbHelpBtn ) { - AddButton( BUTTON_HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 3 ); + AddButton( StandardButtonType::HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 3 ); mbHelpBtn = true; } } |