diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-27 09:04:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-27 09:04:44 +0200 |
commit | f2d556ca02827d0d77d06388bfe1a40739f4d1f8 (patch) | |
tree | 4c0ab405b27e11c65c9856651a1de048492cda45 | |
parent | 3dc9f684b3994bd125b9f27049581aa35b1e52bc (diff) |
work around Windows and OSX macro collisions with enum values
Change-Id: I3d14b96b6b51e497bde33f0177b377e7fe3dbad9
-rw-r--r-- | cui/source/customize/cfg.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/sqlmessage.cxx | 6 | ||||
-rw-r--r-- | include/tools/wintypes.hxx | 4 | ||||
-rw-r--r-- | vcl/generic/app/gensys.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/msgbox.cxx | 6 |
6 files changed, 14 insertions, 14 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 5132ae839911..5771f5700907 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -5309,7 +5309,7 @@ MessBox( pWindow, WB_DEF_YES, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_R SetImage( WarningBox::GetStandardImage() ); SetMessText( ReplaceIconName( aMessage ) ); RemoveButton( 1 ); - AddButton( StandardButtonType::YES, 2, 0 ); + AddButton( StandardButtonType::SB_YES, 2, 0 ); AddButton( CUI_RES( RID_SVXSTR_YESTOALL ), 5, 0 ); AddButton( StandardButtonType::NO, 3, 0 ); AddButton( StandardButtonType::CANCEL, 4, 0 ); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 2fcc3bb2f5ea..b47fd5f74962 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -425,7 +425,7 @@ namespace sal_uInt16 nButtonID = 0; switch ( _eType ) { - case StandardButtonType::YES: nButtonID = RET_YES; break; + case StandardButtonType::SB_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; @@ -564,7 +564,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) { if ( _nStyle & WB_YES_NO_CANCEL ) { - lcl_addButton( *this, StandardButtonType::YES, ( _nStyle & WB_DEF_YES ) != 0 ); + lcl_addButton( *this, StandardButtonType::SB_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 ); } @@ -575,7 +575,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) } else if ( _nStyle & WB_YES_NO ) { - lcl_addButton( *this, StandardButtonType::YES, ( _nStyle & WB_DEF_YES ) != 0 ); + lcl_addButton( *this, StandardButtonType::SB_YES, ( _nStyle & WB_DEF_YES ) != 0 ); lcl_addButton( *this, StandardButtonType::NO, ( _nStyle & WB_DEF_NO ) != 0 ); } else if ( _nStyle & WB_RETRY_CANCEL ) diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index 6abb4b6d8dc4..e04248316396 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -299,13 +299,13 @@ enum class StandardButtonType { OK = 0, CANCEL = 1, - YES = 2, + SB_YES = 2, // overlaps with YES constant on MacOS NO = 3, RETRY = 4, HELP = 5, CLOSE = 6, MORE = 7, - IGNORE = 8, + SB_IGNORE = 8, // overlaps with IGNORE constant on Windows ABORT = 9, LESS = 10, RESET = 11, diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx index ea19ebb04dbb..5d1f395920cd 100644 --- a/vcl/generic/app/gensys.cxx +++ b/vcl/generic/app/gensys.cxx @@ -65,10 +65,10 @@ OUString GetNativeMessageBoxButtonText( StandardButtonType nButtonId, bool bUseR case StandardButtonType::RETRY: aText = "Retry"; break; - case StandardButtonType::IGNORE: + case StandardButtonType::SB_IGNORE: aText = "Ignore"; break; - case StandardButtonType::YES: + case StandardButtonType::SB_YES: aText = "Yes"; break; case StandardButtonType::NO: @@ -109,7 +109,7 @@ int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUStri if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL || nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO ) { - aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::YES, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::SB_YES, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::NO, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; @@ -136,7 +136,7 @@ int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUStri nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::RETRY, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; - aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::IGNORE, bUseResources ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::SB_IGNORE, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; switch( nDefaultButton ) { diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 8548eafd5059..a89e176ce492 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2171,7 +2171,7 @@ short MessageDialog::Execute() break; case VCL_BUTTONS_YES_NO: pBtn = new PushButton(pButtonBox); - pBtn->SetText(Button::GetStandardText(StandardButtonType::YES)); + pBtn->SetText(Button::GetStandardText(StandardButtonType::SB_YES)); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_YES; diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 3fdb64787bc4..deb19d763b02 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -86,7 +86,7 @@ void MessBox::ImplInitButtons() nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; nNoFlags |= BUTTONDIALOG_CANCELBUTTON; - AddButton( StandardButtonType::YES, RET_YES, nYesFlags ); + AddButton( StandardButtonType::SB_YES, RET_YES, nYesFlags ); AddButton( StandardButtonType::NO, RET_NO, nNoFlags ); } else if ( nStyle & WB_YES_NO_CANCEL ) @@ -98,7 +98,7 @@ void MessBox::ImplInitButtons() else nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; - AddButton( StandardButtonType::YES, RET_YES, nYesFlags ); + AddButton( StandardButtonType::SB_YES, RET_YES, nYesFlags ); AddButton( StandardButtonType::NO, RET_NO, nNoFlags ); AddButton( StandardButtonType::CANCEL, RET_CANCEL, nCancelFlags ); } @@ -126,7 +126,7 @@ void MessBox::ImplInitButtons() AddButton( StandardButtonType::ABORT, RET_CANCEL, nAbortFlags ); AddButton( StandardButtonType::RETRY, RET_RETRY, nRetryFlags ); - AddButton( StandardButtonType::IGNORE, RET_IGNORE, nIgnoreFlags ); + AddButton( StandardButtonType::SB_IGNORE, RET_IGNORE, nIgnoreFlags ); } else if ( nStyle & WB_OK ) { |