diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-22 11:11:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-23 08:47:52 +0200 |
commit | dcc667ac5ef0d7b4bbdfba0727ef6e2be3ed5313 (patch) | |
tree | 78e04f13656eddd5a528506dda41f96fce6aad7f | |
parent | e725111f8283f4dbefde7b14efbe9afd850095df (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
107 files changed, 354 insertions, 307 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index ef902a174294..5500db055e5f 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -479,7 +479,7 @@ bool EditorWindow::ImpCanModify() { // If in Trace-mode, abort the trace or refuse input // Remove markers in the modules in Notify at Basic::Stopped - if (ScopedVclPtrInstance<QueryBox>(nullptr, WB_OK_CANCEL, IDEResId(RID_STR_WILLSTOPPRG))->Execute() == RET_OK) + if (ScopedVclPtrInstance<QueryBox>(nullptr, MessBoxStyle::OkCancel, IDEResId(RID_STR_WILLSTOPPRG))->Execute() == RET_OK) { rModulWindow.GetBasicStatus().bIsRunning = false; StopBasic(); diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 29b47d78739b..6100d83d2baf 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -787,7 +787,7 @@ public: NameClashQueryBox::NameClashQueryBox( vcl::Window* pParent, const OUString& rTitle, const OUString& rMessage ) - : MessBox( pParent, 0, rTitle, rMessage ) + : MessBox( pParent, MessBoxStyle::NONE, rTitle, rMessage ) { if ( !rTitle.isEmpty() ) SetText( rTitle ); @@ -812,7 +812,7 @@ public: LanguageMismatchQueryBox::LanguageMismatchQueryBox( vcl::Window* pParent, const OUString& rTitle, const OUString& rMessage ) - : MessBox( pParent, 0, rTitle, rMessage ) + : MessBox( pParent, MessBoxStyle::NONE, rTitle, rMessage ) { if ( !rTitle.isEmpty() ) SetText( rTitle ); diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 5fb85ec7dde4..a3f12d31c054 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -100,7 +100,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq ) nActModWindows++; } - if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && ScopedVclPtrInstance<QueryBox>(pCurWin, WB_YES_NO|WB_DEF_YES, IDEResId(RID_STR_SEARCHALLMODULES))->Execute() == RET_YES ) ) + if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && ScopedVclPtrInstance<QueryBox>(pCurWin, MessBoxStyle::YesNo|MessBoxStyle::DefaultYes, IDEResId(RID_STR_SEARCHALLMODULES))->Execute() == RET_YES ) ) { for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it) { @@ -139,7 +139,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq ) SfxViewFrame* pViewFrame = GetViewFrame(); SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SEARCH_DLG ) : nullptr; vcl::Window* pParent = pChildWin ? pChildWin->GetWindow() : nullptr; - ScopedVclPtrInstance< QueryBox > aQuery(pParent, WB_YES_NO|WB_DEF_YES, IDEResId(RID_STR_SEARCHFROMSTART)); + ScopedVclPtrInstance< QueryBox > aQuery(pParent, MessBoxStyle::YesNo|MessBoxStyle::DefaultYes, IDEResId(RID_STR_SEARCHFROMSTART)); if ( aQuery->Execute() == RET_YES ) { it = aWindowTable.begin(); 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<MessBox>( pParent, WinBits( WB_OK ), OUString(), aOut )->Execute(); + ScopedVclPtrInstance<MessBox>( pParent, MessBoxStyle::Ok, OUString(), aOut )->Execute(); #else - ScopedVclPtrInstance<MessBox>( Application::GetDefDialogParent(), WinBits( WB_OK ), OUString(), aOut )->Execute(); + ScopedVclPtrInstance<MessBox>( Application::GetDefDialogParent(), MessBoxStyle::Ok, OUString(), aOut )->Execute(); #endif } aOut.clear(); @@ -869,7 +869,7 @@ void SbiIoSystem::WriteCon(const OUString& rText) SolarMutexGuard aSolarGuard; if( !ScopedVclPtrInstance<MessBox>( 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; diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index b9ef8f7c6129..04f9218cebc0 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -131,7 +131,7 @@ void SeriesHeaderEdit::MouseButtonDown( const MouseEvent& rMEvt ) Edit::MouseButtonDown( rMEvt ); if( m_bShowWarningBox ) - ScopedVclPtrInstance<WarningBox>(this, WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox>(this, MessBoxStyle::Ok, SchResId(STR_INVALID_NUMBER))->Execute(); } @@ -752,13 +752,13 @@ void DataBrowser::MouseButtonDown( const BrowserMouseEvent& rEvt ) void DataBrowser::ShowWarningBox() { - ScopedVclPtrInstance<WarningBox>(this, WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox>(this, MessBoxStyle::Ok, SchResId(STR_INVALID_NUMBER))->Execute(); } bool DataBrowser::ShowQueryBox() { - ScopedVclPtrInstance<QueryBox> pQueryBox(this, WB_YES_NO, SchResId(STR_DATA_EDITOR_INCORRECT_INPUT)); + ScopedVclPtrInstance<QueryBox> pQueryBox(this, MessBoxStyle::YesNo, SchResId(STR_DATA_EDITOR_INCORRECT_INPUT)); return pQueryBox->Execute() == RET_YES; } diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index caaf1d7eb19b..6f72cfaf3f4d 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -614,7 +614,7 @@ bool ScaleTabPage::ShowWarning(const char* pResIdMessage, Control* pControl /* = if (pResIdMessage == nullptr) return false; - ScopedVclPtrInstance<WarningBox>(this, WinBits( WB_OK ), SchResId(pResIdMessage))->Execute(); + ScopedVclPtrInstance<WarningBox>(this, MessBoxStyle::Ok, SchResId(pResIdMessage))->Execute(); if( pControl ) { pControl->GrabFocus(); diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index ec4b2866fe86..71fd43c1391d 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -303,7 +303,7 @@ short SvxMenuConfigPage::QueryReset() OUString label = SvxConfigPageHelper::replaceSaveInName( msg, saveInName ); - ScopedVclPtrInstance<QueryBox> qbox( this, WB_YES_NO, label ); + ScopedVclPtrInstance<QueryBox> qbox( this, MessBoxStyle::YesNo, label ); return qbox->Execute(); } diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index 5df50650cd57..90995f40ae3e 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -707,7 +707,7 @@ short SvxToolbarConfigPage::QueryReset() OUString label = SvxConfigPageHelper::replaceSaveInName( msg, saveInName ); - ScopedVclPtrInstance< QueryBox > qbox( this, WB_YES_NO, label ); + ScopedVclPtrInstance< QueryBox > qbox( this, MessBoxStyle::YesNo, label ); return qbox->Execute(); } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 287867626123..98b9444d8b10 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -3181,7 +3181,7 @@ IMPL_LINK_NOARG( SvxIconSelectorDialog, ImportHdl, Button *, void) IMPL_LINK_NOARG( SvxIconSelectorDialog, DeleteHdl, Button *, void ) { OUString message = CuiResId( RID_SVXSTR_DELETE_ICON_CONFIRM ); - if (ScopedVclPtrInstance<WarningBox>(this, WinBits(WB_OK_CANCEL), message)->Execute() == RET_OK) + if (ScopedVclPtrInstance<WarningBox>(this, MessBoxStyle::OkCancel, message)->Execute() == RET_OK) { ToolBox::ImplToolItems::size_type nCount = pTbSymbol->GetItemCount(); @@ -3467,7 +3467,7 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) SvxIconReplacementDialog::SvxIconReplacementDialog( vcl::Window *pWindow, const OUString& aMessage, bool /*bYestoAll*/ ) : -MessBox( pWindow, WB_DEF_YES, CuiResId( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CuiResId( RID_SVXSTR_REPLACE_ICON_WARNING ) ) +MessBox( pWindow, MessBoxStyle::DefaultYes, CuiResId( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CuiResId( RID_SVXSTR_REPLACE_ICON_WARNING ) ) { SetImage( WarningBox::GetStandardImage() ); @@ -3481,7 +3481,7 @@ MessBox( pWindow, WB_DEF_YES, CuiResId( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CuiR SvxIconReplacementDialog::SvxIconReplacementDialog( vcl::Window *pWindow, const OUString& aMessage ) - : MessBox( pWindow, WB_YES_NO_CANCEL, CuiResId( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CuiResId( RID_SVXSTR_REPLACE_ICON_WARNING ) ) + : MessBox( pWindow, MessBoxStyle::YesNoCancel, CuiResId( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CuiResId( RID_SVXSTR_REPLACE_ICON_WARNING ) ) { SetImage( WarningBox::GetStandardImage() ); SetMessText( ReplaceIconName( aMessage )); diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index b2710554399b..64239c21d1bd 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -276,7 +276,7 @@ bool SvxHyperlinkNewDocTp::AskApply() bool bRet = ImplGetURLObject( m_pCbbPath->GetText(), m_pCbbPath->GetBaseURL(), aINetURLObject ); if ( !bRet ) { - ScopedVclPtrInstance< WarningBox > aWarning( this, WB_OK, CuiResId(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ); + ScopedVclPtrInstance< WarningBox > aWarning( this, MessBoxStyle::Ok, CuiResId(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ); aWarning->Execute(); } return bRet; @@ -324,7 +324,7 @@ void SvxHyperlinkNewDocTp::DoApply () if( bOk ) { - ScopedVclPtrInstance<WarningBox> aWarning( this, WB_YES_NO, CuiResId(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) ); + ScopedVclPtrInstance<WarningBox> aWarning( this, MessBoxStyle::YesNo, CuiResId(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) ); bCreate = aWarning->Execute() == RET_YES; } } diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 94f41590b643..062585193e89 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -422,7 +422,7 @@ IMPL_LINK_NOARG( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void ) if( !xLink.is() ) return; - ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, aStrCloselinkmsg ); + ScopedVclPtrInstance< QueryBox > aBox( this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aStrCloselinkmsg ); if( RET_YES == aBox->Execute() ) { @@ -453,7 +453,7 @@ IMPL_LINK_NOARG( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void ) } else { - ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, aStrCloselinkmsgMulti ); + ScopedVclPtrInstance< QueryBox > aBox( this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aStrCloselinkmsgMulti ); if( RET_YES == aBox->Execute() ) { diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 434462ca04a7..25d705ab30c3 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -647,7 +647,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl, Button*, void) } else { - ScopedVclPtrInstance< QueryBox > aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr ); + ScopedVclPtrInstance< QueryBox > aQuery( this, MessBoxStyle::YesNo|MessBoxStyle::DefaultNo, m_sPasswordStoringDeactivateStr ); sal_uInt16 nRet = aQuery->Execute(); if( RET_YES == nRet ) diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 32d5d88e1f46..25237bbc7d07 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -705,7 +705,7 @@ void SearchAndParseThread::execute() sError = CuiResId(RID_SVXSTR_SEARCHERROR); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError); aBox->Execute(); return; } @@ -717,7 +717,7 @@ void SearchAndParseThread::execute() sError = CuiResId(RID_SVXSTR_SEARCHERROR); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError ); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError ); aBox->Execute(); return; } @@ -757,7 +757,7 @@ void SearchAndParseThread::execute() sError = CuiResId(RID_SVXSTR_SEARCHERROR); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError); aBox->Execute(); return; } @@ -840,7 +840,7 @@ void SearchAndParseThread::execute() sError = CuiResId( RID_SVXSTR_SEARCHERROR ); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError); aBox->Execute(); return; } diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index b464bb387df7..4cc33b7178f4 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -1364,7 +1364,7 @@ DeactivateRC SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet ) if ( ePaper != PAPER_SCREEN_4_3 && ePaper != PAPER_SCREEN_16_9 && ePaper != PAPER_SCREEN_16_10 && IsMarginOutOfRange() ) { - if (ScopedVclPtrInstance<QueryBox>(this, WB_YES_NO | WB_DEF_NO, m_pPrintRangeQueryText->GetText())->Execute() == RET_NO) + if (ScopedVclPtrInstance<QueryBox>(this, MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, m_pPrintRangeQueryText->GetText())->Execute() == RET_NO) { MetricField* pField = nullptr; if ( IsPrinterRangeOverflow( *m_pLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) ) diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 78ee969ccdd1..376edc7f7c44 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -176,7 +176,7 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click, Button*, void) { if ( xNameContainer->hasByName(sName) ) { - ScopedVclPtrInstance< QueryBox > aBox(this, WB_YES_NO, DBA_RES(STR_ALREADYEXISTOVERWRITE)); + ScopedVclPtrInstance< QueryBox > aBox(this, MessBoxStyle::YesNo, DBA_RES(STR_ALREADYEXISTOVERWRITE)); if ( aBox->Execute() != RET_YES ) return; } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 90df7695b5c2..c35461411c0b 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -472,7 +472,7 @@ namespace dbaui sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = false; - ScopedVclPtrInstance< QueryBox > aQuery(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery); + ScopedVclPtrInstance< QueryBox > aQuery(GetParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, sQuery); sal_Int32 nQueryResult = aQuery->Execute(); m_bUserGrabFocus = true; @@ -489,7 +489,7 @@ namespace dbaui sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = false; - ScopedVclPtrInstance< QueryBox > aWhatToDo(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery); + ScopedVclPtrInstance< QueryBox > aWhatToDo(GetParent(), MessBoxStyle::RetryCancel | MessBoxStyle::DefaultRetry, sQuery); nQueryResult = aWhatToDo->Execute(); m_bUserGrabFocus = true; diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 65f2d0663ae7..0667a8102729 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -308,7 +308,7 @@ namespace dbaui const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, DBA_RES(pMessage), OUString(), WB_OK | WB_DEF_OK, mt ); + ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt ); aMsg->Execute(); } bool OConnectionTabPage::checkTestConnection() diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index fb31b1b0dc27..302139afd27a 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -557,7 +557,7 @@ using namespace ::com::sun::star; #endif const char *pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - ScopedVclPtrInstance<OSQLMessageBox> aMsg(this, DBA_RES(pMessage), OUString(), WB_OK | WB_DEF_OK, mt); + ScopedVclPtrInstance<OSQLMessageBox> aMsg(this, DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt); aMsg->Execute(); } diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index d5850a03961b..ec2fcda8b3df 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -263,7 +263,7 @@ namespace dbaui eImage = OSQLMessageBox::Error; aMessage = DBA_RES(STR_CONNECTION_NO_SUCCESS); } - ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, sTitle, aMessage, WB_OK, eImage ); + ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, sTitle, aMessage, MessBoxStyle::Ok, eImage ); aMsg->Execute(); } if ( !bSuccess ) diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 40c1b1f515c9..8a8a6adf8846 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -543,7 +543,7 @@ namespace dbaui #endif const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - ScopedVclPtrInstance<OSQLMessageBox> aMsg(this, DBA_RES(pMessage), OUString(), WB_OK | WB_DEF_OK, mt); + ScopedVclPtrInstance<OSQLMessageBox> aMsg(this, DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt); aMsg->Execute(); } void OGeneralSpecialJDBCDetailsPage::callModifiedHdl(void* pControl) diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index bef59f71af24..600a15cf2f7e 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -523,32 +523,32 @@ void OSQLMessageBox::impl_positionControls() SetPageSizePixel( aDialogSize ); } -void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) +void OSQLMessageBox::impl_createStandardButtons( MessBoxStyle _nStyle ) { - if ( _nStyle & WB_YES_NO_CANCEL ) + if ( _nStyle & MessBoxStyle::YesNoCancel ) { - 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 ); + lcl_addButton( *this, StandardButtonType::Yes, bool(_nStyle & MessBoxStyle::DefaultYes) ); + lcl_addButton( *this, StandardButtonType::No, bool( _nStyle & MessBoxStyle::DefaultNo ) ); + lcl_addButton( *this, StandardButtonType::Cancel, bool( _nStyle & MessBoxStyle::DefaultCancel ) ); } - else if ( _nStyle & WB_OK_CANCEL ) + else if ( _nStyle & MessBoxStyle::OkCancel ) { - lcl_addButton( *this, StandardButtonType::OK, ( _nStyle & WB_DEF_OK ) != 0 ); - lcl_addButton( *this, StandardButtonType::Cancel, ( _nStyle & WB_DEF_CANCEL ) != 0 ); + lcl_addButton( *this, StandardButtonType::OK, bool( _nStyle & MessBoxStyle::DefaultOk ) ); + lcl_addButton( *this, StandardButtonType::Cancel, bool( _nStyle & MessBoxStyle::DefaultCancel ) ); } - else if ( _nStyle & WB_YES_NO ) + else if ( _nStyle & MessBoxStyle::YesNo ) { - lcl_addButton( *this, StandardButtonType::Yes, ( _nStyle & WB_DEF_YES ) != 0 ); - lcl_addButton( *this, StandardButtonType::No, ( _nStyle & WB_DEF_NO ) != 0 ); + lcl_addButton( *this, StandardButtonType::Yes, bool( _nStyle & MessBoxStyle::DefaultYes ) ); + lcl_addButton( *this, StandardButtonType::No, bool( _nStyle & MessBoxStyle::DefaultNo ) ); } - else if ( _nStyle & WB_RETRY_CANCEL ) + else if ( _nStyle & MessBoxStyle::RetryCancel ) { - lcl_addButton( *this, StandardButtonType::Retry, ( _nStyle & WB_DEF_RETRY ) != 0 ); - lcl_addButton( *this, StandardButtonType::Cancel, ( _nStyle & WB_DEF_CANCEL ) != 0 ); + lcl_addButton( *this, StandardButtonType::Retry, bool( _nStyle & MessBoxStyle::DefaultRetry ) ); + lcl_addButton( *this, StandardButtonType::Cancel, bool( _nStyle & MessBoxStyle::DefaultCancel ) ); } else { - OSL_ENSURE( WB_OK & _nStyle, "OSQLMessageBox::impl_createStandardButtons: unsupported dialog style requested!" ); + OSL_ENSURE( MessBoxStyle::Ok & _nStyle, "OSQLMessageBox::impl_createStandardButtons: unsupported dialog style requested!" ); AddButton( StandardButtonType::OK, RET_OK, ButtonDialogFlags::Default | ButtonDialogFlags::Focus ); } @@ -598,7 +598,7 @@ void OSQLMessageBox::impl_addDetailsButton() } } -void OSQLMessageBox::Construct( WinBits _nStyle, MessageType _eImage ) +void OSQLMessageBox::Construct( MessBoxStyle _nStyle, MessageType _eImage ) { SetText( utl::ConfigManager::getProductName() + " Base" ); @@ -641,7 +641,7 @@ void OSQLMessageBox::Construct( WinBits _nStyle, MessageType _eImage ) impl_addDetailsButton(); } -OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _rException, WinBits _nStyle, const OUString& _rHelpURL ) +OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _rException, MessBoxStyle _nStyle, const OUString& _rHelpURL ) :ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG ) ,m_aInfoImage( VclPtr<FixedImage>::Create(this) ) ,m_aTitle( VclPtr<FixedText>::Create(this, WB_WORDBREAK | WB_LEFT) ) @@ -652,7 +652,7 @@ OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _r Construct( _nStyle, AUTO ); } -OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle, const OUString& _rMessage, WinBits _nStyle, MessageType _eType, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo ) +OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle, const OUString& _rMessage, MessBoxStyle _nStyle, MessageType _eType, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo ) :ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG ) ,m_aInfoImage( VclPtr<FixedImage>::Create(this) ) ,m_aTitle( VclPtr<FixedText>::Create(this, WB_WORDBREAK | WB_LEFT) ) @@ -689,7 +689,7 @@ IMPL_LINK_NOARG( OSQLMessageBox, ButtonClickHdl, Button *, void ) } // OSQLWarningBox -OSQLWarningBox::OSQLWarningBox( vcl::Window* _pParent, const OUString& _rMessage, WinBits _nStyle, +OSQLWarningBox::OSQLWarningBox( vcl::Window* _pParent, const OUString& _rMessage, MessBoxStyle _nStyle, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo ) :OSQLMessageBox( _pParent, DBA_RES( STR_EXCEPTION_WARNING ), _rMessage, _nStyle, OSQLMessageBox::Warning, _pAdditionalErrorInfo ) { @@ -697,7 +697,7 @@ OSQLWarningBox::OSQLWarningBox( vcl::Window* _pParent, const OUString& _rMessage // OSQLErrorBox OSQLErrorBox::OSQLErrorBox( vcl::Window* _pParent, const OUString& _rMessage ) - :OSQLMessageBox( _pParent, DBA_RES( STR_EXCEPTION_ERROR ), _rMessage, WB_OK | WB_DEF_OK, OSQLMessageBox::Error, nullptr ) + :OSQLMessageBox( _pParent, DBA_RES( STR_EXCEPTION_ERROR ), _rMessage, MessBoxStyle::Ok | MessBoxStyle::DefaultOk, OSQLMessageBox::Error, nullptr ) { } diff --git a/dbaccess/source/ui/inc/sqlmessage.hxx b/dbaccess/source/ui/inc/sqlmessage.hxx index cff7777bcde4..e070185f76f3 100644 --- a/dbaccess/source/ui/inc/sqlmessage.hxx +++ b/dbaccess/source/ui/inc/sqlmessage.hxx @@ -23,6 +23,7 @@ #include <vcl/button.hxx> #include <vcl/fixed.hxx> #include <vcl/btndlg.hxx> +#include <vcl/msgbox.hxx> #include <connectivity/dbexception.hxx> @@ -72,7 +73,7 @@ public: OSQLMessageBox( vcl::Window* _pParent, const dbtools::SQLExceptionInfo& _rException, - WinBits _nStyle = WB_OK | WB_DEF_OK, + MessBoxStyle _nStyle = MessBoxStyle::Ok | MessBoxStyle::DefaultOk, const OUString& _rHelpURL = OUString() ); @@ -85,7 +86,7 @@ public: OSQLMessageBox(vcl::Window* pParent, const OUString& rTitle, const OUString& rMessage, - WinBits nStyle = WB_OK | WB_DEF_OK, + MessBoxStyle nStyle = MessBoxStyle::Ok | MessBoxStyle::DefaultOk, MessageType _eType = Info, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = nullptr ); @@ -93,13 +94,13 @@ public: virtual void dispose() override; private: - void Construct( WinBits nStyle, MessageType eImage ); + void Construct( MessBoxStyle nStyle, MessageType eImage ); DECL_LINK(ButtonClickHdl, Button*, void ); private: void impl_positionControls(); - void impl_createStandardButtons( WinBits _nStyle ); + void impl_createStandardButtons( MessBoxStyle _nStyle ); void impl_addDetailsButton(); }; @@ -109,7 +110,7 @@ class OSQLWarningBox : public OSQLMessageBox public: OSQLWarningBox( vcl::Window* _pParent, const OUString& _rMessage, - WinBits _nStyle = WB_OK | WB_DEF_OK, + MessBoxStyle _nStyle = MessBoxStyle::Ok | MessBoxStyle::DefaultOk, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = nullptr ); }; diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index e9b9ad17ffc4..57b8fcb63305 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -748,7 +748,7 @@ void ODatabaseExport::showErrorDialog(const css::sdbc::SQLException& e) OUString aMsg = e.Message + "\n" + DBA_RES( STR_QRY_CONTINUE ); - ScopedVclPtrInstance< OSQLWarningBox > aBox( nullptr, aMsg, WB_YES_NO | WB_DEF_NO ); + ScopedVclPtrInstance< OSQLWarningBox > aBox( nullptr, aMsg, MessBoxStyle::YesNo | MessBoxStyle::DefaultNo ); if (aBox->Execute() == RET_YES) m_bDontAskAgain = true; diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 94f6b2182b35..4a02455f8e35 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -239,7 +239,7 @@ bool ORowSetImportExport::insertNewRow() if(!m_bAlreadyAsked) { OUString sAskIfContinue = DBA_RES(STR_ERROR_OCCURRED_WHILE_COPYING); - ScopedVclPtrInstance< OSQLWarningBox > aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ); + ScopedVclPtrInstance< OSQLWarningBox > aDlg( m_pParent, sAskIfContinue, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes ); if(aDlg->Execute() == RET_YES) m_bAlreadyAsked = true; else diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index f914f3a54263..0970babdf37b 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1211,7 +1211,7 @@ sal_Int32 askForUserAction(vcl::Window* _pParent, const char* pTitle, const char SolarMutexGuard aGuard; OUString aMsg = DBA_RES(pText); aMsg = aMsg.replaceFirst("%1", _sName); - ScopedVclPtrInstance<OSQLMessageBox> aAsk(_pParent, DBA_RES(pTitle), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query); + ScopedVclPtrInstance<OSQLMessageBox> aAsk(_pParent, DBA_RES(pTitle), aMsg,MessBoxStyle::YesNo | MessBoxStyle::DefaultYes,OSQLMessageBox::Query); if ( _bAll ) { aAsk->AddButton(DBA_RES(STR_BUTTON_TEXT_ALL), RET_ALL); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 03d997895519..3a56c45f912a 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -941,7 +941,7 @@ void OQueryController::impl_initialize() OUString aTitle(DBA_RES(STR_QUERYDESIGN_NO_VIEW_SUPPORT)); OUString aMessage(DBA_RES(STR_QUERYDESIGN_NO_VIEW_ASK)); ODataView* pWindow = getView(); - ScopedVclPtrInstance< OSQLMessageBox > aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query ); + ScopedVclPtrInstance< OSQLMessageBox > aDlg( pWindow, aTitle, aMessage, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, OSQLMessageBox::Query ); bClose = aDlg->Execute() == RET_NO; } if ( bClose ) @@ -1738,7 +1738,7 @@ short OQueryController::saveModified() ) { OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) ); - ScopedVclPtrInstance< QueryBox > aQry( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ); + ScopedVclPtrInstance< QueryBox > aQry( getView(), MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes, sMessageText ); nRet = aQry->Execute(); if ( ( nRet == RET_YES ) diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index e43e9ceec013..96b985465b7c 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -323,7 +323,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) { - ScopedVclPtrInstance< OSQLWarningBox > aDlg( this, DBA_RES( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ); + ScopedVclPtrInstance< OSQLWarningBox > aDlg( this, DBA_RES( STR_QUERY_REL_DELETE_WINDOW ), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes ); if ( m_bInRemove || aDlg->Execute() == RET_YES ) { m_pView->getController().ClearUndoManager(); @@ -341,7 +341,7 @@ void ORelationTableView::lookForUiActivities() { OUString sTitle(DBA_RES(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,DBA_RES(STR_QUERY_REL_EDIT_RELATION),OUString(),0); + ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,DBA_RES(STR_QUERY_REL_EDIT_RELATION),OUString(),MessBoxStyle::NONE); aDlg->SetText(sTitle); aDlg->RemoveButton(aDlg->GetButtonId(0)); aDlg->AddButton( DBA_RES(STR_QUERY_REL_EDIT), RET_OK, ButtonDialogFlags::Default | ButtonDialogFlags::Focus); diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 618a342568fa..bfb16297c65c 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -403,7 +403,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) { OUString sText( DBA_RES( STR_NAME_ALREADY_EXISTS ) ); sText = sText.replaceFirst( "#" , m_sName); - ScopedVclPtrInstance< OSQLMessageBox > aDlg( getView(), DBA_RES( STR_ERROR_DURING_CREATION ), sText, WB_OK, OSQLMessageBox::Error ); + ScopedVclPtrInstance< OSQLMessageBox > aDlg( getView(), DBA_RES( STR_ERROR_DURING_CREATION ), sText, MessBoxStyle::Ok, OSQLMessageBox::Error ); aDlg->Execute(); bError = true; @@ -933,7 +933,7 @@ bool OTableController::checkColumns(bool _bNew) { OUString sTitle(DBA_RES(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); OUString sMsg(DBA_RES(STR_TABLEDESIGN_NO_PRIM_KEY)); - ScopedVclPtrInstance< OSQLMessageBox > aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES); + ScopedVclPtrInstance< OSQLMessageBox > aBox(getView(), sTitle,sMsg, MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes); switch ( aBox->Execute() ) { @@ -1065,7 +1065,7 @@ void OTableController::alterColumns() aMessage = aMessage.replaceFirst( "$column$", pField->GetName() ); SQLExceptionInfo aError( ::cppu::getCaughtException() ); - ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ); + ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes , &aError ); bNotOk = aMsg->Execute() == RET_YES; } else @@ -1122,7 +1122,7 @@ void OTableController::alterColumns() { OUString aMessage(DBA_RES(STR_TABLEDESIGN_ALTER_ERROR)); aMessage = aMessage.replaceFirst("$column$",pField->GetName()); - ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES, &aError); + ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, &aError); if ( aMsg->Execute() != RET_YES ) { Reference<XPropertySet> xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW); @@ -1189,7 +1189,7 @@ void OTableController::alterColumns() OUString aMsgT(DBA_RES(STR_TBL_COLUMN_IS_KEYCOLUMN)); aMsgT = aMsgT.replaceFirst("$column$",*pIter); OUString aTitle(DBA_RES(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE)); - ScopedVclPtrInstance< OSQLMessageBox > aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES); + ScopedVclPtrInstance< OSQLMessageBox > aMsg(getView(),aTitle,aMsgT,MessBoxStyle::YesNo| MessBoxStyle::DefaultYes); if(aMsg->Execute() == RET_YES) { xKeyColumns = nullptr; diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index 119a729f699b..00e9a1ea6adb 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -162,22 +162,22 @@ namespace dbaui sal_Int32 nRetryPos = getContinuation(RETRY, _rContinuations); // determine the style of the dialog, dependent on the present continuation types - WinBits nDialogStyle = 0; + MessBoxStyle nDialogStyle = MessBoxStyle::NONE; bool bHaveCancel = nAbortPos != -1; // "approve" means "Yes", "disapprove" means "No" // VCL only supports having both (which makes sense ...) if ( ( nApprovePos != -1 ) || ( nDisapprovePos != -1 ) ) - nDialogStyle = ( bHaveCancel ? WB_YES_NO_CANCEL : WB_YES_NO ) | WB_DEF_YES; + nDialogStyle = ( bHaveCancel ? MessBoxStyle::YesNoCancel : MessBoxStyle::YesNo ) | MessBoxStyle::DefaultYes; else { // if there's no yes/no, then use a default OK button - nDialogStyle = ( bHaveCancel ? WB_OK_CANCEL : WB_OK ) | WB_DEF_OK; + nDialogStyle = ( bHaveCancel ? MessBoxStyle::OkCancel : MessBoxStyle::Ok ) | MessBoxStyle::DefaultOk; } // If there's a "Retry" continuation, have a "Retry" button if ( nRetryPos != -1 ) { - nDialogStyle = WB_RETRY_CANCEL | WB_DEF_RETRY; + nDialogStyle = MessBoxStyle::RetryCancel | MessBoxStyle::DefaultRetry; } // execute the dialog diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index 222fd7bf05dd..b5948ca79a9f 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -146,7 +146,7 @@ Reference<XPropertySetInfo> SAL_CALL OSQLMessageDialog::getPropertySetInfo() VclPtr<Dialog> OSQLMessageDialog::createDialog(vcl::Window* _pParent) { if ( m_aException.hasValue() ) - return VclPtr<OSQLMessageBox>::Create( _pParent, SQLExceptionInfo( m_aException ), WB_OK | WB_DEF_OK, m_sHelpURL ); + return VclPtr<OSQLMessageBox>::Create( _pParent, SQLExceptionInfo( m_aException ), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, m_sHelpURL ); OSL_FAIL("OSQLMessageDialog::createDialog : You should use the SQLException property to specify the error to display!"); return VclPtr<OSQLMessageBox>::Create(_pParent, SQLException()); diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index d1e8bf0f7167..774e30fae122 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -453,7 +453,7 @@ Reference<XComponentContext> getUNO( if ( ! InitVCL() ) throw RuntimeException( "Cannot initialize VCL!" ); { - ScopedVclPtrInstance< WarningBox > warn(nullptr, WB_OK | WB_DEF_OK, sMsg); + ScopedVclPtrInstance< WarningBox > warn(nullptr, MessBoxStyle::Ok | MessBoxStyle::DefaultOk, sMsg); warn->SetText(utl::ConfigManager::getProductName()); warn->SetIcon(0); warn->Execute(); diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx index 1a9d478afb99..c614c990ab2b 100644 --- a/extensions/source/bibliography/bibview.cxx +++ b/extensions/source/bibliography/bibview.cxx @@ -138,7 +138,7 @@ namespace bib { sErrorString += "\n"; sErrorString += BibResId(RID_MAP_QUESTION); - ScopedVclPtrInstance< QueryBox > aQuery(this, WB_YES_NO, sErrorString); + ScopedVclPtrInstance< QueryBox > aQuery(this, MessBoxStyle::YesNo, sErrorString); aQuery->SetDefaultCheckBoxText(); short nResult = aQuery->Execute(); BibModul::GetConfig()->SetShowColumnAssignmentWarning( diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index b79323790cc3..6c9e10a2f47c 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -525,7 +525,7 @@ namespace pcr // confirmation message OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ) ); sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() ); - ScopedVclPtrInstance<QueryBox> aQuery( nullptr, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent + ScopedVclPtrInstance<QueryBox> aQuery( nullptr, MessBoxStyle::YesNo, sConfirmation ); // TODO/eForms: proper parent if ( aQuery->Execute() != RET_YES ) return false; diff --git a/filter/source/svg/impsvgdialog.cxx b/filter/source/svg/impsvgdialog.cxx index 4acb378c4926..bc39bd4b5101 100644 --- a/filter/source/svg/impsvgdialog.cxx +++ b/filter/source/svg/impsvgdialog.cxx @@ -38,7 +38,7 @@ ImpSVGDialog::ImpSVGDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFi maCBTinyProfile( VclPtr<CheckBox>::Create(this) ), maCBEmbedFonts( VclPtr<CheckBox>::Create(this) ), maCBUseNativeDecoration( VclPtr<CheckBox>::Create(this) ), - maBTOK( VclPtr<OKButton>::Create(this, WB_DEF_OK) ), + maBTOK( VclPtr<OKButton>::Create(this, 0) ), maBTCancel( VclPtr<CancelButton>::Create(this) ), maBTHelp( VclPtr<HelpButton>::Create(this) ), maConfigItem( SVG_EXPORTFILTER_CONFIGPATH, &rFilterData ), diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 7f913ad6f9fd..b8efe9dc4bb4 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -775,7 +775,7 @@ void XMLFilterSettingsDialog::onDelete() OUString aMessage(XsltResId(STR_WARN_DELETE)); aMessage = aMessage.replaceFirst( "%s", pInfo->maFilterName ); - ScopedVclPtrInstance< WarningBox > aWarnBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES), aMessage ); + ScopedVclPtrInstance< WarningBox > aWarnBox(this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMessage ); if( aWarnBox->Execute() == RET_YES ) { try diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index e5f9df54af20..4952c7be2b07 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -434,7 +434,7 @@ namespace frm if(needConfirmation) { // TODO: shouldn't this be done with an interaction handler? - ScopedVclPtrInstance< QueryBox > aQuery( nullptr, WB_YES_NO_CANCEL | WB_DEF_YES, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) ); + ScopedVclPtrInstance< QueryBox > aQuery( nullptr, MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) ); switch ( aQuery->Execute() ) { case RET_NO: diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index b265d616fe1e..ae1558256933 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -4143,7 +4143,7 @@ void AutoRecovery::impl_showFullDiscError() sBackupPath = sBackupURL; ScopedVclPtrInstance<ErrorBox> dlgError( - nullptr, WB_OK, + nullptr, MessBoxStyle::Ok, sMsg.replaceAll("%PATH", sBackupPath)); dlgError->SetButtonText(dlgError->GetButtonId(0), sBtn); dlgError->Execute(); diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index f4b2c9256874..15075f698449 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -220,20 +220,6 @@ WinBits const WB_DOCKBORDER = 0x00001000; // Window-Bits for SplitWindow WinBits const WB_NOSPLITDRAW = 0x01000000; -// Window-Bits for MessageBoxen -WinBits const WB_OK = 0x00100000; -WinBits const WB_OK_CANCEL = 0x00200000; -WinBits const WB_YES_NO = 0x00400000; -WinBits const WB_YES_NO_CANCEL = 0x00800000; -WinBits const WB_RETRY_CANCEL = 0x01000000; -WinBits const WB_DEF_OK = 0x02000000; -WinBits const WB_DEF_CANCEL = 0x04000000; -WinBits const WB_DEF_RETRY = 0x08000000; -WinBits const WB_DEF_YES = SAL_CONST_INT64(0x10000000); -WinBits const WB_DEF_NO = SAL_CONST_INT64(0x20000000); -WinBits const WB_ABORT_RETRY_IGNORE = SAL_CONST_INT64(0x1000000000); -WinBits const WB_DEF_IGNORE = SAL_CONST_INT64(0x2000000000); - // Standard-WinBits WinBits const WB_STDWORK = WB_SIZEMOVE | WB_CLOSEABLE; WinBits const WB_STDDOCKWIN = WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE; diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx index 305e36c381ce..a0bfccec2919 100644 --- a/include/vcl/msgbox.hxx +++ b/include/vcl/msgbox.hxx @@ -24,11 +24,33 @@ #include <vcl/btndlg.hxx> #include <vcl/image.hxx> #include <vcl/bitmap.hxx> +#include <o3tl/typed_flags_set.hxx> class VclMultiLineEdit; class FixedImage; class CheckBox; +// Window-Bits for MessageBoxen +enum class MessBoxStyle { + NONE = 0x0000, + Ok = 0x0001, + OkCancel = 0x0002, + YesNo = 0x0004, + YesNoCancel = 0x0008, + RetryCancel = 0x0010, + DefaultOk = 0x0020, + DefaultCancel = 0x0040, + DefaultRetry = 0x0080, + DefaultYes = 0x0100, + DefaultNo = 0x0200, + AbortRetryIgnore = 0x1000, + DefaultIgnore = 0x2000, +}; +namespace o3tl { + template<> struct typed_flags<MessBoxStyle> : is_typed_flags<MessBoxStyle, 0x3fff> {}; +} + + class VCL_DLLPUBLIC MessBox : public ButtonDialog { VclPtr<VclMultiLineEdit> mpVCLMultiLineEdit; @@ -36,6 +58,7 @@ class VCL_DLLPUBLIC MessBox : public ButtonDialog Image maImage; bool mbHelpBtn; bool mbCheck; + MessBoxStyle mnMessBoxStyle; protected: OUString maMessText; @@ -46,7 +69,9 @@ protected: SAL_DLLPRIVATE void ImplPosControls(); public: - MessBox( vcl::Window* pParent, WinBits nStyle, + MessBox( vcl::Window* pParent, MessBoxStyle nMessBoxStyle, + const OUString& rTitle, const OUString& rMessage ); + MessBox( vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits n, const OUString& rTitle, const OUString& rMessage ); virtual ~MessBox() override; virtual void dispose() override; @@ -63,13 +88,16 @@ public: bool GetCheckBoxState() const; virtual Size GetOptimalSize() const override; + + void SetMessBoxStyle(MessBoxStyle n) { mnMessBoxStyle = n; } + MessBoxStyle GetMessBoxStyle() { return mnMessBoxStyle; } }; class VCL_DLLPUBLIC InfoBox : public MessBox { public: InfoBox( vcl::Window* pParent, const OUString& rMessage ); - InfoBox( vcl::Window* pParent, WinBits nStyle, + InfoBox( vcl::Window* pParent, MessBoxStyle nStyle, const OUString& rMessage ); static Image GetStandardImage(); @@ -79,7 +107,9 @@ public: class VCL_DLLPUBLIC WarningBox : public MessBox { public: - WarningBox( vcl::Window* pParent, WinBits nStyle, + WarningBox( vcl::Window* pParent, MessBoxStyle nStyle, + const OUString& rMessage ); + WarningBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits n, const OUString& rMessage ); void SetDefaultCheckBoxText(); @@ -92,7 +122,9 @@ class VCL_DLLPUBLIC ErrorBox : public MessBox { public: ErrorBox( vcl::Window* pParent, const OUString& rMessage ); - ErrorBox( vcl::Window* pParent, WinBits nStyle, + ErrorBox( vcl::Window* pParent, MessBoxStyle nStyle, + const OUString& rMessage ); + ErrorBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits n, const OUString& rMessage ); static Image GetStandardImage(); @@ -102,7 +134,9 @@ public: class VCL_DLLPUBLIC QueryBox : public MessBox { public: - QueryBox( vcl::Window* pParent, WinBits nStyle, + QueryBox( vcl::Window* pParent, MessBoxStyle nStyle, + const OUString& rMessage ); + QueryBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits n, const OUString& rMessage ); void SetDefaultCheckBoxText(); diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 4f7b4ea41e08..7fb950e50650 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -154,8 +154,7 @@ bool PowerPointImport::importDocument() aWarning += SvxResId(RID_SVXSTR_WARN_MISSING_SMARTART); // Show it. - WinBits eBits = WB_OK | WB_DEF_OK; - ScopedVclPtrInstance<WarningBox> pBox(nullptr, eBits, aWarning); + ScopedVclPtrInstance<WarningBox> pBox(nullptr, MessBoxStyle::Ok | MessBoxStyle::DefaultOk, aWarning); pBox->Execute(); } diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 8099960fd048..4c4383405e63 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -390,17 +390,17 @@ bool ScValidationData::DoError( vcl::Window* pParent, const OUString& rInput, //TODO: ErrorBox / WarningBox / InfoBox ? //TODO: (with InfoBox always OK-Button only) - WinBits nStyle = 0; + MessBoxStyle nStyle = MessBoxStyle::NONE; switch (eErrorStyle) { case SC_VALERR_STOP: - nStyle = WB_OK | WB_DEF_OK; + nStyle = MessBoxStyle::Ok | MessBoxStyle::DefaultOk; break; case SC_VALERR_WARNING: - nStyle = WB_OK_CANCEL | WB_DEF_CANCEL; + nStyle = MessBoxStyle::OkCancel | MessBoxStyle::DefaultCancel; break; case SC_VALERR_INFO: - nStyle = WB_OK_CANCEL | WB_DEF_OK; + nStyle = MessBoxStyle::OkCancel | MessBoxStyle::DefaultOk; break; default: { diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 72d2985e536f..67a500e72322 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -533,7 +533,7 @@ void WorkbookFragment::recalcFormulaCells() { // Ask the user if full re-calculation is desired. ScopedVclPtrInstance<QueryBox> aBox( - ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScDocShell::GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS)); aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index f6e9ebc4eb9d..b318a1e19802 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -256,7 +256,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl, Button*, void ) if(bWarn) { //show warning message and don't close - ScopedVclPtrInstance< WarningBox > aWarn(this, WB_OK, maStrWarnSameValue ); + ScopedVclPtrInstance< WarningBox > aWarn(this, MessBoxStyle::Ok, maStrWarnSameValue ); aWarn->Execute(); } else diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index 65b66db6e89f..463d672b56f0 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -523,7 +523,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl, Button*, void) aBuf.append(aStrDelMsg.getToken(0, '#')); aBuf.append(aStrEntry); aBuf.append(aStrDelMsg.getToken(1, '#')); - ScopedVclPtrInstance< QueryBox > aBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear()); + ScopedVclPtrInstance< QueryBox > aBox(this, MessBoxStyle::YesNo|MessBoxStyle::DefaultYes, aBuf.makeStringAndClear()); if (RET_YES == aBox->Execute()) { diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 72dbe61b9e57..11c53f1c8278 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -994,11 +994,11 @@ void ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam, if (rParam.bReplace) if (rDoc.TestRemoveSubTotals( nTab, rParam )) { - bOk = ( ScopedVclPtrInstance<MessBox>( ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - // "StarCalc" "Delete Data?" - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) )->Execute() - == RET_YES ); + bOk = ScopedVclPtrInstance<MessBox>( ScDocShell::GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, + // "StarCalc" "Delete Data?" + ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), + ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) )->Execute() + == RET_YES; } if (bOk) @@ -1282,7 +1282,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb // OutRange of pOldObj (pDestObj) is still old area if (!lcl_EmptyExcept(&rDoc, aNewOut, pOldObj->GetOutRange())) { - ScopedVclPtrInstance<QueryBox> aBox( ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScopedVclPtrInstance<QueryBox> aBox( ScDocShell::GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ); if (aBox->Execute() == RET_NO) { @@ -1334,7 +1334,7 @@ bool ScDBDocFunc::RemovePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) if (pModel && !aListOfObjects.empty()) { ScopedVclPtrInstance<QueryBox> aBox( - ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScDocShell::GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_PIVOT_REMOVE_PIVOTCHART)); if (aBox->Execute() == RET_NO) { @@ -1478,7 +1478,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool if (!bEmpty) { ScopedVclPtrInstance<QueryBox> aBox( - ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScDocShell::GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY)); if (aBox->Execute() == RET_NO) @@ -1551,7 +1551,7 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) { if (!lcl_EmptyExcept(&rDoc, aNewOut, rDPObj.GetOutRange())) { - ScopedVclPtrInstance<QueryBox> aBox( ScDocShell::GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScopedVclPtrInstance<QueryBox> aBox( ScDocShell::GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ); if (aBox->Execute() == RET_NO) { diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 5c3d77d248f5..c9e19236a699 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5064,7 +5064,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList, aMessage += aTemplate.getToken( 1, '#' ); short nResult = ScopedVclPtrInstance<QueryBox>( ScDocShell::GetActiveDialogParent(), - WinBits(WB_YES_NO_CANCEL | WB_DEF_YES), + MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes, aMessage )->Execute(); if ( nResult == RET_YES ) { diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index f51db7d69225..2e26e5d2386e 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -472,7 +472,7 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css // Generator is not LibreOffice. Ask if the user wants to perform // full re-calculation. ScopedVclPtrInstance<QueryBox> aBox( - GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS)); aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); @@ -706,7 +706,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScAppOptions aAppOptions = SC_MOD()->GetAppOptions(); if ( aAppOptions.GetShowSharedDocumentWarning() ) { - ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::Ok, ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) ); aBox->SetDefaultCheckBoxText(); aBox->Execute(); @@ -833,7 +833,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) ); aMessage = aMessage.replaceFirst( "%1", aUserName ); - ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage ); + ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), MessBoxStyle::RetryCancel | MessBoxStyle::DefaultRetry, aMessage ); if ( aBox->Execute() == RET_RETRY ) { bRetry = true; @@ -908,7 +908,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else { - ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::Ok, ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ); aBox->Execute(); @@ -949,7 +949,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if ( GetDocument().GetExternalRefManager()->containsUnsavedReferences() ) { - ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO ), + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::YesNo, ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) ); if( RET_NO == aBox->Execute()) diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 99165cea57cf..1254223c29a3 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -1204,7 +1204,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) ScopedVclPtrInstance< ScConflictsDlg > aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList ); if ( aDlg->Execute() == RET_CANCEL ) { - ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), + ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) ); if ( aBox->Execute() == RET_YES ) { diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 009f8b987436..341cd921a87f 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -220,7 +220,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) aMessage += sTarget; aMessage += aTemplate.getToken( 1, '#' ); - ScopedVclPtrInstance< QueryBox > aBox( nullptr, WinBits(WB_YES_NO | WB_DEF_YES), aMessage ); + ScopedVclPtrInstance< QueryBox > aBox( nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMessage ); bDo = ( aBox->Execute() == RET_YES ); } @@ -439,7 +439,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if(nSet==LM_ON_DEMAND) { - ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_RELOAD_TABLES) ); nDlgRet=aBox->Execute(); @@ -490,7 +490,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) OSL_ENSURE(pViewSh,"SID_REIMPORT_AFTER_LOAD: no View"); if (pViewSh && pDBColl) { - ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) ); if (aBox->Execute() == RET_YES) { @@ -583,7 +583,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) { // no dialog on playing the macro ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), - WinBits(WB_YES_NO | WB_DEF_NO), + MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, ScGlobal::GetRscString( STR_END_REDLINING ) ); bDo = ( aBox->Execute() == RET_YES ); } @@ -648,7 +648,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if ( nSlot == SID_DOCUMENT_COMPARE ) { //! old changes trace will be lost ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), - WinBits(WB_YES_NO | WB_DEF_NO), + MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, ScGlobal::GetRscString( STR_END_REDLINING ) ); if( aBox->Execute() == RET_YES ) bDo = ExecuteChangeProtectionDialog( true ); @@ -940,7 +940,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) { ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), - WinBits( WB_YES_NO | WB_DEF_YES ), + MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) ); if ( aBox->Execute() == RET_NO ) { @@ -1029,14 +1029,14 @@ void ScDocShell::Execute( SfxRequest& rReq ) OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) ); aMessage = aMessage.replaceFirst( "%1", aUserName ); - ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage ); + ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), MessBoxStyle::Ok, aMessage ); aBox->Execute(); } else { ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), - WinBits( WB_YES_NO | WB_DEF_YES ), + MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) ); if ( aBox->Execute() == RET_YES ) { @@ -1070,7 +1070,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) else { xCloseable->close( true ); - ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::Ok, ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ); aBox->Execute(); } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 8277b26c80c2..cc2018961f66 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -3186,7 +3186,7 @@ void ScExternalRefManager::Notify( SfxBroadcaster&, const SfxHint& rHint ) { case SfxEventHintId::PrepareCloseDoc: { - ScopedVclPtrInstance<WarningBox> aBox( ScDocShell::GetActiveDialogParent(), WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox> aBox( ScDocShell::GetActiveDialogParent(), MessBoxStyle::Ok, ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) ); aBox->Execute(); } diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index f68c9a06ccad..f2779fc15ea5 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -27,7 +27,7 @@ #include <memory> #define ERRORBOX(s) ScopedVclPtrInstance<MessageDialog>(this, s)->Execute() -#define QUERYBOX(m) ScopedVclPtrInstance<QueryBox>(this,WinBits(WB_YES_NO|WB_DEF_YES),m)->Execute() +#define QUERYBOX(m) ScopedVclPtrInstance<QueryBox>(this, MessBoxStyle::YesNo|MessBoxStyle::DefaultYes, m)->Execute() const sal_uLong nEntryDataCol = 0; const sal_uLong nEntryDataRow = 1; diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index da465ae23774..b59fc2647153 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -286,7 +286,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl, Button*, void) + aStrDelMsg.getToken( 1, '#' ); if ( RET_YES == - ScopedVclPtrInstance<QueryBox>( this, WinBits( WB_YES_NO | WB_DEF_YES ), aMsg )->Execute() ) + ScopedVclPtrInstance<QueryBox>( this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMsg )->Execute() ) { m_pLbFormat->RemoveEntry( nIndex ); m_pLbFormat->SelectEntryPos( nIndex-1 ); diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx index 9cd98b09f60c..fa1c7eb976b7 100644 --- a/sc/source/ui/miscdlgs/warnbox.cxx +++ b/sc/source/ui/miscdlgs/warnbox.cxx @@ -26,7 +26,7 @@ #include "helpids.h" ScReplaceWarnBox::ScReplaceWarnBox( vcl::Window* pParent ) : - WarningBox( pParent, WB_YES_NO | WB_DEF_YES, ScResId( STR_REPLCELLSWARN ) ) + WarningBox( pParent, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScResId( STR_REPLCELLSWARN ) ) { // By default, the check box is ON, and the user needs to un-check it to // disable all future warnings. diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index e10fff290086..0d9d6e030f53 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -183,7 +183,7 @@ void ScScenarioListBox::EditScenario() void ScScenarioListBox::DeleteScenario() { if( GetSelectEntryCount() > 0 ) - if( ScopedVclPtrInstance<QueryBox>( nullptr, WinBits( WB_YES_NO | WB_DEF_YES ), ScGlobal::GetRscString( STR_QUERY_DELSCENARIO ) )->Execute() == RET_YES ) + if( ScopedVclPtrInstance<QueryBox>( nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString( STR_QUERY_DELSCENARIO ) )->Execute() == RET_YES ) ExecuteScenarioSlot( SID_DELETE_SCENARIO ); } diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index ae2425345311..229ea952fd2c 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -614,7 +614,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) + aStrQueryRemove.getToken( 1, '#' ); if ( RET_YES == ScopedVclPtrInstance<QueryBox>( this, - WinBits( WB_YES_NO | WB_DEF_YES ), + MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMsg )->Execute() ) { diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 269ff7a68890..275c0b060bbe 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2010,7 +2010,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) // or should create a new overlapping conditional format if(!bCondFormatDlg && bContainsExistingCondFormat) { - ScopedVclPtrInstance<QueryBox> aBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), + ScopedVclPtrInstance<QueryBox> aBox( pTabViewShell->GetDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) ); bool bEditExisting = aBox->Execute() == RET_YES; if(bEditExisting) @@ -2952,7 +2952,7 @@ void ScCellShell::ExecuteDataPilotDialog() // confirm selection if it contains SubTotal cells ScopedVclPtrInstance<QueryBox> aBox( pTabViewShell->GetDialogParent(), - WinBits(WB_YES_NO | WB_DEF_YES), + MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) ); if (aBox->Execute() == RET_NO) bOK = false; diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index b2be50b1ba05..35cd7e44d25c 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -419,7 +419,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) { if ( rReq.IsAPI() || RET_YES == - ScopedVclPtrInstance<QueryBox>( pTabViewShell->GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScopedVclPtrInstance<QueryBox>( pTabViewShell->GetDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_UPDATE_SCENARIO) )-> Execute() ) { diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index 876abdfa3156..16a5d4d431cb 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -340,7 +340,7 @@ void ScDBFunc::ToggleAutoFilter() { if (!bHeader) { - if ( ScopedVclPtrInstance<MessBox>( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + if ( ScopedVclPtrInstance<MessBox>( GetViewData().GetDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), // "StarCalc" ScGlobal::GetRscString( STR_MSSG_MAKEAUTOFILTER_0 ) // header from first row? )->Execute() == RET_YES ) diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 8443f0bc54ef..fc0a8da88c46 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -396,11 +396,11 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord, if (rParam.bReplace) if (rDoc.TestRemoveSubTotals( nTab, rParam )) { - bOk = ( ScopedVclPtrInstance<MessBox>( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - // "StarCalc" "delete data?" - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) )->Execute() - == RET_YES ); + bOk = ScopedVclPtrInstance<MessBox>( GetViewData().GetDialogParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, + // "StarCalc" "delete data?" + ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), + ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) )->Execute() + == RET_YES; } if (bOk) diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 8ad1f59c1c74..f3100a2376f8 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -306,7 +306,7 @@ bool ScSpellingEngine::ShowTableWrapDialog() { vcl::Window* pParent = GetDialogParent(); ScWaitCursorOff aWaitOff( pParent ); - ScopedVclPtrInstance<MessBox> aMsgBox( pParent, WinBits( WB_YES_NO | WB_DEF_YES ), + ScopedVclPtrInstance<MessBox> aMsgBox( pParent, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), ScGlobal::GetRscString( STR_SPELLING_BEGIN_TAB) ); return aMsgBox->Execute() == RET_YES; diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index ad32a62964d8..c178a4033d66 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -624,7 +624,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) // Hard warning as there is potential of data loss on deletion bDoIt = ( RET_YES == ScopedVclPtrInstance<QueryBox>( GetDialogParent(), - WinBits( WB_YES_NO | WB_DEF_NO ), + MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, ScGlobal::GetRscString(STR_QUERY_PIVOTTABLE_DELTAB))->Execute() ); } else @@ -632,7 +632,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) // no parameter given, ask for confirmation bDoIt = ( RET_YES == ScopedVclPtrInstance<QueryBox>( GetDialogParent(), - WinBits( WB_YES_NO | WB_DEF_YES ), + MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScGlobal::GetRscString(STR_QUERY_DELTAB))->Execute() ); } } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index cf01cb183b02..0cf938c2058a 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2042,7 +2042,7 @@ void ScViewFunc::Solve( const ScSolveParam& rParam ) } ScopedVclPtrInstance<MessBox> aBox( GetViewData().GetDialogParent(), - WinBits(WB_YES_NO | WB_DEF_NO), + MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), aMsgStr ); sal_uInt16 nRetVal = aBox->Execute(); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 7eacb848350f..0d7d4968a76d 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1073,7 +1073,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScWaitCursorOff aWaitOff( GetFrameWin() ); OUString aMessage = ScGlobal::GetRscString( STR_PASTE_BIGGER ); ScopedVclPtrInstance<QueryBox> aBox( GetViewData().GetDialogParent(), - WinBits(WB_YES_NO | WB_DEF_NO), aMessage ); + MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, aMessage ); if ( aBox->Execute() != RET_YES ) { return false; diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index bb2dfeda707d..a3132788411d 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -441,7 +441,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString aMessage( ScResId( SCSTR_FORMULA_AUTOCORRECTION ) ); aMessage += aCorrectedFormula; nResult = ScopedVclPtrInstance<QueryBox>( GetViewData().GetDialogParent(), - WinBits(WB_YES_NO | WB_DEF_YES), + MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMessage )->Execute(); } if ( nResult == RET_YES ) diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index aa69400c3237..f1bdd1f78260 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -465,7 +465,7 @@ bool SdDrawDocument::InsertBookmarkAsPage( pBMPage->GetLowerBorder() != pRefPage->GetLowerBorder()) { OUString aStr(SdResId(STR_SCALE_OBJECTS)); - sal_uInt16 nBut = ScopedVclPtrInstance<QueryBox>(nullptr, WB_YES_NO_CANCEL, aStr)->Execute(); + sal_uInt16 nBut = ScopedVclPtrInstance<QueryBox>(nullptr, MessBoxStyle::YesNoCancel, aStr)->Execute(); bScaleObjects = nBut == RET_YES; bContinue = nBut != RET_CANCEL; diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 1e4bfb87a9e5..2d54dbf9d3f8 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -3103,7 +3103,7 @@ bool HtmlExport::checkForExistingFiles() osl::FileBase::getSystemPathFromFileURL( maExportPath, aSystemPath ); OUString aMsg(SdResId(STR_OVERWRITE_WARNING)); aMsg = aMsg.replaceFirst( "%FILENAME", aSystemPath ); - ScopedVclPtrInstance< WarningBox > aWarning( nullptr, WB_YES_NO | WB_DEF_YES, aMsg ); + ScopedVclPtrInstance< WarningBox > aWarning( nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMsg ); aWarning->SetImage( WarningBox::GetStandardImage() ); bFound = ( RET_NO == aWarning->Execute() ); } diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 03b20553026f..8f697fc0b9e7 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -1510,7 +1510,7 @@ void CustomAnimationEffectTabPage::openSoundFileDialog() { OUString aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE)); aStrWarning = aStrWarning.replaceFirst("%", aFile); - ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ); + ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, MessBoxStyle::RetryCancel, WB_3DLOOK, aStrWarning ); aWarningBox->SetModalInputMode (true); bQuitLoop = aWarningBox->Execute() != RET_RETRY; diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index aec1d09e893f..8763f095c2ba 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -763,7 +763,7 @@ void SlideTransitionPane::openSoundFileDialog() { OUString aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE)); aStrWarning = aStrWarning.replaceFirst("%", aFile); - ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ); + ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, MessBoxStyle::RetryCancel, WB_3DLOOK, aStrWarning ); aWarningBox->SetModalInputMode (true); bQuitLoop = (aWarningBox->Execute() != RET_RETRY); diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index d5e67d68c604..38a9d5e72e51 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -838,7 +838,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward) // Pop up question box that asks the user whether to wrap around. // The dialog is made modal with respect to the whole application. - ScopedVclPtrInstance< QueryBox > aQuestionBox( nullptr, (WB_YES_NO | WB_DEF_YES), SdResId(pStringId)); + ScopedVclPtrInstance< QueryBox > aQuestionBox( nullptr, (MessBoxStyle::YesNo | MessBoxStyle::DefaultYes), SdResId(pStringId)); aQuestionBox->SetImage( QueryBox::GetStandardImage() ); if (aQuestionBox->Execute() != RET_YES) break; diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index da5062130fc4..5d441bc0b299 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -208,7 +208,7 @@ TabBarAllowRenamingReturnCode LayerTabBar::AllowRenaming() (rLayerAdmin.GetLayer( aNewName ) && aLayerName != aNewName) ) { // Name already exists - ScopedVclPtrInstance<WarningBox> aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox> aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), MessBoxStyle::Ok, SdResId( STR_WARN_NAME_DUPLICATE ) ); aWarningBox->Execute(); bOK = false; diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index 9bd976062663..b70c7c7b7b92 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -109,7 +109,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, Button*, void) { if (pImagesLst->GetEntryCount() == 0) { - ScopedVclPtrInstance< WarningBox > aWarning(this, WB_OK, SdResId(STR_PHOTO_ALBUM_EMPTY_WARNING)); + ScopedVclPtrInstance< WarningBox > aWarning(this, MessBoxStyle::Ok, SdResId(STR_PHOTO_ALBUM_EMPTY_WARNING)); aWarning->Execute(); } else diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 92b8d48b4dcb..d047d6a39f02 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -439,7 +439,7 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, Button*, pBtn, void ) } else // delete everything { - ScopedVclPtrInstance< WarningBox > aWarnBox( this, WB_YES_NO, SdResId( STR_ASK_DELETE_ALL_PICTURES ) ); + ScopedVclPtrInstance< WarningBox > aWarnBox( this, MessBoxStyle::YesNo, SdResId( STR_ASK_DELETE_ALL_PICTURES ) ); short nReturn = aWarnBox->Execute(); if( nReturn == RET_YES ) diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 63d09eab7188..9659b87a0434 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -531,7 +531,7 @@ IMPL_LINK_NOARG(SdDefineCustomShowDlg, OKHdl, Button*, void) } else { - ScopedVclPtrInstance<WarningBox>( this, WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox>( this, MessBoxStyle::Ok, SdResId( STR_WARN_NAME_DUPLICATE ) )->Execute(); m_pEdtName->GrabFocus(); diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index b05e705a11a9..2bcaa84bb585 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -367,7 +367,7 @@ DeactivateRC SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet ) FillItemSet( pActiveSet ); return DeactivateRC::LeavePage; } - ScopedVclPtrInstance< WarningBox > aWarnBox( GetParent(), WB_YES_NO, SdResId( STR_WARN_SCALE_FAIL ) ); + ScopedVclPtrInstance< WarningBox > aWarnBox( GetParent(), MessBoxStyle::YesNo, SdResId( STR_WARN_SCALE_FAIL ) ); if( aWarnBox->Execute() == RET_YES ) return DeactivateRC::KeepPage; diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx index 426c8f26a9bf..bcfe46d226ea 100644 --- a/sd/source/ui/func/fulinend.cxx +++ b/sd/source/ui/func/fulinend.cxx @@ -137,7 +137,7 @@ void FuLineEnd::DoExecute( SfxRequest& ) } else { - ScopedVclPtrInstance<WarningBox> aWarningBox( mpWindow, WinBits( WB_OK ), + ScopedVclPtrInstance<WarningBox> aWarningBox( mpWindow, MessBoxStyle::Ok, SdResId( STR_WARN_NAME_DUPLICATE ) ); aWarningBox->Execute(); } diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index a43474e6ba6d..fab60111657b 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1283,7 +1283,7 @@ public: { ScopedVclPtrInstance<WarningBox> aWarnBox( pViewShell->GetActiveWindow(), - (WinBits)(WB_OK_CANCEL | WB_DEF_CANCEL), + MessBoxStyle::OkCancel | MessBoxStyle::DefaultCancel, SdResId(STR_WARN_PRINTFORMAT_FAILURE)); if (aWarnBox->Execute() != RET_OK) return; diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index c70bb15cd1f8..e6af2d221c9a 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -1246,7 +1246,7 @@ bool SdOutliner::ShowWrapArroundDialog() // Pop up question box that asks the user whether to wrap around. // The dialog is made modal with respect to the whole application. - ScopedVclPtrInstance<QueryBox> aQuestionBox(nullptr, WB_YES_NO | WB_DEF_YES, SdResId(pStringId)); + ScopedVclPtrInstance<QueryBox> aQuestionBox(nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, SdResId(pStringId)); aQuestionBox->SetImage(QueryBox::GetStandardImage()); sal_uInt16 nBoxResult = ShowModalMessageBox(*aQuestionBox.get()); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 21a5253bd4e2..cbfb9c01a6c0 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1432,7 +1432,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // name already exists ScopedVclPtrInstance<WarningBox> aWarningBox ( GetParentWindow(), - WinBits( WB_OK ), + MessBoxStyle::Ok, SdResId(STR_WARN_NAME_DUPLICATE)); aWarningBox->Execute(); } @@ -1601,7 +1601,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // name already exists ScopedVclPtrInstance<WarningBox> aWarningBox ( GetParentWindow(), - WinBits( WB_OK ), + MessBoxStyle::Ok, SdResId(STR_WARN_NAME_DUPLICATE)); aWarningBox->Execute(); } diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index c05fe79aeb24..6ba98c983fbc 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -105,7 +105,7 @@ void DrawViewShell::DeleteActualLayer() // replace placeholder aString = aString.replaceFirst("$", rName); - if (ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), WB_YES_NO, aString)->Execute() == RET_YES) + if (ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), MessBoxStyle::YesNo, aString)->Execute() == RET_YES) { const SdrLayer* pLayer = rAdmin.GetLayer(rName); mpDrawView->DeleteLayer( pLayer->GetName() ); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 83c20ccbd5a5..0d263e632c67 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -328,7 +328,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) ::sd::Window* pWindow = GetActiveWindow(); ScopedVclPtrInstance<InfoBox>(pWindow, SdResId(STR_ACTION_NOTPOSSIBLE) )->Execute(); } - else if ( ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), WB_YES_NO, + else if ( ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), MessBoxStyle::YesNo, SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )->Execute() == RET_YES ) { @@ -365,7 +365,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) ::sd::Window* pWindow = GetActiveWindow(); ScopedVclPtrInstance<InfoBox>(pWindow, SdResId(STR_ACTION_NOTPOSSIBLE) )->Execute(); } - else if ( ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), WB_YES_NO, + else if ( ScopedVclPtrInstance<QueryBox>(GetActiveWindow(), MessBoxStyle::YesNo, SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )->Execute() == RET_YES ) { diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 7492275c6000..cb7541be015a 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -308,7 +308,7 @@ void LinkManager::UpdateAllLinks( if( bAskUpdate ) { - int nRet = ScopedVclPtrInstance<QueryBox>(pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ))->Execute(); + int nRet = ScopedVclPtrInstance<QueryBox>(pParentWin, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, SfxResId( STR_QUERY_UPDATE_LINKS ))->Execute(); if( RET_YES != nRet ) { SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist(); diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 40e4bd84ef9f..cb6681beeddd 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -152,7 +152,7 @@ ErrCode SvxOpenGraphicDialog::Execute() // could not load? if ( nFound == USHRT_MAX ) { - ScopedVclPtrInstance< WarningBox > aWarningBox(nullptr, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) )); + ScopedVclPtrInstance< WarningBox > aWarningBox(nullptr, MessBoxStyle::RetryCancel, WB_3DLOOK, SfxResId( SvxOpenGrfErr2ResId(nImpRet) )); bQuitLoop = aWarningBox->Execute() != RET_RETRY; } else diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index a93f1da1be73..16e95a3bf1a3 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -485,7 +485,7 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const std::shared_ptr<const SfxFi // Here could a re-installation be offered OUString aText( SfxResId(STR_FILTER_NOT_INSTALLED) ); aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() ); - ScopedVclPtrInstance< QueryBox > aQuery(nullptr, WB_YES_NO | WB_DEF_YES, aText); + ScopedVclPtrInstance< QueryBox > aQuery(nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aText); short nRet = aQuery->Execute(); if ( nRet == RET_YES ) { diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index ed05e0375d14..1c1acc84c958 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -59,7 +59,7 @@ bool SfxRecordingFloatWrapper_Impl::QueryClose() css::uno::Reference< css::frame::XDispatchRecorder > xRecorder = pBindings->GetRecorder(); if ( xRecorder.is() && !xRecorder->getRecordedMacro().isEmpty() ) { - ScopedVclPtrInstance< QueryBox > aBox(GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS)); + ScopedVclPtrInstance< QueryBox > aBox(GetWindow(), MessBoxStyle::YesNo | MessBoxStyle::DefaultNo , SfxResId(STR_MACRO_LOSS)); aBox->SetText( SfxResId(STR_CANCEL_RECORDING) ); bRet = ( aBox->Execute() == RET_YES ); } diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index cdac7d87d1ea..bb6f8b649b85 100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -326,7 +326,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl, CheckBox&, void) bool bAlreadyDone = false; if (!m_bEndRedliningWarningDone) { - ScopedVclPtrInstance<WarningBox> aBox(m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO), + ScopedVclPtrInstance<WarningBox> aBox(m_rMyTabPage.GetParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, m_aEndRedliningWarning ); if (aBox->Execute() != RET_YES) bAlreadyDone = true; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index a9ff7dc804f4..abd772d0fe73 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2924,7 +2924,7 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl:: { sMessage += "\n"; sMessage += SfxResId(pResId); - ScopedVclPtrInstance< WarningBox > aWBox(pParent, WB_YES_NO | WB_DEF_NO, sMessage); + ScopedVclPtrInstance< WarningBox > aWBox(pParent, MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, sMessage); nRet = aWBox->Execute(); } } diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx index c21b73ba7f71..1e1ca56344c7 100644 --- a/sfx2/source/doc/querytemplate.cxx +++ b/sfx2/source/doc/querytemplate.cxx @@ -28,7 +28,7 @@ namespace sfx2 { QueryTemplateBox::QueryTemplateBox( vcl::Window* pParent, const OUString& rMessage ) : - MessBox ( pParent, 0, Application::GetDisplayName(), rMessage ) + MessBox ( pParent, MessBoxStyle::NONE, Application::GetDisplayName(), rMessage ) { SetImage( QueryBox::GetStandardImage() ); SetHelpId( HID_QUERY_LOAD_TEMPLATE ); diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index b8122c59a872..2941c80397d7 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -52,34 +52,34 @@ static DialogMask aWndFunc( SolarMutexGuard aGuard; // determine necessary WinBits from the flags - WinBits eBits=0; + MessBoxStyle eBits = MessBoxStyle::NONE; if ( (nFlags & (DialogMask::ButtonsCancel | DialogMask::ButtonsRetry)) == (DialogMask::ButtonsCancel | DialogMask::ButtonsRetry)) - eBits = WB_RETRY_CANCEL; + eBits = MessBoxStyle::RetryCancel; else if ( (nFlags & DialogMask::ButtonsOkCancel) == DialogMask::ButtonsOkCancel ) - eBits = WB_OK_CANCEL; + eBits = MessBoxStyle::OkCancel; else if ( (nFlags & DialogMask::ButtonsOk) == DialogMask::ButtonsOk ) - eBits = WB_OK; + eBits = MessBoxStyle::Ok; else if ( (nFlags & DialogMask::ButtonsYesNoCancel) == DialogMask::ButtonsYesNoCancel ) - eBits = WB_YES_NO_CANCEL; + eBits = MessBoxStyle::YesNoCancel; else if ( (nFlags & DialogMask::ButtonsYesNo) == DialogMask::ButtonsYesNo ) - eBits = WB_YES_NO; + eBits = MessBoxStyle::YesNo; switch(nFlags & DialogMask(0x0f00)) { case DialogMask::ButtonDefaultsOk: - eBits |= WB_DEF_OK; + eBits |= MessBoxStyle::DefaultOk; break; case DialogMask::ButtonDefaultsCancel: - eBits |= WB_DEF_CANCEL; + eBits |= MessBoxStyle::DefaultCancel; break; case DialogMask::ButtonDefaultsYes: - eBits |= WB_DEF_YES; + eBits |= MessBoxStyle::DefaultYes; break; case DialogMask::ButtonDefaultsNo: - eBits |= WB_DEF_NO; + eBits |= MessBoxStyle::DefaultNo; break; default: break; } diff --git a/svx/source/dialog/prtqry.cxx b/svx/source/dialog/prtqry.cxx index 26a3bbf6e550..898da9491711 100644 --- a/svx/source/dialog/prtqry.cxx +++ b/svx/source/dialog/prtqry.cxx @@ -23,7 +23,7 @@ #include <svx/dialmgr.hxx> SvxPrtQryBox::SvxPrtQryBox(vcl::Window* pParent) : - MessBox(pParent, 0, + MessBox(pParent, MessBoxStyle::NONE, SvxResId(RID_SVXSTR_QRY_PRINT_TITLE), SvxResId(RID_SVXSTR_QRY_PRINT_MSG)) { diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx index 83ec24fd291d..43ba59216af8 100644 --- a/svx/source/form/databaselocationinput.cxx +++ b/svx/source/form/databaselocationinput.cxx @@ -124,7 +124,7 @@ namespace svx { if ( ::utl::UCBContentHelper::Exists( sURL ) ) { - ScopedVclPtrInstance< QueryBox > aBox( m_rLocationInput.GetSystemWindow(), WB_YES_NO, SvxResId(RID_STR_ALREADYEXISTOVERWRITE) ); + ScopedVclPtrInstance< QueryBox > aBox( m_rLocationInput.GetSystemWindow(), MessBoxStyle::YesNo, SvxResId(RID_STR_ALREADYEXISTOVERWRITE) ); if ( aBox->Execute() != RET_YES ) return false; } diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 09499d3a7dc9..1c3f17b4b52a 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -911,7 +911,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) if (xConfigItem->GetMailServer().isEmpty() || !SwMailMergeHelper::CheckMailAddress(xConfigItem->GetMailAddress()) ) { - ScopedVclPtrInstance< QueryBox > aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail); + ScopedVclPtrInstance< QueryBox > aQuery(pButton, MessBoxStyle::YesNoCancel, m_sConfigureMail); sal_uInt16 nRet = aQuery->Execute(); if (RET_YES == nRet ) { diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index 358ec557446c..401d4901859b 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -152,7 +152,7 @@ void SwGlossaryGroupDlg::Apply() const OUString sMsg(SwResId(STR_QUERY_DELETE_GROUP1) + sTitle + SwResId(STR_QUERY_DELETE_GROUP2)); - ScopedVclPtrInstance< QueryBox > aQuery(GetParent(), WB_YES_NO|WB_DEF_NO, sMsg ); + ScopedVclPtrInstance< QueryBox > aQuery(GetParent(), MessBoxStyle::YesNo|MessBoxStyle::DefaultNo, sMsg ); if(RET_YES == aQuery->Execute()) pGlosHdl->DelGroup( sDelGroup ); } diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 8bb89e7958cc..420ff42e17f0 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -375,7 +375,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, Button*, void) aMessage += m_pLbFormat->GetSelectEntry(); aMessage += "\n"; - VclPtrInstance<MessBox> pBox( this, WinBits( WB_OK_CANCEL ), + VclPtrInstance<MessBox> pBox( this, MessBoxStyle::OkCancel, aStrDelTitle, aMessage ); if ( pBox->Execute() == RET_OK ) diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 30e923ae0eb5..001690e4978e 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -251,7 +251,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const static short lcl_AskRedlineFlags(vcl::Window *pWin) { - ScopedVclPtrInstance<MessBox> aQBox( pWin, 0, + ScopedVclPtrInstance<MessBox> aQBox( pWin, MessBoxStyle::NONE, SwResId( STR_REDLINE_TITLE ), SwResId( STR_REDLINE_MSG ) ); aQBox->SetImage( QueryBox::GetStandardImage() ); diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 7ac25e45d11d..3aaafda5ecc7 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -417,7 +417,7 @@ void SwView::HyphenateDocument() // do not hyphenate if interactive hyphenation is active elsewhere if (SwEditShell::HasHyphIter()) { - ScopedVclPtrInstance<MessBox>( nullptr, WB_OK, SwResId( STR_HYPH_TITLE ), + ScopedVclPtrInstance<MessBox>( nullptr, MessBoxStyle::Ok, SwResId( STR_HYPH_TITLE ), SwResId( STR_MULT_INTERACT_HYPH_WARN ) )->Execute(); return; } diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index db5e47fe3fdb..51e2b4670cb5 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -207,8 +207,10 @@ protected: virtual void SAL_CALL disposing() override; - static vcl::Window* ImplCreateWindow( VCLXWindow** ppNewComp, const css::awt::WindowDescriptor& rDescriptor, vcl::Window* pParent, WinBits nWinBits ); - css::uno::Reference< css::awt::XWindowPeer > ImplCreateWindow( const css::awt::WindowDescriptor& Descriptor, WinBits nWinBits ); + static vcl::Window* ImplCreateWindow( VCLXWindow** ppNewComp, const css::awt::WindowDescriptor& rDescriptor, vcl::Window* pParent, + WinBits nWinBits, MessBoxStyle nMessBoxStyle ); + css::uno::Reference< css::awt::XWindowPeer > ImplCreateWindow( const css::awt::WindowDescriptor& Descriptor, + WinBits nForceWinBits, MessBoxStyle nForceMessBoxStyle ); public: @@ -312,9 +314,10 @@ public: }; -WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, WindowType nCompType ) +std::pair<WinBits,MessBoxStyle> ImplGetWinBits( sal_uInt32 nComponentAttribs, WindowType nCompType ) { WinBits nWinBits = 0; + MessBoxStyle nStyle = MessBoxStyle::NONE; bool bMessBox = false; if ( ( nCompType == WindowType::INFOBOX ) || @@ -377,29 +380,29 @@ WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, WindowType nCompType ) if( nComponentAttribs & css::awt::VclWindowPeerAttribute::NOLABEL ) //added for issue79712 nWinBits |= WB_NOLABEL; - // These bits are not uniqe + // These bits are not unique if ( bMessBox ) { if( nComponentAttribs & css::awt::VclWindowPeerAttribute::OK ) - nWinBits |= WB_OK; + nStyle |= MessBoxStyle::Ok; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::OK_CANCEL ) - nWinBits |= WB_OK_CANCEL; + nStyle |= MessBoxStyle::OkCancel; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::YES_NO ) - nWinBits |= WB_YES_NO; + nStyle |= MessBoxStyle::YesNo; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::YES_NO_CANCEL ) - nWinBits |= WB_YES_NO_CANCEL; + nStyle |= MessBoxStyle::YesNoCancel; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::RETRY_CANCEL ) - nWinBits |= WB_RETRY_CANCEL; + nStyle |= MessBoxStyle::RetryCancel; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::DEF_OK ) - nWinBits |= WB_DEF_OK; + nStyle |= MessBoxStyle::DefaultOk; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::DEF_CANCEL ) - nWinBits |= WB_DEF_CANCEL; + nStyle |= MessBoxStyle::DefaultCancel; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::DEF_RETRY ) - nWinBits |= WB_DEF_RETRY; + nStyle |= MessBoxStyle::DefaultRetry; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::DEF_YES ) - nWinBits |= WB_DEF_YES; + nStyle |= MessBoxStyle::DefaultYes; if( nComponentAttribs & css::awt::VclWindowPeerAttribute::DEF_NO ) - nWinBits |= WB_DEF_NO; + nStyle |= MessBoxStyle::DefaultNo; } if ( nCompType == WindowType::MULTILINEEDIT || nCompType == WindowType::DIALOG || nCompType == WindowType::GROUPBOX ) { @@ -424,7 +427,7 @@ WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, WindowType nCompType ) } } - return nWinBits; + return { nWinBits, nStyle }; } struct ComponentInfo @@ -761,7 +764,7 @@ css::awt::Rectangle VCLXToolkit::getWorkArea( ) css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createWindow( const css::awt::WindowDescriptor& rDescriptor ) { - return ImplCreateWindow( rDescriptor, WinBits(0) ); + return ImplCreateWindow( rDescriptor, WinBits(0), MessBoxStyle::NONE ); } css::uno::Reference< css::awt::XDevice > VCLXToolkit::createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height ) @@ -791,7 +794,7 @@ css::uno::Reference< css::awt::XRegion > VCLXToolkit::createRegion( ) vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, const css::awt::WindowDescriptor& rDescriptor, - vcl::Window* pParent, WinBits nWinBits ) + vcl::Window* pParent, WinBits nWinBits, MessBoxStyle nMessBoxStyle ) { OUString aServiceName( rDescriptor.WindowServiceName ); aServiceName = aServiceName.toAsciiLowerCase(); @@ -881,7 +884,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, *ppNewComp = new VCLXEdit; break; case WindowType::ERRORBOX: - pNewWindow = VclPtr<ErrorBox>::Create( pParent, nWinBits, OUString() ); + pNewWindow = VclPtr<ErrorBox>::Create( pParent, nMessBoxStyle, nWinBits, OUString() ); *ppNewComp = new VCLXMessageBox; break; case WindowType::FIXEDBITMAP: @@ -942,7 +945,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, *ppNewComp = new VCLXButton; break; case WindowType::MESSBOX: - pNewWindow = VclPtr<MessBox>::Create( pParent, nWinBits, OUString(), OUString() ); + pNewWindow = VclPtr<MessBox>::Create( pParent, nMessBoxStyle, nWinBits, OUString(), OUString() ); *ppNewComp = new VCLXMessageBox; break; case WindowType::METRICBOX: @@ -1006,7 +1009,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, *ppNewComp = new VCLXButton; break; case WindowType::QUERYBOX: - pNewWindow = VclPtr<QueryBox>::Create( pParent, nWinBits, OUString() ); + pNewWindow = VclPtr<QueryBox>::Create( pParent, nMessBoxStyle, nWinBits, OUString() ); *ppNewComp = new VCLXMessageBox; break; case WindowType::RADIOBUTTON: @@ -1082,7 +1085,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, pNewWindow = VclPtr<TriStateBox>::Create( pParent, nWinBits ); break; case WindowType::WARNINGBOX: - pNewWindow = VclPtr<WarningBox>::Create( pParent, nWinBits, OUString() ); + pNewWindow = VclPtr<WarningBox>::Create( pParent, nMessBoxStyle, nWinBits, OUString() ); *ppNewComp = new VCLXMessageBox; break; case WindowType::WORKWINDOW: @@ -1213,7 +1216,7 @@ extern "C" vcl::Window* SAL_CALL CreateWindow( VCLXWindow** ppNewComp, const css css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( const css::awt::WindowDescriptor& rDescriptor, - WinBits nForceWinBits ) + WinBits nForceWinBits, MessBoxStyle nForceMessBoxStyle ) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); @@ -1232,9 +1235,11 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( if ( pParentComponent ) pParent = pParentComponent->GetWindow(); } - WinBits nWinBits = ImplGetWinBits( rDescriptor.WindowAttributes, + std::pair<WinBits, MessBoxStyle> aPair = ImplGetWinBits( rDescriptor.WindowAttributes, ImplGetComponentType( rDescriptor.WindowServiceName ) ); + WinBits nWinBits = aPair.first; nWinBits |= nForceWinBits; + aPair.second |= nForceMessBoxStyle; VCLXWindow* pNewComp = nullptr; @@ -1268,7 +1273,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( // if SvTools could not provide a window, create it ourself if ( !pNewWindow ) - pNewWindow = ImplCreateWindow( &pNewComp, rDescriptor, pParent, nWinBits ); + pNewWindow = ImplCreateWindow( &pNewComp, rDescriptor, pParent, nWinBits, aPair.second ); DBG_ASSERT( pNewWindow, "createWindow: Unknown Component!" ); SAL_INFO_IF( !pNewComp, "toolkit", "createWindow: No special Interface!" ); @@ -1448,11 +1453,11 @@ css::uno::Reference< css::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessage // No more bits for VclWindowPeerAttribute possible. Mapping must be // done explicitly using VCL methods - WinBits nAddWinBits( 0 ); + MessBoxStyle nAddWinBits = MessBoxStyle::NONE; if (( aButtons & 0x0000ffffL ) == css::awt::MessageBoxButtons::BUTTONS_ABORT_IGNORE_RETRY ) - nAddWinBits |= WB_ABORT_RETRY_IGNORE; + nAddWinBits |= MessBoxStyle::AbortRetryIgnore; if ( sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_IGNORE ) - nAddWinBits |= WB_DEF_IGNORE; + nAddWinBits |= MessBoxStyle::DefaultIgnore; rtl::OUString aType; lcl_convertMessageBoxType( aType, eType ); @@ -1463,7 +1468,7 @@ css::uno::Reference< css::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessage aDescriptor.Parent = aParent; aDescriptor.WindowAttributes = nWindowAttributes; css::uno::Reference< css::awt::XMessageBox > xMsgBox( - ImplCreateWindow( aDescriptor, nAddWinBits ), css::uno::UNO_QUERY ); + ImplCreateWindow( aDescriptor, 0, nAddWinBits ), css::uno::UNO_QUERY ); css::uno::Reference< css::awt::XWindow > xWindow( xMsgBox, css::uno::UNO_QUERY ); if ( xMsgBox.is() && xWindow.is() ) { diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx index 755d82171edc..02687af3800b 100644 --- a/uui/source/alreadyopen.cxx +++ b/uui/source/alreadyopen.cxx @@ -22,7 +22,7 @@ #include <unotools/resmgr.hxx> AlreadyOpenQueryBox::AlreadyOpenQueryBox( vcl::Window* pParent, const std::locale& rLocale, const OUString& aMessage, bool bIsStoring ) : - MessBox(pParent, 0, + MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_ALREADYOPEN_TITLE, rLocale), aMessage ) { diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx index 97c98d216438..e9d50ce12584 100644 --- a/uui/source/filechanged.cxx +++ b/uui/source/filechanged.cxx @@ -22,7 +22,7 @@ #include "filechanged.hxx" FileChangedQueryBox::FileChangedQueryBox( vcl::Window* pParent, const std::locale& rLocale ) : - MessBox(pParent, 0, + MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_FILECHANGED_TITLE, rLocale), OUString() ) { diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 1277d11c17cc..9f4642ab063e 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -48,7 +48,7 @@ executeErrorDialog( task::InteractionClassification eClassification, OUString const & rContext, OUString const & rMessage, - WinBits nButtonMask) + MessBoxStyle nButtonMask) { SolarMutexGuard aGuard; @@ -76,9 +76,9 @@ executeErrorDialog( break; case task::InteractionClassification_INFO: -# define WB_DEF_BUTTONS (WB_DEF_OK | WB_DEF_CANCEL | WB_DEF_RETRY) +# define WB_DEF_BUTTONS (MessBoxStyle::DefaultOk | MessBoxStyle::DefaultCancel | MessBoxStyle::DefaultRetry) //(want to ignore any default button settings)... - if ((nButtonMask & WB_DEF_BUTTONS) == WB_DEF_OK) + if ((nButtonMask & WB_DEF_BUTTONS) == MessBoxStyle::DefaultOk) xBox.reset(VclPtr<InfoBox>::Create(pParent, aText.makeStringAndClear())); else @@ -214,30 +214,30 @@ UUIInteractionHelper::handleErrorHandlerRequest( // Finally, it seems to be better to leave default button // determination to VCL (the favouring of CANCEL as default button // seems to not always be what the user wants)... - WinBits const aButtonMask[16] - = { 0, - WB_OK /*| WB_DEF_OK*/, // Abort - 0, - WB_RETRY_CANCEL /*| WB_DEF_CANCEL*/, // Retry, Abort - 0, - 0, - 0, - 0, - WB_OK /*| WB_DEF_OK*/, // Approve - WB_OK_CANCEL /*| WB_DEF_CANCEL*/, // Approve, Abort - 0, - 0, - WB_YES_NO /*| WB_DEF_NO*/, // Approve, Disapprove - WB_YES_NO_CANCEL /*| WB_DEF_CANCEL*/, + MessBoxStyle const aButtonMask[16] + = { MessBoxStyle::NONE, + MessBoxStyle::Ok /*| MessBoxStyle::DefaultOk*/, // Abort + MessBoxStyle::NONE, + MessBoxStyle::RetryCancel /*| MessBoxStyle::DefaultCancel*/, // Retry, Abort + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::Ok /*| MessBoxStyle::DefaultOk*/, // Approve + MessBoxStyle::OkCancel /*| MessBoxStyle::DefaultCancel*/, // Approve, Abort + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::YesNo /*| MessBoxStyle::DefaultNo*/, // Approve, Disapprove + MessBoxStyle::YesNoCancel /*| MessBoxStyle::DefaultCancel*/, // Approve, Disapprove, Abort - 0, - 0 }; + MessBoxStyle::NONE, + MessBoxStyle::NONE }; - WinBits nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0) + MessBoxStyle nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0) | (xDisapprove.is() ? 4 : 0) | (xRetry.is() ? 2 : 0) | (xAbort.is() ? 1 : 0)]; - if (nButtonMask == 0) + if (nButtonMask == MessBoxStyle::NONE) return; //TODO! remove this backwards compatibility? diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 4b61c00c8979..d136f047c3f3 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -961,7 +961,7 @@ executeMessageBox( vcl::Window * pParent, OUString const & rTitle, OUString const & rMessage, - WinBits nButtonMask ) + MessBoxStyle nButtonMask ) { SolarMutexGuard aGuard; @@ -1110,7 +1110,7 @@ UUIInteractionHelper::handleGenericErrorRequest( aTitle += aErrTitle; executeMessageBox( - getParentProperty(), aTitle, aErrorString, WB_OK ); + getParentProperty(), aTitle, aErrorString, MessBoxStyle::Ok ); } else ErrorHandler::HandleError(nErrorCode); @@ -1208,14 +1208,14 @@ UUIInteractionHelper::handleBrokenPackageRequest( return; } - WinBits nButtonMask; + MessBoxStyle nButtonMask; if( xApprove.is() && xDisapprove.is() ) { - nButtonMask = WB_YES_NO | WB_DEF_YES; + nButtonMask = MessBoxStyle::YesNo | MessBoxStyle::DefaultYes; } else if ( xAbort.is() ) { - nButtonMask = WB_OK; + nButtonMask = MessBoxStyle::Ok; } else return; diff --git a/uui/source/lockcorrupt.cxx b/uui/source/lockcorrupt.cxx index a101a6794332..5812216b0c4e 100644 --- a/uui/source/lockcorrupt.cxx +++ b/uui/source/lockcorrupt.cxx @@ -24,7 +24,7 @@ #include <vcl/button.hxx> LockCorruptQueryBox::LockCorruptQueryBox(vcl::Window* pParent, const std::locale& rResLocale) - : MessBox(pParent, 0, Translate::get(STR_LOCKCORRUPT_TITLE, rResLocale), OUString()) + : MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_LOCKCORRUPT_TITLE, rResLocale), OUString()) { SetImage( ErrorBox::GetStandardImage() ); diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx index e5d00b9a01a6..80209ee5fbbc 100644 --- a/uui/source/lockfailed.cxx +++ b/uui/source/lockfailed.cxx @@ -23,7 +23,7 @@ #include <vcl/button.hxx> LockFailedQueryBox::LockFailedQueryBox(vcl::Window* pParent, const std::locale& rResLocale) - : MessBox(pParent, 0, Translate::get(STR_LOCKFAILED_TITLE, rResLocale), OUString()) + : MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_LOCKFAILED_TITLE, rResLocale), OUString()) { SetImage( ErrorBox::GetStandardImage() ); diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx index cae6baa2b0c0..dfd59425e090 100644 --- a/uui/source/openlocked.cxx +++ b/uui/source/openlocked.cxx @@ -22,7 +22,7 @@ #include <unotools/resmgr.hxx> OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage ) : - MessBox(pParent, 0, + MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_OPENLOCKED_TITLE, rResLocale), aMessage ) { diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx index a7eb623d1fc4..01a09502b286 100644 --- a/uui/source/trylater.cxx +++ b/uui/source/trylater.cxx @@ -22,7 +22,7 @@ #include "trylater.hxx" TryLaterQueryBox::TryLaterQueryBox(vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage) - : MessBox(pParent, 0, Translate::get(STR_TRYLATER_TITLE, rResLocale), aMessage) + : MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_TRYLATER_TITLE, rResLocale), aMessage) { SetImage( QueryBox::GetStandardImage() ); diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index e2bbde0e7c99..e00f2e45bd61 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -48,39 +48,38 @@ static void ImplInitMsgBoxImageList() void MessBox::ImplInitButtons() { - WinBits nStyle = GetStyle(); ButtonDialogFlags nOKFlags = ButtonDialogFlags::OK; ButtonDialogFlags nCancelFlags = ButtonDialogFlags::Cancel; ButtonDialogFlags nRetryFlags = ButtonDialogFlags::NONE; ButtonDialogFlags nYesFlags = ButtonDialogFlags::NONE; ButtonDialogFlags nNoFlags = ButtonDialogFlags::NONE; - if ( nStyle & WB_OK_CANCEL ) + if ( mnMessBoxStyle & MessBoxStyle::OkCancel ) { - if ( nStyle & WB_DEF_CANCEL ) + if ( mnMessBoxStyle & MessBoxStyle::DefaultCancel ) nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; - else // WB_DEF_OK + else // MessBoxStyle::DefaultOk nOKFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; AddButton( StandardButtonType::OK, RET_OK, nOKFlags ); AddButton( StandardButtonType::Cancel, RET_CANCEL, nCancelFlags ); } - else if ( nStyle & WB_YES_NO ) + else if ( mnMessBoxStyle & MessBoxStyle::YesNo ) { - if ( nStyle & WB_DEF_YES ) + if ( mnMessBoxStyle & MessBoxStyle::DefaultYes ) nYesFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; - else // WB_DEF_NO + else // MessBoxStyle::DefaultNo nNoFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; nNoFlags |= ButtonDialogFlags::Cancel; AddButton( StandardButtonType::Yes, RET_YES, nYesFlags ); AddButton( StandardButtonType::No, RET_NO, nNoFlags ); } - else if ( nStyle & WB_YES_NO_CANCEL ) + else if ( mnMessBoxStyle & MessBoxStyle::YesNoCancel ) { - if ( nStyle & WB_DEF_YES ) + if ( mnMessBoxStyle & MessBoxStyle::DefaultYes ) nYesFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; - else if ( nStyle & WB_DEF_NO ) + else if ( mnMessBoxStyle & MessBoxStyle::DefaultNo ) nNoFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; else nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; @@ -89,33 +88,33 @@ void MessBox::ImplInitButtons() AddButton( StandardButtonType::No, RET_NO, nNoFlags ); AddButton( StandardButtonType::Cancel, RET_CANCEL, nCancelFlags ); } - else if ( nStyle & WB_RETRY_CANCEL ) + else if ( mnMessBoxStyle & MessBoxStyle::RetryCancel ) { - if ( nStyle & WB_DEF_CANCEL ) + if ( mnMessBoxStyle & MessBoxStyle::DefaultCancel ) nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; - else // WB_DEF_RETRY + else // MessBoxStyle::DefaultRetry nRetryFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; AddButton( StandardButtonType::Retry, RET_RETRY, nRetryFlags ); AddButton( StandardButtonType::Cancel, RET_CANCEL, nCancelFlags ); } - else if ( nStyle & WB_ABORT_RETRY_IGNORE ) + else if ( mnMessBoxStyle & MessBoxStyle::AbortRetryIgnore ) { ButtonDialogFlags nAbortFlags = ButtonDialogFlags::NONE; ButtonDialogFlags nIgnoreFlags = ButtonDialogFlags::NONE; - if ( nStyle & WB_DEF_CANCEL ) + if ( mnMessBoxStyle & MessBoxStyle::DefaultCancel ) nAbortFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; - else if ( nStyle & WB_DEF_RETRY ) + else if ( mnMessBoxStyle & MessBoxStyle::DefaultRetry ) nRetryFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; - else if ( nStyle & WB_DEF_IGNORE ) + else if ( mnMessBoxStyle & MessBoxStyle::DefaultIgnore ) nIgnoreFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; AddButton( StandardButtonType::Abort, RET_CANCEL, nAbortFlags ); AddButton( StandardButtonType::Retry, RET_RETRY, nRetryFlags ); AddButton( StandardButtonType::Ignore, RET_IGNORE, nIgnoreFlags ); } - else if ( nStyle & WB_OK ) + else if ( mnMessBoxStyle & MessBoxStyle::Ok ) { nOKFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus; @@ -123,14 +122,21 @@ void MessBox::ImplInitButtons() } } -MessBox::MessBox( vcl::Window* pParent, WinBits nStyle, +MessBox::MessBox( vcl::Window* pParent, MessBoxStyle nMessBoxStyle, + const OUString& rTitle, const OUString& rMessage ) : + MessBox(pParent, nMessBoxStyle, 0, rTitle, rMessage) +{ +} + +MessBox::MessBox( vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits nWinBits, const OUString& rTitle, const OUString& rMessage ) : ButtonDialog( WindowType::MESSBOX ), mbHelpBtn( false ), mbCheck( false ), + mnMessBoxStyle( nMessBoxStyle ), maMessText( rMessage ) { - ImplInit( pParent, nStyle | WB_MOVEABLE | WB_HORZ | WB_CENTER ); + ImplInit( pParent, nWinBits | WB_MOVEABLE | WB_HORZ | WB_CENTER ); ImplInitButtons(); if ( !rTitle.isEmpty() ) @@ -367,7 +373,7 @@ Size MessBox::GetOptimalSize() const } InfoBox::InfoBox( vcl::Window* pParent, const OUString& rMessage ) : - MessBox( pParent, WB_OK | WB_DEF_OK, OUString(), rMessage ) + MessBox( pParent, MessBoxStyle::Ok | MessBoxStyle::DefaultOk, OUString(), rMessage ) { // Default Text is the display title from the application if ( GetText().isEmpty() ) @@ -376,7 +382,7 @@ InfoBox::InfoBox( vcl::Window* pParent, const OUString& rMessage ) : SetImage( InfoBox::GetStandardImage() ); } -InfoBox::InfoBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) : +InfoBox::InfoBox( vcl::Window* pParent, MessBoxStyle nStyle, const OUString& rMessage ) : MessBox( pParent, nStyle, OUString(), rMessage ) { // Default Text is the display title from the application @@ -397,9 +403,15 @@ OUString InfoBox::GetStandardText() return VclResId(SV_MSGBOX_INFO); } -WarningBox::WarningBox( vcl::Window* pParent, WinBits nStyle, +WarningBox::WarningBox( vcl::Window* pParent, MessBoxStyle nStyle, const OUString& rMessage ) : - MessBox( pParent, nStyle, OUString(), rMessage ) + WarningBox( pParent, nStyle, 0, rMessage ) +{ +} + +WarningBox::WarningBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits nWinBits, + const OUString& rMessage ) : + MessBox( pParent, nStyle, nWinBits, OUString(), rMessage ) { // Default Text is the display title from the application if ( GetText().isEmpty() ) @@ -425,7 +437,7 @@ OUString WarningBox::GetStandardText() } ErrorBox::ErrorBox( vcl::Window* pParent, const OUString& rMessage ) : - MessBox( pParent, WB_OK | WB_DEF_OK, OUString(), rMessage ) + MessBox( pParent, MessBoxStyle::Ok | MessBoxStyle::DefaultOk, OUString(), rMessage ) { // Default Text is the display title from the application if ( GetText().isEmpty() ) @@ -434,9 +446,15 @@ ErrorBox::ErrorBox( vcl::Window* pParent, const OUString& rMessage ) : SetImage( ErrorBox::GetStandardImage() ); } -ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle, +ErrorBox::ErrorBox( vcl::Window* pParent, MessBoxStyle nStyle, const OUString& rMessage ) : - MessBox( pParent, nStyle, OUString(), rMessage ) + ErrorBox(pParent, nStyle, 0, rMessage ) +{ +} + +ErrorBox::ErrorBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits nWinBits, + const OUString& rMessage ) : + MessBox( pParent, nStyle, nWinBits, OUString(), rMessage ) { // Default Text is the display title from the application if ( GetText().isEmpty() ) @@ -465,8 +483,13 @@ OUString ErrorBox::GetStandardText() return VclResId(SV_MSGBOX_ERROR); } -QueryBox::QueryBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) : - MessBox( pParent, nStyle, OUString(), rMessage ) +QueryBox::QueryBox( vcl::Window* pParent, MessBoxStyle nStyle, const OUString& rMessage ) : + QueryBox( pParent, nStyle, 0, rMessage ) +{ +} + +QueryBox::QueryBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits nWinBits, const OUString& rMessage ) : + MessBox( pParent, nStyle, nWinBits, OUString(), rMessage ) { // Default Text is the display title from the application if ( GetText().isEmpty() ) diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx index 19a9c41049eb..db8b237a7272 100644 --- a/vcl/unx/x11/x11sys.cxx +++ b/vcl/unx/x11/x11sys.cxx @@ -92,7 +92,7 @@ int X11SalSystem::ShowNativeDialog( const OUString& rTitle, const OUString& rMes if( pSVData->mpIntroWindow ) pSVData->mpIntroWindow->Hide(); - ScopedVclPtrInstance<WarningBox> aWarn(nullptr, WB_STDWORK, rMessage); + ScopedVclPtrInstance<WarningBox> aWarn(nullptr, MessBoxStyle::NONE, WB_STDWORK, rMessage); aWarn->SetText( rTitle ); aWarn->Clear(); |