diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-16 08:49:35 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-16 08:42:37 +0000 |
commit | f0f973da8560e16cba85d2c9465c3a8c4c0ebbb3 (patch) | |
tree | 0b6d78c3b16acc698dee15d83422a924be71097f /vcl/win/app | |
parent | 6eb91bdf75fe0085584efa6abf955c14c7acb9fd (diff) |
loplugin:constantparams in vcl/
also some improvements to the plugin
Change-Id: I0e3a519d70756e577fcb1bd47dd66864b5b4c871
Reviewed-on: https://gerrit.libreoffice.org/23289
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/win/app')
-rw-r--r-- | vcl/win/app/salinfo.cxx | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/vcl/win/app/salinfo.cxx b/vcl/win/app/salinfo.cxx index 2e2e22144a02..ae80798cf6c2 100644 --- a/vcl/win/app/salinfo.cxx +++ b/vcl/win/app/salinfo.cxx @@ -169,36 +169,9 @@ Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : Rectangle(); } -/* We have to map the button identifier to the identifier used by the Win32 - Platform SDK to specify the default button for the MessageBox API. - The first dimension is the button combination, the second dimension - is the button identifier. -*/ -static const int DEFAULT_BTN_MAPPING_TABLE[][8] = +int WinSalSystem::ShowNativeMessageBox(const OUString& rTitle, const OUString& rMessage) { - // Undefined OK CANCEL ABORT RETRY IGNORE YES NO - { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1 }, //OK - { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1 }, //OK_CANCEL - { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_DEFBUTTON1, MB_DEFBUTTON1 }, //ABORT_RETRY_IGNO - { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON3, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON2 }, //YES_NO_CANCEL - { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON2 }, //YES_NO - { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1 } //RETRY_CANCEL -}; - -int WinSalSystem::ShowNativeMessageBox(const OUString& rTitle, const OUString& rMessage, int nButtonCombination, int nDefaultButton, SAL_UNUSED_PARAMETER bool) -{ - DBG_ASSERT( nButtonCombination >= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK && - nButtonCombination <= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL && - nDefaultButton >= SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK && - nDefaultButton <= SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, "Invalid arguments!" ); - - int nFlags = MB_TASKMODAL | MB_SETFOREGROUND | MB_ICONWARNING | nButtonCombination; - - if (nButtonCombination >= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK && - nButtonCombination <= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL && - nDefaultButton >= SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK && - nDefaultButton <= SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO) - nFlags |= DEFAULT_BTN_MAPPING_TABLE[nButtonCombination][nDefaultButton]; + int nFlags = MB_TASKMODAL | MB_SETFOREGROUND | MB_ICONWARNING | MB_DEFBUTTON1; ImplHideSplash(); return MessageBoxW( |