diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/dbgui/consdlg.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scendlg.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/docshell/arealink.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocimp.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 21 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 19 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh5.cxx | 33 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpusrlst.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/spelleng.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/tabview2.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun4.cxx | 10 |
17 files changed, 144 insertions, 66 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 0bafb21b85ca..c806f05aae6e 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -73,7 +73,8 @@ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <svl/zforlist.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <utility> #include <vector> @@ -3308,8 +3309,10 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet( catch ( const sdbc::SQLException& rError ) { //! store error message - ScopedVclPtrInstance< InfoBox > aInfoBox( nullptr, rError.Message ); - aInfoBox->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Info, VclButtonsType::Ok, + rError.Message)); + xInfoBox->run(); } catch ( uno::Exception& ) { diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index 7d1ccc0f6b33..0e3e09839892 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -32,9 +32,19 @@ #include <strings.hrc> #include <consdlg.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> -#define INFOBOX(id) ScopedVclPtrInstance<InfoBox>(this, ScGlobal::GetRscString(id))->Execute() +namespace +{ + void INFOBOX(weld::Window* pWindow, const char* id) + { + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(id))); + xInfoBox->run(); + } +} class ScAreaData { @@ -406,7 +416,7 @@ IMPL_LINK_NOARG(ScConsolidateDlg, OkHdl, Button*, void) } else { - INFOBOX( STR_INVALID_TABREF ); + INFOBOX(GetFrameWeld(), STR_INVALID_TABREF); pEdDestArea->GrabFocus(); } } @@ -461,11 +471,11 @@ IMPL_LINK( ScConsolidateDlg, ClickHdl, Button*, pBtn, void ) if ( pLbConsAreas->GetEntryPos( aNewArea ) == LISTBOX_ENTRY_NOTFOUND ) pLbConsAreas->InsertEntry( aNewArea ); else - INFOBOX( STR_AREA_ALREADY_INSERTED ); + INFOBOX(GetFrameWeld(), STR_AREA_ALREADY_INSERTED); } else { - INFOBOX( STR_INVALID_TABREF ); + INFOBOX(GetFrameWeld(), STR_INVALID_TABREF); pEdDataArea->GrabFocus(); } } diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index b914ed2609a7..77eb9ba6f610 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -26,7 +26,7 @@ #include <svx/xtable.hxx> #include <sfx2/objsh.hxx> #include <unotools/useroptions.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <unotools/localedatawrapper.hxx> #include <global.hxx> @@ -151,12 +151,18 @@ IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl, Button*, void) if ( !ScDocument::ValidTabName( aName ) ) { - ScopedVclPtrInstance<InfoBox>(this, ScGlobal::GetRscString(STR_INVALIDTABNAME))->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_INVALIDTABNAME))); + xInfoBox->run(); m_pEdName->GrabFocus(); } else if ( !bIsEdit && !pDoc->ValidNewTabName( aName ) ) { - ScopedVclPtrInstance<InfoBox>(this, ScGlobal::GetRscString(STR_NEWTABNAMENOTUNIQUE))->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_NEWTABNAMENOTUNIQUE))); + xInfoBox->run(); m_pEdName->GrabFocus(); } else diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 63ea2ad325f0..e9ce36f11ac9 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -23,7 +23,7 @@ #include <sfx2/fcontnr.hxx> #include <sfx2/linkmgr.hxx> #include <svl/stritem.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <arealink.hxx> @@ -463,9 +463,11 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter, //! Link dialog must set default parent // "cannot insert rows" - ScopedVclPtrInstance<InfoBox> aBox( Application::GetDefDialogParent(), - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) ); - aBox->Execute(); + vcl::Window* pWin = Application::GetDefDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_MSSG_DOSUBTOTALS_2))); + xInfoBox->run(); } // clean up diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 50e0f5b514e6..1c413903a35a 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -19,6 +19,7 @@ #include <sfx2/app.hxx> #include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <vcl/waitobj.hxx> #include <svx/dataaccessdescriptor.hxx> #include <svx/svdpage.hxx> @@ -1670,9 +1671,11 @@ void ScDBDocFunc::UpdateImport( const OUString& rTarget, const svx::ODataAccessD const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rTarget)); if (!pData) { - ScopedVclPtrInstance<InfoBox> aInfoBox( ScDocShell::GetActiveDialogParent(), - ScGlobal::GetRscString( STR_TARGETNOTFOUND ) ); - aInfoBox->Execute(); + vcl::Window* pWin = ScDocShell::GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_TARGETNOTFOUND))); + xInfoBox->run(); return; } diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index d83fb8be69f4..ad0481942934 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -20,7 +20,7 @@ #include <vcl/errinf.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/types.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <svx/dataaccessdescriptor.hxx> #include <sfx2/viewfrm.hxx> @@ -616,8 +616,11 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, pErrStringId = STR_MSSG_IMPORTDATA_0; aErrorMessage = ScGlobal::GetRscString(pErrStringId); } - ScopedVclPtrInstance< InfoBox > aInfoBox( ScDocShell::GetActiveDialogParent(), aErrorMessage ); - aInfoBox->Execute(); + vcl::Window* pWin = ScDocShell::GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + aErrorMessage)); + xInfoBox->run(); } delete pImportDoc; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 430da19d4fa8..4ac78e1b67a0 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -25,6 +25,7 @@ #include <sfx2/linkmgr.hxx> #include <sfx2/bindings.hxx> #include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <vcl/virdev.hxx> #include <vcl/waitobj.hxx> #include <svl/PasswordHelper.hxx> @@ -394,8 +395,10 @@ bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab) aModificator.SetDocumentModified(); if ( bOverflow ) { - ScopedVclPtrInstance<InfoBox>( nullptr, - ScGlobal::GetRscString( STR_DETINVALID_OVERFLOW ) )->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_DETINVALID_OVERFLOW))); + xInfoBox->run(); } } else @@ -3911,8 +3914,11 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) { if (!bApi) { - ScopedVclPtrInstance< InfoBox > aBox( ScDocShell::GetActiveDialogParent(), ScResId( SCSTR_WRONGPASSWORD ) ); - aBox->Execute(); + vcl::Window* pWin = ScDocShell::GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScResId(SCSTR_WRONGPASSWORD))); + xInfoBox->run(); } return false; } @@ -3941,8 +3947,11 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) { if (!bApi) { - ScopedVclPtrInstance< InfoBox > aBox( ScDocShell::GetActiveDialogParent(), ScResId( SCSTR_WRONGPASSWORD ) ); - aBox->Execute(); + vcl::Window* pWin = ScDocShell::GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScResId(SCSTR_WRONGPASSWORD))); + xInfoBox->run(); } return false; } diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 8eae0400beee..f13a23113498 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -34,6 +34,7 @@ #include <unotools/misccfg.hxx> #include <vcl/virdev.hxx> #include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <docsh.hxx> #include "docshimp.hxx" @@ -1317,8 +1318,11 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) PostPaintExtras(); PostPaintGridAll(); - ScopedVclPtrInstance< InfoBox > aInfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) ); - aInfoBox->Execute(); + vcl::Window* pWin = GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_DOC_UPDATED))); + xInfoBox->run(); } return ( pThisAction != nullptr ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 8721cecc6a97..749ec29784a7 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -44,6 +44,7 @@ using namespace ::com::sun::star; #include <svx/ofaitem.hxx> #include <svl/whiter.hxx> #include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <vcl/waitobj.hxx> #include <svx/dataaccessdescriptor.hxx> #include <svx/drawitem.hxx> @@ -1293,9 +1294,11 @@ bool ScDocShell::ExecuteChangeProtectionDialog( bool bJustQueryIfProtected ) } else { - ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(), - ScResId( SCSTR_WRONGPASSWORD ) ); - aBox->Execute(); + vcl::Window* pWin = ScDocShell::GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScResId(SCSTR_WRONGPASSWORD))); + xInfoBox->run(); } } else @@ -1629,10 +1632,12 @@ void ScDocShell::PageStyleModified( const OUString& rStyleName, bool bApi ) if (bWarn && !bApi) { - ScWaitCursorOff aWaitOff( GetActiveDialogParent() ); - ScopedVclPtrInstance<InfoBox> aInfoBox(GetActiveDialogParent(), - ScGlobal::GetRscString(STR_PRINT_INVALID_AREA)); - aInfoBox->Execute(); + vcl::Window* pWin = GetActiveDialogParent(); + ScWaitCursorOff aWaitOff(pWin); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_PRINT_INVALID_AREA))); + xInfoBox->run(); } } diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index d55f0f29f9c5..8b1730af3a0d 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -23,7 +23,7 @@ #include <cassert> #include <scitems.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <vcl/waitobj.hxx> #include <sfx2/app.hxx> #include <sfx2/bindings.hxx> @@ -82,8 +82,11 @@ void ScDocShell::ErrorMessage(const char* pGlobStrId) } } - ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString(pGlobStrId)); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(pGlobStrId))); + xInfoBox->run(); + if (bFocus) pParent->GrabFocus(); } @@ -519,9 +522,11 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord ) if (bErr) { - ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(), - ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) ); - aBox->Execute(); + vcl::Window* pWin = GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_CONSOLIDATE_ERR1))); + xInfoBox->run(); return; } @@ -729,16 +734,20 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord ) } else { - ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(), - ScGlobal::GetRscString( STR_PROTECTIONERR ) ); - aBox->Execute(); + vcl::Window* pWin = GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_PROTECTIONERR))); + xInfoBox->run(); } } else { - ScopedVclPtrInstance<InfoBox> aBox(GetActiveDialogParent(), - ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) ); - aBox->Execute(); + vcl::Window* pWin = GetActiveDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_SCENARIO_NOTFOUND))); + xInfoBox->run(); } } else diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 508ea9f5b882..8e3a28280e2a 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -37,7 +37,8 @@ #include <interpre.hxx> #include <calcconfig.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <memory> #include <utility> @@ -499,8 +500,10 @@ void ScDocShell::CheckConfigOptions() if (pViewShell) { vcl::Window* pParent = pViewShell->GetFrameWin(); - ScopedVclPtrInstance< InfoBox > aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS)); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS))); + xInfoBox->run(); } // For now, this is the only option setting that could launch info diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 146c097626e1..e39abc0dc479 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -57,6 +57,7 @@ #include <tools/svlibrary.h> #include <unotools/configmgr.hxx> #include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <memory> #include <osl/endian.h> @@ -227,9 +228,11 @@ bool ScImportExport::StartPaste() ScEditableTester aTester( pDoc, aRange ); if ( !aTester.IsEditable() ) { - ScopedVclPtrInstance<InfoBox> aInfoBox( Application::GetDefDialogParent(), - ScGlobal::GetRscString( aTester.GetMessageId() ) ); - aInfoBox->Execute(); + vcl::Window* pWin = Application::GetDefDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(aTester.GetMessageId()))); + xInfoBox->run(); return false; } } diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 4eb077076728..52e671bcb33d 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -420,7 +420,10 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos, if ( bValueIgnored ) { - ScopedVclPtrInstance<InfoBox>(this, aStrCopyErr)->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + aStrCopyErr)); + xInfoBox->run(); } } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 99227a5dbd7f..f24c6b4c60a6 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -35,6 +35,7 @@ #include <sfx2/dispatch.hxx> #include <sfx2/request.hxx> #include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <svx/svxdlg.hxx> #include <sot/formats.hxx> #include <svx/postattr.hxx> @@ -2960,8 +2961,11 @@ void ScCellShell::ExecuteDataPilotDialog() if (pSrcErrorId) { // Error occurred during data creation. Launch an error and bail out. - ScopedVclPtrInstance< InfoBox > aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(pSrcErrorId)); - aBox->Execute(); + vcl::Window* pWin = pTabViewShell->GetDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(pSrcErrorId))); + xInfoBox->run(); return; } diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 15fedc1f9733..9e39ea9dfa61 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -27,9 +27,10 @@ #include <editeng/editobj.hxx> #include <editeng/editview.hxx> #include <sfx2/viewfrm.hxx> -#include <vcl/msgbox.hxx> -#include <vcl/svapp.hxx> #include <vcl/settings.hxx> +#include <vcl/svapp.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <spelldialog.hxx> #include <tabvwsh.hxx> @@ -316,7 +317,10 @@ void ScSpellingEngine::ShowFinishDialog() { vcl::Window* pParent = GetDialogParent(); ScWaitCursorOff aWaitOff( pParent ); - ScopedVclPtrInstance<InfoBox>( pParent, ScGlobal::GetRscString( STR_SPELLING_STOP_OK ) )->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(STR_SPELLING_STOP_OK))); + xInfoBox->run(); } vcl::Window* ScSpellingEngine::GetDialogParent() diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 17d562836124..4aa52f586910 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -20,7 +20,7 @@ #include <scitems.hxx> #include <editeng/eeitem.hxx> #include <vcl/timer.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <sfx2/app.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/bindings.hxx> @@ -1434,8 +1434,11 @@ void ScTabView::ErrorMessage(const char* pGlobStrId) } } - ScopedVclPtrInstance<InfoBox> aBox(pParent, ScGlobal::GetRscString(pGlobStrId)); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + ScGlobal::GetRscString(pGlobStrId))); + xInfoBox->run(); + if (bFocus) pParent->GrabFocus(); } diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index f59e4b25db5c..78bdd8eb7cc2 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -41,7 +41,7 @@ #include <svtools/transfer.hxx> #include <svl/urlbmk.hxx> #include <svl/sharedstringpool.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <avmedia/mediawindow.hxx> #include <comphelper/storagehelper.hxx> @@ -399,8 +399,12 @@ void ScViewFunc::DoThesaurus() LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) ); OUString aErr = SvtLanguageTable::GetLanguageString(eLnge); aErr += ScGlobal::GetRscString( STR_SPELLING_NO_LANG ); - ScopedVclPtrInstance< InfoBox > aBox( GetViewData().GetDialogParent(), aErr ); - aBox->Execute(); + + vcl::Window* pWin = GetViewData().GetDialogParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + aErr)); + xInfoBox->run(); } if (pThesaurusEngine->IsModified()) { |