From dcc667ac5ef0d7b4bbdfba0727ef6e2be3ed5313 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 22 Aug 2017 11:11:44 +0200 Subject: convert message box style bits to scoped enum and fix harmless bug in ImpSVGDialog::ImpSVGDialog, which there since commit 6456f1d81090dd5fe44455c09ae3ede7ec6ac38a Date: Fri Feb 4 14:52:54 2011 +0100 ka102: added/removed files for SVG import and module cleanup Change-Id: I66b2ec2b029431ab453e54e962863e4ed7d78962 Reviewed-on: https://gerrit.libreoffice.org/41412 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basic/source/runtime/iosys.cxx | 6 +++--- basic/source/runtime/methods.cxx | 33 ++++++++++++++++----------------- 2 files changed, 19 insertions(+), 20 deletions(-) (limited to 'basic/source') diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index ab9a333ad5a8..73899c44a5cc 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -722,9 +722,9 @@ void SbiIoSystem::Shutdown() { #if defined __GNUC__ vcl::Window* pParent = Application::GetDefDialogParent(); - ScopedVclPtrInstance( pParent, WinBits( WB_OK ), OUString(), aOut )->Execute(); + ScopedVclPtrInstance( pParent, MessBoxStyle::Ok, OUString(), aOut )->Execute(); #else - ScopedVclPtrInstance( Application::GetDefDialogParent(), WinBits( WB_OK ), OUString(), aOut )->Execute(); + ScopedVclPtrInstance( Application::GetDefDialogParent(), MessBoxStyle::Ok, OUString(), aOut )->Execute(); #endif } aOut.clear(); @@ -869,7 +869,7 @@ void SbiIoSystem::WriteCon(const OUString& rText) SolarMutexGuard aSolarGuard; if( !ScopedVclPtrInstance( Application::GetDefDialogParent(), - WinBits( WB_OK_CANCEL | WB_DEF_OK ), + MessBoxStyle::OkCancel | MessBoxStyle::DefaultOk, OUString(), s)->Execute() ) { nError = ERRCODE_BASIC_USER_ABORT; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 62bc21ba8246..26fcf6bb2161 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -4243,14 +4243,14 @@ void SbRtl_SavePicture(StarBASIC *, SbxArray & rPar, bool) void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool) { - static const WinBits nStyleMap[] = - { - WB_OK, // MB_OK - WB_OK_CANCEL, // MB_OKCANCEL - WB_ABORT_RETRY_IGNORE, // MB_ABORTRETRYIGNORE - WB_YES_NO_CANCEL, // MB_YESNOCANCEL - WB_YES_NO, // MB_YESNO - WB_RETRY_CANCEL // MB_RETRYCANCEL + static const MessBoxStyle nStyleMap[] = + { + MessBoxStyle::Ok, // MB_OK + MessBoxStyle::OkCancel, // MB_OKCANCEL + MessBoxStyle::AbortRetryIgnore, // MB_ABORTRETRYIGNORE + MessBoxStyle::YesNoCancel, // MB_YESNOCANCEL + MessBoxStyle::YesNo, // MB_YESNO + MessBoxStyle::RetryCancel // MB_RETRYCANCEL }; static const sal_Int16 nButtonMap[] = { @@ -4268,7 +4268,7 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - WinBits nWinBits; + MessBoxStyle nWinBits; WinBits nType = 0; // MB_OK if( nArgCount >= 3 ) nType = (WinBits)rPar.Get(2)->GetInteger(); @@ -4280,37 +4280,36 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool) } nWinBits = nStyleMap[ nStyle ]; - WinBits nWinDefBits; - nWinDefBits = (WB_DEF_OK | WB_DEF_RETRY | WB_DEF_YES); + MessBoxStyle nWinDefBits = MessBoxStyle::DefaultOk | MessBoxStyle::DefaultRetry | MessBoxStyle::DefaultYes; if( nType & 256 ) { if( nStyle == 5 ) { - nWinDefBits = WB_DEF_CANCEL; + nWinDefBits = MessBoxStyle::DefaultCancel; } else if( nStyle == 2 ) { - nWinDefBits = WB_DEF_RETRY; + nWinDefBits = MessBoxStyle::DefaultRetry; } else { - nWinDefBits = (WB_DEF_CANCEL | WB_DEF_RETRY | WB_DEF_NO); + nWinDefBits = (MessBoxStyle::DefaultCancel | MessBoxStyle::DefaultRetry | MessBoxStyle::DefaultNo); } } else if( nType & 512 ) { if( nStyle == 2) { - nWinDefBits = WB_DEF_IGNORE; + nWinDefBits = MessBoxStyle::DefaultIgnore; } else { - nWinDefBits = WB_DEF_CANCEL; + nWinDefBits = MessBoxStyle::DefaultCancel; } } else if( nStyle == 2) { - nWinDefBits = WB_DEF_CANCEL; + nWinDefBits = MessBoxStyle::DefaultCancel; } nWinBits |= nWinDefBits; -- cgit