[Libreoffice-commits] core.git: avmedia/source basctl/source basctl/uiconfig chart2/source cui/source cui/uiconfig dbaccess/source dbaccess/uiconfig desktop/source desktop/uiconfig editeng/source extensions/source filter/source filter/uiconfig fpicker/source include/avmedia include/dbaccess include/sfx2 include/svtools include/svx include/vcl reportdesign/source sc/inc scripting/source sc/source sc/uiconfig sd/inc sd/source sd/uiconfig sfx2/source sfx2/uiconfig starmath/source starmath/uiconfig svtools/source svtools/uiconfig svx/source svx/uiconfig sw/source sw/uiconfig uui/source uui/uiconfig vcl/source vcl/uiconfig vcl/unx xmlsecurity/source
Caolán McNamara
caolanm at redhat.com
Thu Feb 22 21:08:09 UTC 2018
avmedia/source/framework/mediacontrol.cxx | 3
avmedia/source/viewer/mediawindow.cxx | 14 -
basctl/source/basicide/baside2.cxx | 21 +-
basctl/source/basicide/baside3.cxx | 12 -
basctl/source/basicide/basides1.cxx | 3
basctl/source/basicide/basobj2.cxx | 17 +-
basctl/source/basicide/basobj3.cxx | 14 -
basctl/source/basicide/bastypes.cxx | 30 ++-
basctl/source/basicide/macrodlg.cxx | 20 +-
basctl/source/basicide/moduldl2.cxx | 62 +++++--
basctl/source/basicide/moduldlg.cxx | 22 +-
basctl/source/dlged/managelang.cxx | 7
basctl/source/dlged/propbrw.cxx | 4
basctl/source/inc/basobj.hxx | 7
basctl/source/inc/bastypes.hxx | 15 +
basctl/uiconfig/basicide/ui/deletelangdialog.ui | 2
chart2/source/controller/main/ChartController.cxx | 9 -
cui/source/customize/SvxMenuConfigPage.cxx | 9 -
cui/source/customize/SvxToolbarConfigPage.cxx | 18 +-
cui/source/customize/cfg.cxx | 9 -
cui/source/dialogs/about.cxx | 8
cui/source/dialogs/cuifmsearch.cxx | 6
cui/source/dialogs/cuigaldlg.cxx | 7
cui/source/dialogs/insdlg.cxx | 17 +-
cui/source/dialogs/passwdomdlg.cxx | 17 +-
cui/source/dialogs/scriptdlg.cxx | 45 +++--
cui/source/options/dbregister.cxx | 7
cui/source/options/doclinkdialog.cxx | 18 +-
cui/source/options/optchart.cxx | 10 -
cui/source/options/optcolor.cxx | 9 -
cui/source/options/optdict.cxx | 17 +-
cui/source/options/optinet2.cxx | 10 -
cui/source/options/optjava.cxx | 22 +-
cui/source/options/optlingu.cxx | 7
cui/source/options/optopencl.cxx | 7
cui/source/tabpages/tpbitmap.cxx | 35 +---
cui/source/tabpages/tpcolor.cxx | 14 -
cui/source/tabpages/tpgradnt.cxx | 27 +--
cui/source/tabpages/tphatch.cxx | 27 +--
cui/source/tabpages/tplnedef.cxx | 45 ++---
cui/source/tabpages/tplneend.cxx | 52 +++---
cui/source/tabpages/tppattern.cxx | 29 +--
cui/uiconfig/ui/querychangelineenddialog.ui | 2
cui/uiconfig/ui/querydeletebitmapdialog.ui | 2
cui/uiconfig/ui/querydeletechartcolordialog.ui | 2
cui/uiconfig/ui/querydeletecolordialog.ui | 2
cui/uiconfig/ui/querydeletedictionarydialog.ui | 2
cui/uiconfig/ui/querydeletegradientdialog.ui | 2
cui/uiconfig/ui/querydeletehatchdialog.ui | 2
cui/uiconfig/ui/querydeletelineenddialog.ui | 2
cui/uiconfig/ui/querydeletelinestyledialog.ui | 2
cui/uiconfig/ui/queryduplicatedialog.ui | 2
cui/uiconfig/ui/querynoloadedfiledialog.ui | 2
cui/uiconfig/ui/querynosavefiledialog.ui | 2
cui/uiconfig/ui/querysavelistdialog.ui | 2
cui/uiconfig/ui/queryupdategalleryfilelistdialog.ui | 2
dbaccess/source/ext/macromigration/macromigrationdialog.cxx | 7
dbaccess/source/ui/app/AppController.cxx | 3
dbaccess/source/ui/app/AppControllerDnD.cxx | 20 --
dbaccess/source/ui/app/AppControllerGen.cxx | 8
dbaccess/source/ui/browser/brwctrlr.cxx | 16 -
dbaccess/source/ui/browser/genericcontroller.cxx | 8
dbaccess/source/ui/dlg/DbAdminImpl.cxx | 4
dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 7
dbaccess/source/ui/dlg/UserAdmin.cxx | 14 +
dbaccess/source/ui/dlg/adminpages.cxx | 8
dbaccess/source/ui/dlg/directsql.cxx | 8
dbaccess/source/ui/dlg/indexdialog.cxx | 34 ++--
dbaccess/source/ui/dlg/paramdialog.cxx | 7
dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx | 13 +
dbaccess/source/ui/querydesign/QueryDesignView.cxx | 16 +
dbaccess/source/ui/relationdesign/RelationController.cxx | 7
dbaccess/source/ui/tabledesign/TableController.cxx | 21 +-
dbaccess/uiconfig/ui/deleteallrowsdialog.ui | 8
dbaccess/uiconfig/ui/designsavemodifieddialog.ui | 8
dbaccess/uiconfig/ui/saveindexdialog.ui | 8
dbaccess/uiconfig/ui/savemodifieddialog.ui | 8
dbaccess/uiconfig/ui/tabledesignsavemodifieddialog.ui | 8
desktop/source/app/app.cxx | 20 +-
desktop/source/app/lockfile2.cxx | 17 --
desktop/source/deployment/gui/dp_gui_dialog2.cxx | 60 +++----
desktop/source/deployment/gui/dp_gui_dialog2.hxx | 4
desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx | 34 ++--
desktop/source/deployment/gui/dp_gui_service.cxx | 9 -
desktop/uiconfig/ui/installforalldialog.ui | 8
editeng/source/misc/splwrap.cxx | 10 -
extensions/source/abpilot/abspilot.cxx | 13 +
extensions/source/abpilot/admininvokationimpl.cxx | 5
extensions/source/abpilot/datasourcehandling.cxx | 3
extensions/source/abpilot/datasourcehandling.hxx | 4
extensions/source/abpilot/typeselectionpage.cxx | 9 -
extensions/source/dbpilots/commonpagesdbp.cxx | 4
extensions/source/dbpilots/controlwizard.cxx | 4
extensions/source/dbpilots/controlwizard.hxx | 3
extensions/source/scanner/sanedlg.cxx | 26 ++-
extensions/source/update/ui/updatecheckui.cxx | 7
filter/source/pdf/impdialog.cxx | 8
filter/source/pdf/impdialog.hxx | 2
filter/source/xsltdialog/xmlfiltertabdialog.cxx | 8
filter/uiconfig/ui/warnpdfdialog.ui | 1
fpicker/source/office/RemoteFilesDialog.cxx | 11 -
fpicker/source/office/iodlg.cxx | 16 +
include/avmedia/mediawindow.hxx | 3
include/dbaccess/genericcontroller.hxx | 2
include/sfx2/QuerySaveDocument.hxx | 4
include/sfx2/newstyle.hxx | 3
include/svtools/fileview.hxx | 16 +
include/svx/graphichelper.hxx | 3
include/svx/hdft.hxx | 27 ++-
include/svx/linkwarn.hxx | 15 -
include/vcl/edit.hxx | 5
include/vcl/fixedhyper.hxx | 2
include/vcl/layout.hxx | 44 -----
include/vcl/messagedialog.hxx | 63 +++++++
include/vcl/stdtext.hxx | 4
include/vcl/weld.hxx | 3
reportdesign/source/ui/report/propbrw.cxx | 3
sc/inc/documentlinkmgr.hxx | 4
sc/inc/validat.hxx | 5
sc/source/core/data/documen8.cxx | 7
sc/source/core/data/validat.cxx | 22 +-
sc/source/ui/dbgui/dbnamdlg.cxx | 16 +
sc/source/ui/dbgui/filtdlg.cxx | 7
sc/source/ui/dbgui/sfiltdlg.cxx | 18 +-
sc/source/ui/dbgui/tpsort.cxx | 6
sc/source/ui/docshell/docsh4.cxx | 5
sc/source/ui/docshell/documentlinkmgr.cxx | 11 -
sc/source/ui/drawfunc/fuins1.cxx | 6
sc/source/ui/drawfunc/graphsh.cxx | 2
sc/source/ui/miscdlgs/crnrdlg.cxx | 14 +
sc/source/ui/miscdlgs/filldlg.cxx | 7
sc/source/ui/miscdlgs/instbdlg.cxx | 5
sc/source/ui/miscdlgs/optsolver.cxx | 6
sc/source/ui/miscdlgs/scuiautofmt.cxx | 21 +-
sc/source/ui/miscdlgs/solvrdlg.cxx | 16 +
sc/source/ui/miscdlgs/tabopdlg.cxx | 6
sc/source/ui/optdlg/tpcalc.cxx | 7
sc/source/ui/optdlg/tpusrlst.cxx | 9 -
sc/source/ui/pagedlg/areasdlg.cxx | 14 +
sc/source/ui/view/cellsh3.cxx | 17 +-
sc/source/ui/view/dbfunc.cxx | 9 -
sc/source/ui/view/tabvwshf.cxx | 8
sc/uiconfig/scalc/ui/queryrunstreamscriptdialog.ui | 2
scripting/source/dlgprov/dlgevtatt.cxx | 7
sd/inc/Outliner.hxx | 7
sd/source/core/drawdoc3.cxx | 7
sd/source/filter/grf/sdgrffilter.cxx | 7
sd/source/filter/html/pubdlg.cxx | 8
sd/source/ui/app/sdmod1.cxx | 6
sd/source/ui/dlg/brkdlg.cxx | 7
sd/source/ui/dlg/sdtreelb.cxx | 7
sd/source/ui/func/fuinsert.cxx | 6
sd/source/ui/func/fuinsfil.cxx | 16 +
sd/source/ui/inc/ViewShell.hxx | 6
sd/source/ui/view/Outliner.cxx | 17 +-
sd/source/ui/view/drviews2.cxx | 6
sd/source/ui/view/drviews6.cxx | 6
sd/source/ui/view/viewshel.cxx | 5
sd/uiconfig/sdraw/ui/queryunlinkimagedialog.ui | 2
sfx2/source/appl/appopen.cxx | 10 -
sfx2/source/appl/appserv.cxx | 7
sfx2/source/appl/lnkbase2.cxx | 5
sfx2/source/appl/newhelp.cxx | 16 +
sfx2/source/appl/openuriexternally.cxx | 19 +-
sfx2/source/appl/sfxhelp.cxx | 32 ---
sfx2/source/control/templatelocalview.cxx | 28 +--
sfx2/source/control/templatesearchview.cxx | 14 -
sfx2/source/dialog/dinfdlg.cxx | 6
sfx2/source/dialog/filedlghelper.cxx | 9 -
sfx2/source/dialog/mailmodel.cxx | 7
sfx2/source/dialog/mgetempl.cxx | 20 +-
sfx2/source/dialog/newstyle.cxx | 14 +
sfx2/source/dialog/passwd.cxx | 13 -
sfx2/source/dialog/templdlg.cxx | 12 -
sfx2/source/doc/QuerySaveDocument.cxx | 11 -
sfx2/source/doc/guisaveas.cxx | 15 -
sfx2/source/doc/objmisc.cxx | 6
sfx2/source/doc/objserv.cxx | 46 +++--
sfx2/source/doc/objxtor.cxx | 3
sfx2/source/doc/saveastemplatedlg.cxx | 14 -
sfx2/source/doc/templatedlg.cxx | 45 +++--
sfx2/source/inc/alienwarn.hxx | 2
sfx2/source/inc/templdgi.hxx | 6
sfx2/source/view/classificationhelper.cxx | 16 +
sfx2/source/view/viewfrm.cxx | 56 ++----
sfx2/source/view/viewprn.cxx | 37 +++-
sfx2/source/view/viewsh.cxx | 24 +-
sfx2/uiconfig/ui/alienwarndialog.ui | 8
sfx2/uiconfig/ui/editdocumentdialog.ui | 8
sfx2/uiconfig/ui/errorfindemaildialog.ui | 2
sfx2/uiconfig/ui/helpmanual.ui | 1
sfx2/uiconfig/ui/querysavedialog.ui | 10 -
starmath/source/dialog.cxx | 26 ++-
starmath/uiconfig/smath/ui/savedefaultsdialog.ui | 2
svtools/source/contnr/fileview.cxx | 28 ---
svtools/source/dialogs/addresstemplate.cxx | 7
svtools/source/java/javainteractionhandler.cxx | 48 +++--
svtools/uiconfig/ui/javadisableddialog.ui | 10 -
svtools/uiconfig/ui/querydeletedialog.ui | 8
svx/source/core/graphichelper.cxx | 10 -
svx/source/dialog/SafeModeDialog.cxx | 8
svx/source/dialog/_contdlg.cxx | 25 +--
svx/source/dialog/docrecovery.cxx | 11 -
svx/source/dialog/hdft.cxx | 10 -
svx/source/dialog/imapdlg.cxx | 22 +-
svx/source/dialog/linkwarn.cxx | 31 +--
svx/source/dialog/passwd.cxx | 14 +
svx/source/form/datanavi.cxx | 98 ++++++------
svx/source/form/fmPropBrw.cxx | 4
svx/source/form/fmshell.cxx | 9 -
svx/source/form/fmshimp.cxx | 15 +
svx/source/gallery2/galbrws1.cxx | 6
svx/source/gallery2/galbrws2.cxx | 11 -
svx/source/inc/datanavi.hxx | 11 -
svx/uiconfig/ui/deletefooterdialog.ui | 4
svx/uiconfig/ui/deleteheaderdialog.ui | 4
svx/uiconfig/ui/formlinkwarndialog.ui | 8
svx/uiconfig/ui/linkwarndialog.ui | 8
svx/uiconfig/ui/querydeletecontourdialog.ui | 4
svx/uiconfig/ui/querydeleteobjectdialog.ui | 7
svx/uiconfig/ui/querydeletethemedialog.ui | 7
svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui | 4
svx/uiconfig/ui/querynewcontourdialog.ui | 2
svx/uiconfig/ui/querysavecontchangesdialog.ui | 9 -
svx/uiconfig/ui/querysaveimagemapchangesdialog.ui | 4
svx/uiconfig/ui/queryunlinkgraphicsdialog.ui | 4
svx/uiconfig/ui/savemodifieddialog.ui | 8
sw/source/core/crsr/viscrs.cxx | 8
sw/source/core/doc/DocumentRedlineManager.cxx | 8
sw/source/ui/config/optcomp.cxx | 8
sw/source/ui/dbui/mmaddressblockpage.cxx | 6
sw/source/ui/dbui/mmoutputtypepage.cxx | 1
sw/source/ui/dialog/swmessdialog.cxx | 2
sw/source/ui/dialog/uiregionsw.cxx | 33 +++-
sw/source/ui/envelp/labfmt.cxx | 17 +-
sw/source/ui/index/swuiidxmrk.cxx | 8
sw/source/ui/misc/glossary.cxx | 30 ++-
sw/source/ui/misc/srtdlg.cxx | 9 -
sw/source/ui/table/tabledlg.cxx | 7
sw/source/uibase/app/docsh2.cxx | 10 -
sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx | 15 +
sw/source/uibase/dochdl/gloshdl.cxx | 7
sw/source/uibase/dochdl/swdtflvr.cxx | 45 ++++-
sw/source/uibase/docvw/SidebarTxtControl.cxx | 7
sw/source/uibase/docvw/edtwin.cxx | 16 +
sw/source/uibase/lingu/olmenu.cxx | 9 -
sw/source/uibase/shells/grfsh.cxx | 2
sw/source/uibase/shells/grfshex.cxx | 3
sw/source/uibase/shells/tabsh.cxx | 10 -
sw/source/uibase/uiview/srcview.cxx | 24 +-
sw/source/uibase/uiview/uivwimp.cxx | 7
sw/source/uibase/uiview/view2.cxx | 44 +++--
sw/source/uibase/uiview/viewling.cxx | 7
sw/source/uibase/uiview/viewprt.cxx | 16 +
sw/source/uibase/wrtsh/wrtsh1.cxx | 6
sw/uiconfig/swriter/ui/asksearchdialog.ui | 10 -
sw/uiconfig/swriter/ui/cannotsavelabeldialog.ui | 2
sw/uiconfig/swriter/ui/datasourcesunavailabledialog.ui | 4
sw/uiconfig/swriter/ui/infonotfounddialog.ui | 2
sw/uiconfig/swriter/ui/inforeadonlydialog.ui | 4
sw/uiconfig/swriter/ui/printmergedialog.ui | 8
sw/uiconfig/swriter/ui/querycontinuebegindialog.ui | 2
sw/uiconfig/swriter/ui/querycontinueenddialog.ui | 2
sw/uiconfig/swriter/ui/querydefaultcompatdialog.ui | 4
sw/uiconfig/swriter/ui/queryrotateintostandarddialog.ui | 7
sw/uiconfig/swriter/ui/querysavelabeldialog.ui | 2
sw/uiconfig/swriter/ui/queryshowchangesdialog.ui | 4
sw/uiconfig/swriter/ui/saveashtmldialog.ui | 4
sw/uiconfig/swriter/ui/warndatasourcedialog.ui | 8
sw/uiconfig/swriter/ui/warnemaildialog.ui | 2
uui/source/masterpasscrtdlg.cxx | 9 -
uui/source/masterpassworddlg.cxx | 8
uui/source/nameclashdlg.cxx | 9 -
uui/source/passworddlg.cxx | 14 +
uui/source/sslwarndlg.hxx | 2
uui/source/unknownauthdlg.hxx | 2
uui/uiconfig/ui/sslwarndialog.ui | 4
uui/uiconfig/ui/unknownauthdialog.ui | 6
vcl/source/app/salvtables.cxx | 8
vcl/source/app/stdtext.cxx | 9 -
vcl/source/control/edit.cxx | 11 -
vcl/source/control/fixedhyper.cxx | 12 -
vcl/source/edit/textview.cxx | 3
vcl/source/gdi/print3.cxx | 18 +-
vcl/source/window/builder.cxx | 4
vcl/source/window/dialog.cxx | 1
vcl/source/window/layout.cxx | 1
vcl/uiconfig/ui/errornocontentdialog.ui | 4
vcl/uiconfig/ui/errornoprinterdialog.ui | 7
vcl/unx/gtk3/gtk3gtkinst.cxx | 21 ++
xmlsecurity/source/component/documentdigitalsignatures.cxx | 8
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 20 +-
292 files changed, 2015 insertions(+), 1461 deletions(-)
New commits:
commit 6a4c464b49dbfa2801818ead1b50bc9580824d00
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 19 16:33:35 2018 +0000
weld native message dialogs
just the straight-forward MessageDialog cases first
a) remove border_width from message dialog .ui so as to take
the default border width
b) retain 12 as default message dialog border for vcl widget case
c) remove layour_style from message dialog button boxes so as to
take the default mode (a no-op for vcl widget case)
d) use gtk response ids (vcl builder will converts to vcl ones)
Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154
Reviewed-on: https://gerrit.libreoffice.org/50143
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 59f6c3cce90e..23cf4944e11c 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -28,6 +28,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
#include <unotools/syslocale.hxx>
#include <sfx2/viewfrm.hxx>
#include <math.h>
@@ -299,7 +300,7 @@ IMPL_LINK( MediaControl, implSelectHdl, ToolBox*, p, void )
if (MediaWindow::executeMediaURLDialog(this, aURL, nullptr))
{
if( !MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true ) )
- MediaWindow::executeFormatErrorBox( this );
+ MediaWindow::executeFormatErrorBox(GetFrameWeld());
else
{
aExecItem.setURL( aURL, "", ""/*TODO?*/ );
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index df416bb96db7..4d8ad4edec5c 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -23,7 +23,8 @@
#include <bitmaps.hlst>
#include <strings.hrc>
#include <tools/urlobj.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/filedlghelper.hxx>
#include <comphelper/processfactory.hxx>
@@ -295,16 +296,13 @@ bool MediaWindow::executeMediaURLDialog(const vcl::Window* pParent, OUString& rU
return !rURL.isEmpty();
}
-
-void MediaWindow::executeFormatErrorBox( vcl::Window* pParent )
+void MediaWindow::executeFormatErrorBox(weld::Widget* pParent)
{
- ScopedVclPtrInstance< MessageDialog > aErrBox( pParent, AvmResId( AVMEDIA_STR_ERR_URL ) );
-
- aErrBox->Execute();
- aErrBox.disposeAndClear();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent,
+ VclMessageType::Warning, VclButtonsType::Ok, AvmResId(AVMEDIA_STR_ERR_URL)));
+ xBox->run();
}
-
bool MediaWindow::isMediaURL( const OUString& rURL, const OUString& rReferer, bool bDeep, Size* pPreferredSizePixel )
{
const INetURLObject aURL( rURL );
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 7edd29b9bbb7..23bc4f2483ca 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -48,8 +48,9 @@
#include <svl/visitem.hxx>
#include <svl/whiter.hxx>
#include <svx/svxids.hrc>
-#include <vcl/xtextedt.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
+#include <vcl/xtextedt.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <cassert>
@@ -301,7 +302,9 @@ void ModulWindow::BasicExecute()
{
if ( !aDocument.allowMacros() )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_CANNOTRUNMACRO), VclMessageType::Warning)->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_CANNOTRUNMACRO)));
+ xBox->run();
return;
}
}
@@ -431,7 +434,11 @@ void ModulWindow::LoadBasic()
ErrorHandler::HandleError( nError );
}
else
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_COULDNTREAD))->Execute();
+ {
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_COULDNTREAD)));
+ xBox->run();
+ }
}
}
@@ -472,7 +479,11 @@ void ModulWindow::SaveBasicSource()
ErrorHandler::HandleError( nError );
}
else
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_COULDNTWRITE))->Execute();
+ {
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_COULDNTWRITE)));
+ xErrorBox->run();
+ }
}
}
@@ -989,7 +1000,7 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
break;
case SID_BASICIDE_DELETECURRENT:
{
- if (QueryDelModule(m_aName, this))
+ if (QueryDelModule(m_aName, GetFrameWeld()))
if (m_aDocument.removeModule(m_aLibName, m_aName))
MarkDocumentModified(m_aDocument);
}
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 5b705b15f2c4..fa23eca1a822 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -49,7 +49,7 @@
#include <svx/svxids.hrc>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
#include <xmlscript/xmldlg_imexp.hxx>
@@ -534,7 +534,7 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq )
break;
case SID_BASICIDE_DELETECURRENT:
- if (QueryDelDialog(m_aName, this))
+ if (QueryDelDialog(m_aName, GetFrameWeld()))
{
if (RemoveDialog(m_aDocument, m_aLibName, m_aName))
{
@@ -571,7 +571,7 @@ Reference< container::XNameContainer > const & DialogWindow::GetDialog() const
bool DialogWindow::RenameDialog( const OUString& rNewName )
{
- if ( !basctl::RenameDialog( this, GetDocument(), GetLibName(), GetName(), rNewName ) )
+ if (!basctl::RenameDialog(GetFrameWeld(), GetDocument(), GetLibName(), GetName(), rNewName))
return false;
if (SfxBindings* pBindings = GetBindingsPtr())
@@ -739,7 +739,11 @@ void DialogWindow::SaveDialog()
}
}
else
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_COULDNTWRITE))->Execute();
+ {
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_COULDNTWRITE)));
+ xBox->run();
+ }
}
}
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index b78f9138bf32..32969aaf594a 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -49,6 +49,7 @@
#include <svl/whiter.hxx>
#include <vcl/xtextedt.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
namespace basctl
{
@@ -358,7 +359,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
OUString aLibName = pModWin->GetLibName();
ScriptDocument aDocument( pWin->GetDocument() );
- if (RenameModule(pModWin, aDocument, aLibName, aOldName, aNewName))
+ if (RenameModule(pModWin->GetFrameWeld(), aDocument, aLibName, aOldName, aNewName))
{
bRenameOk = true;
// Because we listen for container events for script
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 72c6b250853a..1b64d85aac28 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -30,6 +30,7 @@
#include <framework/documentundoguard.hxx>
#include <tools/diagnose_ex.h>
#include <unotools/moduleoptions.hxx>
+#include <vcl/weld.hxx>
#include <memory>
#include <vector>
@@ -137,7 +138,7 @@ Sequence< OUString > GetMergedLibraryNames( const Reference< script::XLibraryCon
}
bool RenameModule (
- vcl::Window* pErrorParent,
+ weld::Widget* pErrorParent,
const ScriptDocument& rDocument,
const OUString& rLibName,
const OUString& rOldName,
@@ -152,16 +153,18 @@ bool RenameModule (
if ( rDocument.hasModule( rLibName, rNewName ) )
{
- ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDEResId(RID_STR_SBXNAMEALLREADYUSED2));
- aError->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(pErrorParent,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_SBXNAMEALLREADYUSED2)));
+ xError->run();
return false;
}
// #i74440
if ( rNewName.isEmpty() )
{
- ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDEResId(RID_STR_BADSBXNAME));
- aError->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(pErrorParent,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xError->run();
return false;
}
@@ -325,7 +328,9 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument,
{
// error
bError = true;
- ScopedVclPtrInstance<MessageDialog>(nullptr, IDEResId(RID_STR_ERRORCHOOSEMACRO))->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_ERRORCHOOSEMACRO)));
+ xError->run();
}
}
}
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 7043bba6110a..77b0e8829f1d 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <basic/basmgr.hxx>
#include <basic/sbmeth.hxx>
#include <unotools/moduleoptions.hxx>
@@ -128,7 +128,7 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
}
bool RenameDialog (
- vcl::Window* pErrorParent,
+ weld::Widget* pErrorParent,
ScriptDocument const& rDocument,
OUString const& rLibName,
OUString const& rOldName,
@@ -143,16 +143,18 @@ bool RenameDialog (
if ( rDocument.hasDialog( rLibName, rNewName ) )
{
- ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDEResId(RID_STR_SBXNAMEALLREADYUSED2));
- aError->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(pErrorParent,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_SBXNAMEALLREADYUSED2)));
+ xError->run();
return false;
}
// #i74440
if ( rNewName.isEmpty() )
{
- ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDEResId(RID_STR_BADSBXNAME));
- aError->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(pErrorParent,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xError->run();
return false;
}
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 5e6cf568f1dd..f8332d8a4243 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -32,6 +32,7 @@
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
#include <svl/srchdefs.hxx>
+#include <vcl/weld.hxx>
namespace basctl
{
@@ -477,7 +478,11 @@ TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
bool const bValid = IsValidSbxName(GetEditText());
if ( !bValid )
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ {
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xError->run();
+ }
return bValid ? TABBAR_RENAMING_YES : TABBAR_RENAMING_NO;
}
@@ -706,37 +711,38 @@ LibInfo::Item::Item (
LibInfo::Item::~Item ()
{ }
-bool QueryDel(const OUString& rName, const OUString &rStr, vcl::Window* pParent)
+bool QueryDel(const OUString& rName, const OUString &rStr, weld::Widget* pParent)
{
OUStringBuffer aNameBuf( rName );
aNameBuf.append('\'');
aNameBuf.insert(0, '\'');
OUString aQuery = rStr.replaceAll("XX", aNameBuf.makeStringAndClear());
- ScopedVclPtrInstance< MessageDialog > aQueryBox(pParent, aQuery, VclMessageType::Question, VclButtonsType::YesNo);
- return ( aQueryBox->Execute() == RET_YES );
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pParent,
+ VclMessageType::Question, VclButtonsType::YesNo, aQuery));
+ return (xQueryBox->run() == RET_YES);
}
-bool QueryDelMacro( const OUString& rName, vcl::Window* pParent )
+bool QueryDelMacro( const OUString& rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYDELMACRO ), pParent );
}
-bool QueryReplaceMacro( const OUString& rName, vcl::Window* pParent )
+bool QueryReplaceMacro( const OUString& rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYREPLACEMACRO ), pParent );
}
-bool QueryDelDialog( const OUString& rName, vcl::Window* pParent )
+bool QueryDelDialog( const OUString& rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYDELDIALOG ), pParent );
}
-bool QueryDelLib( const OUString& rName, bool bRef, vcl::Window* pParent )
+bool QueryDelLib( const OUString& rName, bool bRef, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( bRef ? RID_STR_QUERYDELLIBREF : RID_STR_QUERYDELLIB ), pParent );
}
-bool QueryDelModule( const OUString& rName, vcl::Window* pParent )
+bool QueryDelModule( const OUString& rName, weld::Widget* pParent )
{
return QueryDel( rName, IDEResId( RID_STR_QUERYDELMODULE ), pParent );
}
@@ -777,8 +783,10 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
if ( !bOK )
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(Application::GetDefDialogParent(), IDEResId(RID_STR_WRONGPASSWORD));
- aErrorBox->Execute();
+ vcl::Window* pParent = Application::GetDefDialogParent();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_WRONGPASSWORD)));
+ xErrorBox->run();
}
}
}
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index 9bb61bc870f0..fda0bd567051 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -33,7 +33,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/minfitem.hxx>
#include <sfx2/request.hxx>
-
+#include <vcl/weld.hxx>
#include <map>
@@ -280,7 +280,7 @@ void MacroChooser::DeleteMacro()
{
SbMethod* pMethod = GetMacro();
DBG_ASSERT( pMethod, "DeleteMacro: No Macro !" );
- if ( pMethod && QueryDelMacro( pMethod->GetName(), this ) )
+ if (pMethod && QueryDelMacro(pMethod->GetName(), GetFrameWeld()))
{
if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES );
@@ -465,7 +465,7 @@ IMPL_LINK_NOARG(MacroChooser, MacroDoubleClickHdl, SvTreeListBox*, bool)
if (nMode == Recording)
{
SbMethod* pMethod = GetMacro();
- if ( pMethod && !QueryReplaceMacro( pMethod->GetName(), this ) )
+ if (pMethod && !QueryReplaceMacro(pMethod->GetName(), GetFrameWeld()))
return false;
}
@@ -612,7 +612,9 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton, void )
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
if ( aDocument.isDocument() && !aDocument.allowMacros() )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_CANNOTRUNMACRO), VclMessageType::Warning)->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_CANNOTRUNMACRO)));
+ xError->run();
return;
}
}
@@ -621,14 +623,16 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton, void )
{
if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xError->run();
m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) );
m_pMacroNameEdit->GrabFocus();
return;
}
SbMethod* pMethod = GetMacro();
- if ( pMethod && !QueryReplaceMacro( pMethod->GetName(), this ) )
+ if (pMethod && !QueryReplaceMacro(pMethod->GetName(), GetFrameWeld()))
return;
}
@@ -694,7 +698,9 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton, void )
{
if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xError->run();
m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().getLength() ) );
m_pMacroNameEdit->GrabFocus();
return;
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index d563ddcb7cf8..d2fcf703cc2f 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -37,6 +37,7 @@
#include <svtools/svlbitm.hxx>
#include <svtools/treelistentry.hxx>
#include <vcl/builderfactory.hxx>
+#include <vcl/weld.hxx>
#include <com/sun/star/io/Pipe.hpp>
#include <com/sun/star/ui/dialogs/FilePicker.hpp>
@@ -265,7 +266,9 @@ bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& )
OUString aLibName = GetEntryText( pEntry, 0 );
if ( aLibName.equalsIgnoreAsciiCase( "Standard" ) )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_CANNOTCHANGENAMESTDLIB))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_CANNOTCHANGENAMESTDLIB)));
+ xErrorBox->run();
return false;
}
@@ -275,7 +278,9 @@ bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& )
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) ||
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_LIBISREADONLY))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_LIBISREADONLY)));
+ xErrorBox->run();
return false;
}
@@ -325,7 +330,9 @@ bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewName )
}
catch (const container::ElementExistException& )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_SBXNAMEALLREADYUSED))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_SBXNAMEALLREADYUSED)));
+ xErrorBox->run();
return false;
}
catch (const container::NoSuchElementException& )
@@ -337,10 +344,11 @@ bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewName )
if ( !bValid )
{
- if ( rNewName.getLength() > 30 )
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_LIBNAMETOLONG))->Execute();
- else
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ OUString sWarning(rNewName.getLength() > 30 ? IDEResId(RID_STR_LIBNAMETOLONG) : IDEResId(RID_STR_BADSBXNAME));
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, sWarning));
+ xErrorBox->run();
+
}
return bValid;
@@ -353,7 +361,9 @@ IMPL_LINK_NOARG(NewObjectDialog, OkButtonHandler, Button*, void)
EndDialog(1);
else
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xErrorBox->run();
m_pEdit->GrabFocus();
}
}
@@ -840,7 +850,11 @@ void LibPage::InsertLib()
}
if ( !pLibDlg )
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_NOLIBINSTORAGE), VclMessageType::Info)->Execute();
+ {
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_NOLIBINSTORAGE)));
+ xErrorBox->run();
+ }
else
{
bool bChanges = false;
@@ -877,7 +891,9 @@ void LibPage::InsertLib()
// check, if the library is the Standard library
if ( aLibName == "Standard" )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_REPLACESTDLIB))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_REPLACESTDLIB)));
+ xErrorBox->run();
continue;
}
@@ -887,7 +903,9 @@ void LibPage::InsertLib()
{
OUString aErrStr( IDEResId(RID_STR_REPLACELIB) );
aErrStr = aErrStr.replaceAll("XX", aLibName) + "\n" + IDEResId(RID_STR_LIBISREADONLY);
- ScopedVclPtrInstance<MessageDialog>(this, aErrStr)->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aErrStr));
+ xErrorBox->run();
continue;
}
@@ -902,7 +920,9 @@ void LibPage::InsertLib()
else
aErrStr = IDEResId(RID_STR_IMPORTNOTPOSSIBLE);
aErrStr = aErrStr.replaceAll("XX", aLibName) + "\n" +IDEResId(RID_STR_SBXNAMEALLREADYUSED);
- ScopedVclPtrInstance<MessageDialog>(this, aErrStr)->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aErrStr));
+ xErrorBox->run();
continue;
}
}
@@ -921,7 +941,9 @@ void LibPage::InsertLib()
{
OUString aErrStr( IDEResId(RID_STR_NOIMPORT) );
aErrStr = aErrStr.replaceAll("XX", aLibName);
- ScopedVclPtrInstance<MessageDialog>(this, aErrStr)->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aErrStr));
+ xErrorBox->run();
continue;
}
}
@@ -1337,7 +1359,7 @@ void LibPage::DeleteCurrent()
bIsLibraryLink = true;
}
- if ( QueryDelLib( aLibName, bIsLibraryLink, this ) )
+ if (QueryDelLib(aLibName, bIsLibraryLink, GetFrameWeld()))
{
// inform BasicIDE
SfxUnoAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, Any( m_aCurDocument.getDocumentOrNull() ) );
@@ -1488,15 +1510,21 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
if ( aLibName.getLength() > 30 )
{
- ScopedVclPtrInstance<MessageDialog>(pWin, IDEResId(RID_STR_LIBNAMETOLONG))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_LIBNAMETOLONG)));
+ xErrorBox->run();
}
else if ( !IsValidSbxName( aLibName ) )
{
- ScopedVclPtrInstance<MessageDialog>(pWin, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xErrorBox->run();
}
else if ( rDocument.hasLibrary( E_SCRIPTS, aLibName ) || rDocument.hasLibrary( E_DIALOGS, aLibName ) )
{
- ScopedVclPtrInstance<MessageDialog>(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_SBXNAMEALLREADYUSED2)));
+ xErrorBox->run();
}
else
{
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 421a10edc9e9..d0abbe481951 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -35,6 +35,7 @@
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
#include <vcl/builderfactory.hxx>
+#include <vcl/weld.hxx>
#include <tools/diagnose_ex.h>
#include <xmlscript/xmldlg_imexp.hxx>
#include <svtools/treelistentry.hxx>
@@ -86,7 +87,9 @@ bool ExtTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewT
{
if ( !IsValidSbxName(rNewText) )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_BADSBXNAME))->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
+ xError->run();
return false;
}
@@ -104,8 +107,8 @@ bool ExtTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewT
EntryType eType = aDesc.GetType();
bool bSuccess = eType == OBJ_TYPE_MODULE ?
- RenameModule(this, aDocument, aLibName, aCurText, rNewText) :
- RenameDialog(this, aDocument, aLibName, aCurText, rNewText);
+ RenameModule(GetFrameWeld(), aDocument, aLibName, aCurText, rNewText) :
+ RenameDialog(GetFrameWeld(), aDocument, aLibName, aCurText, rNewText);
if ( !bSuccess )
return false;
@@ -824,7 +827,9 @@ void ObjectPage::NewDialog()
if ( aDocument.hasDialog( aLibName, aDlgName ) )
{
- ScopedVclPtrInstance<MessageDialog>(this, IDEResId(RID_STR_SBXNAMEALLREADYUSED2))->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_SBXNAMEALLREADYUSED2)));
+ xError->run();
}
else
{
@@ -882,8 +887,8 @@ void ObjectPage::DeleteCurrent()
OUString aName( aDesc.GetName() );
EntryType eType = aDesc.GetType();
- if ( ( eType == OBJ_TYPE_MODULE && QueryDelModule( aName, this ) ) ||
- ( eType == OBJ_TYPE_DIALOG && QueryDelDialog( aName, this ) ) )
+ if ( ( eType == OBJ_TYPE_MODULE && QueryDelModule(aName, GetFrameWeld()) ) ||
+ ( eType == OBJ_TYPE_DIALOG && QueryDelDialog(aName, GetFrameWeld()) ) )
{
m_pBasicBox->GetModel()->Remove( pCurEntry );
if ( m_pBasicBox->GetCurEntry() ) // OV-Bug ?
@@ -1038,7 +1043,9 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
}
catch (const container::ElementExistException& )
{
- ScopedVclPtrInstance<MessageDialog>(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2))->Execute();
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_SBXNAMEALLREADYUSED2)));
+ xError->run();
}
catch (const container::NoSuchElementException& )
{
@@ -1048,7 +1055,6 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
return pModule;
}
-
} // namespace basctl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index 5fff9ceff408..dd6899492c81 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -35,7 +35,7 @@
#include <svx/langbox.hxx>
#include <vcl/unohelp.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/settings.hxx>
namespace basctl
@@ -162,8 +162,9 @@ IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl, Button*, void)
IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl, Button*, void)
{
- ScopedVclPtrInstance< MessageDialog > aQBox(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelangdialog.ui");
- if ( aQBox->Execute() == RET_OK )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/BasicIDE/ui/deletelangdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("DeleteLangDialog"));
+ if (xQBox->run() == RET_OK)
{
sal_Int32 nCount = m_pLanguageLB->GetSelectedEntryCount();
sal_Int32 nPos = m_pLanguageLB->GetSelectedEntryPos();
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index cbf3e47b70ed..411cd288d899 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -39,6 +39,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/stdtext.hxx>
+#include <vcl/weld.hxx>
#include <memory>
@@ -135,7 +136,8 @@ void PropBrw::ImplReCreateController()
m_xBrowserController.set( xFactory->createInstanceWithContext( s_sControllerServiceName, xInspectorContext ), UNO_QUERY );
if ( !m_xBrowserController.is() )
{
- ShowServiceNotAvailableError( GetParent(), s_sControllerServiceName, true );
+ vcl::Window* pWin = GetParent();
+ ShowServiceNotAvailableError(pWin ? pWin->GetFrameWeld() : nullptr, s_sControllerServiceName, true);
}
else
{
diff --git a/basctl/source/inc/basobj.hxx b/basctl/source/inc/basobj.hxx
index 91862bff751f..7b84c2f02f27 100644
--- a/basctl/source/inc/basobj.hxx
+++ b/basctl/source/inc/basobj.hxx
@@ -30,7 +30,7 @@ class StarBASIC;
class SfxUInt16Item;
class SfxBindings;
class SfxDispatcher;
-namespace vcl { class Window; }
+namespace weld { class Widget; }
namespace basctl
{
@@ -68,7 +68,7 @@ namespace basctl
Will show an error message when renaming fails because the new name is already used.
*/
bool RenameModule(
- vcl::Window* pErrorParent, const ScriptDocument& rDocument,
+ weld::Widget* pErrorParent, const ScriptDocument& rDocument,
const OUString& rLibName, const OUString& rOldName, const OUString& rNewName );
// new methods for macros
@@ -98,8 +98,7 @@ namespace basctl
@throws css::container::NoSuchElementException
@throws css::uno::RuntimeException
*/
- bool RenameDialog(
- vcl::Window* pErrorParent, const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rOldName, const OUString& rNewName );
+ bool RenameDialog(weld::Widget* pErrorParent, const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rOldName, const OUString& rNewName);
bool RemoveDialog( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName );
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index 429f4137a971..454601db0bed 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -41,6 +41,11 @@ namespace svl
class IUndoManager;
}
+namespace weld
+{
+ class Widget;
+}
+
namespace basctl
{
@@ -290,11 +295,11 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines
OUString CreateMgrAndLibStr( const OUString& rMgrName, const OUString& rLibName );
sal_uLong CalcLineCount( SvStream& rStream );
-bool QueryReplaceMacro( const OUString& rName, vcl::Window* pParent );
-bool QueryDelMacro( const OUString& rName, vcl::Window* pParent );
-bool QueryDelDialog( const OUString& rName, vcl::Window* pParent );
-bool QueryDelModule( const OUString& rName, vcl::Window* pParent );
-bool QueryDelLib( const OUString& rName, bool bRef, vcl::Window* pParent );
+bool QueryReplaceMacro( const OUString& rName, weld::Widget* pParent );
+bool QueryDelMacro( const OUString& rName, weld::Widget* pParent );
+bool QueryDelDialog( const OUString& rName, weld::Widget* pParent );
+bool QueryDelModule( const OUString& rName, weld::Widget* pParent );
+bool QueryDelLib( const OUString& rName, bool bRef, weld::Widget* pParent );
bool QueryPassword( const css::uno::Reference< css::script::XLibraryContainer >& xLibContainer, const OUString& rLibName, OUString& rPassword, bool bRepeat = false, bool bNewTitle = false );
class ModuleInfoHelper
diff --git a/basctl/uiconfig/basicide/ui/deletelangdialog.ui b/basctl/uiconfig/basicide/ui/deletelangdialog.ui
index 7b91b3014903..20d77dbd6720 100644
--- a/basctl/uiconfig/basicide/ui/deletelangdialog.ui
+++ b/basctl/uiconfig/basicide/ui/deletelangdialog.ui
@@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.0"/>
<object class="GtkMessageDialog" id="DeleteLangDialog">
<property name="can_focus">False</property>
- <property name="border_width">6</property>
<property name="title" translatable="yes" context="deletelangdialog|DeleteLangDialog">Delete Language Resources</property>
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
@@ -21,7 +20,6 @@
<child internal-child="action_area">
<object class="GtkButtonBox" id="messagedialog-action_area">
<property name="can_focus">False</property>
- <property name="layout_style">end</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index c992e03070fe..bb2e6c71eabb 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -73,7 +73,7 @@
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <osl/mutex.hxx>
#include <sfx2/sidebar/SidebarController.hxx>
@@ -1340,10 +1340,11 @@ void ChartController::executeDispatch_SourceData()
SolarMutexGuard aSolarGuard;
- ScopedVclPtrInstance< MessageDialog > aQueryBox( GetChartWindow(), SchResId( STR_DLG_REMOVE_DATA_TABLE ), VclMessageType::Question, VclButtonsType::YesNo);
-
+ VclPtr<ChartWindow> xChartWindow(GetChartWindow());
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(xChartWindow ? xChartWindow->GetFrameWeld() : nullptr,
+ VclMessageType::Question, VclButtonsType::YesNo, SchResId(STR_DLG_REMOVE_DATA_TABLE)));
// If "No" then just return
- if (aQueryBox->Execute() == RET_NO)
+ if (xQueryBox->run() == RET_NO)
return;
// Remove data table
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index 61277e9ac7ae..1c2ad24094d6 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -26,7 +26,7 @@
#include <vcl/commandinfoprovider.hxx>
#include <vcl/help.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/decoview.hxx>
#include <vcl/toolbox.hxx>
@@ -450,12 +450,13 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, ResetMenuHdl, Button *, void )
{
SvxConfigEntry* pMenuData = GetTopLevelSelection();
- ScopedVclPtrInstance<MessageDialog> qbox(this,
- CuiResId(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT_MENU), VclMessageType::Question, VclButtonsType::YesNo);
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ CuiResId(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT_MENU)));
// Resetting individual top-level menus is not possible at the moment.
// So we are resetting only if it is a context menu
- if (!m_bIsMenuBar && qbox->Execute() == RET_YES)
+ if (!m_bIsMenuBar && xQueryBox->run() == RET_YES)
{
sal_Int32 nPos = m_pTopLevelListBox->GetSelectedEntryPos();
ContextMenuSaveInData* pSaveInData = static_cast< ContextMenuSaveInData* >(GetSaveInData());
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index 478f1c44022c..49c4349c459b 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -26,7 +26,7 @@
#include <vcl/commandinfoprovider.hxx>
#include <vcl/help.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/decoview.hxx>
#include <vcl/toolbox.hxx>
@@ -252,10 +252,10 @@ void SvxToolbarConfigPage::DeleteSelectedContent()
if ( m_pContentsListBox->GetEntryCount() == 0 &&
GetTopLevelSelection()->IsDeletable() )
{
- ScopedVclPtrInstance<MessageDialog> qbox(this,
- CuiResId(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR), VclMessageType::Question, VclButtonsType::YesNo);
-
- if ( qbox->Execute() == RET_YES )
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ CuiResId(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR)));
+ if (xQueryBox->run() == RET_YES)
{
DeleteSelectedTopLevel();
}
@@ -683,10 +683,10 @@ IMPL_LINK_NOARG( SvxToolbarConfigPage, ResetToolbarHdl, Button *, void )
SvxConfigEntry* pToolbar =
static_cast<SvxConfigEntry*>(m_pTopLevelListBox->GetEntryData( nSelectionPos ));
- ScopedVclPtrInstance<MessageDialog> qbox(this,
- CuiResId(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT), VclMessageType::Question, VclButtonsType::YesNo);
-
- if ( qbox->Execute() == RET_YES )
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ CuiResId(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT)));
+ if (xQueryBox->run() == RET_YES)
{
ToolbarSaveInData* pSaveInData =
static_cast<ToolbarSaveInData*>(GetSaveInData());
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 2711eb1d5912..94b02b86b56d 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -26,7 +26,8 @@
#include <vcl/commandinfoprovider.hxx>
#include <vcl/help.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/decoview.hxx>
#include <vcl/toolbox.hxx>
@@ -1665,9 +1666,9 @@ SvTreeListEntry* SvxConfigPage::AddFunction(
if ( pCurEntry->GetCommand() == pNewEntryData->GetCommand() )
{
- ScopedVclPtrInstance<MessageDialog>(this,
- CuiResId( RID_SVXSTR_MNUCFG_ALREADY_INCLUDED ),
- VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok, CuiResId(RID_SVXSTR_MNUCFG_ALREADY_INCLUDED)));
+ xBox->run();
delete pNewEntryData;
return nullptr;
}
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index c9ba680c8609..df8a0b131319 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -20,6 +20,7 @@
#include <config_features.h>
#include <osl/process.h>
#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
@@ -143,9 +144,10 @@ IMPL_LINK( AboutDialog, HandleClick, Button*, pButton, void )
Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
- aErrorBox->SetText( GetText() );
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, msg));
+ xErrorBox->set_title(GetText());
+ xErrorBox->run();
}
}
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 8c2f03d1eada..69a867b4f036 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -18,7 +18,7 @@
*/
#include <tools/debug.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <dialmgr.hxx>
#include <sfx2/tabdlg.hxx>
@@ -728,7 +728,9 @@ IMPL_LINK(FmSearchDialog, OnSearchProgress, const FmSearchProgress*, pProgress,
const char* pErrorId = (FmSearchProgress::State::Error == pProgress->aSearchState)
? RID_STR_SEARCH_GENERAL_ERROR
: RID_STR_SEARCH_NORECORD;
- ScopedVclPtrInstance<MessageDialog>(this, CuiResId(pErrorId))->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, CuiResId(pErrorId)));
+ xBox->run();
SAL_FALLTHROUGH;
}
case FmSearchProgress::State::Canceled:
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index b194dee47f67..ef138dc257a2 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -26,6 +26,7 @@
#include <ucbhelper/content.hxx>
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <avmedia/mediawindow.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/opengrf.hxx>
@@ -949,7 +950,6 @@ void TPGalleryThemeProperties::FillFilterList()
m_pCbbFileType->SetText( pFilterEntry->aFilterName );
}
-
IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFileTypeHdl, ComboBox&, void)
{
OUString aText( m_pCbbFileType->GetText() );
@@ -958,12 +958,13 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFileTypeHdl, ComboBox&, void)
{
aLastFilterName = aText;
- if( ScopedVclPtrInstance<MessageDialog>( this, "QueryUpdateFileListDialog","cui/ui/queryupdategalleryfilelistdialog.ui" )->Execute() == RET_YES )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryupdategalleryfilelistdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryUpdateFileListDialog"));
+ if (xQuery->run() == RET_YES)
SearchFiles();
}
}
-
void TPGalleryThemeProperties::SearchFiles()
{
VclPtrInstance<SearchProgress> pProgress( this, aURL );
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index e350506707af..9db02b3b467f 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -44,7 +44,7 @@
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/classids.hxx>
@@ -267,7 +267,10 @@ short SvInsertOleDlg::Execute()
// global Resource from svtools (former so3 resource)
OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
aErr = aErr.replaceFirst( "%", aFileName );
- ScopedVclPtrInstance<MessageDialog>(this, aErr)->Execute();
+
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aErr));
+ xBox->run();
}
else
{
@@ -275,7 +278,10 @@ short SvInsertOleDlg::Execute()
// global Resource from svtools (former so3 resource)
OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE));
aErr = aErr.replaceFirst( "%", aServerName );
- ScopedVclPtrInstance<MessageDialog>(this, aErr)->Execute();
+
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aErr));
+ xBox->run();
}
}
}
@@ -316,7 +322,10 @@ short SvInsertOleDlg::Execute()
// global Resource from svtools (former so3 resource)
OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
aErr = aErr.replaceFirst( "%", aFileName );
- ScopedVclPtrInstance<MessageDialog>(this, aErr)->Execute();
+
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aErr));
+ xBox->run();
}
else
{
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index 21be42aec23d..fab6b3caa6cc 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -26,7 +26,7 @@
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
#include <vcl/button.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/settings.hxx>
struct PasswordToOpenModifyDialog_Impl
@@ -91,16 +91,17 @@ PasswordToOpenModifyDialog_Impl::PasswordToOpenModifyDialog_Impl(
m_pOptionsExpander->Hide();
}
-IMPL_LINK_NOARG( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, Button *, void )
+IMPL_LINK(PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, Button *, pButton, void)
{
bool bInvalidState = !m_pOpenReadonlyCB->IsChecked() &&
m_pPasswdToOpenED->GetText().isEmpty() &&
m_pPasswdToModifyED->GetText().isEmpty();
if (bInvalidState)
{
- ScopedVclPtrInstance<MessageDialog> aErrorBox(m_pParent,
- m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2);
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok,
+ m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2));
+ xErrorBox->run();
}
else // check for mismatched passwords...
{
@@ -109,8 +110,10 @@ IMPL_LINK_NOARG( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, Button *, void
const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
if (nMismatch > 0)
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok,
+ nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch));
+ xErrorBox->run();
Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED.get() : m_pPasswdToModifyED.get();
Edit* pRepeatEdit = !bToOpenMatch? m_pReenterPasswdToOpenED.get() : m_pReenterPasswdToModifyED.get();
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 2df5cd25e516..c219b6f56ef6 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -22,7 +22,7 @@
#include <sfx2/objsh.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/builderfactory.hxx>
#include <o3tl/make_unique.hxx>
@@ -896,9 +896,11 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
{
bValid = false;
OUString aError = m_createErrStr + m_createDupStr;
- ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox->SetText( m_createErrTitleStr );
- aErrorBox->Execute();
+
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aError));
+ xErrorBox->set_title(m_createErrTitleStr);
+ xErrorBox->run();
xNewDlg->SetObjectName( aNewName );
break;
}
@@ -976,9 +978,10 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_createErrStr );
- ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox->SetText( m_createErrTitleStr );
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aError));
+ xErrorBox->set_title(m_createErrTitleStr);
+ xErrorBox->run();
}
}
@@ -1035,9 +1038,10 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_renameErrStr );
- ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox->SetText( m_renameErrTitleStr );
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, aError));
+ xErrorBox->set_title(m_renameErrTitleStr);
+ xErrorBox->run();
}
}
void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
@@ -1046,9 +1050,10 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
// ISSUE L10N string & can we centre list?
OUString aQuery = m_delQueryStr + getListOfChildren( node, 0 );
- VclPtrInstance< MessageDialog > aQueryBox(static_cast<vcl::Window*>(this), aQuery, VclMessageType::Question, VclButtonsType::YesNo);
- aQueryBox->SetText( m_delQueryTitleStr );
- if ( aQueryBox->Execute() == RET_NO )
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo, aQuery));
+ xQueryBox->set_title(m_delQueryTitleStr);
+ if (xQueryBox->run() == RET_NO)
{
return;
}
@@ -1079,9 +1084,10 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
else
{
//ISSUE L10N & message from exception?
- ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr);
- aErrorBox->SetText( m_delErrTitleStr );
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, m_delErrStr));
+ xErrorBox->set_title(m_delErrTitleStr);
+ xErrorBox->run();
}
}
@@ -1428,9 +1434,10 @@ IMPL_STATIC_LINK( SvxScriptErrorDialog, ShowDialog, void*, p, void )
message = CuiResId( RID_SVXSTR_ERROR_TITLE );
}
- ScopedVclPtrInstance<MessageDialog> pBox( nullptr, message, VclMessageType::Warning );
- pBox->SetText( CuiResId( RID_SVXSTR_ERROR_TITLE ) );
- pBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, message));
+ xBox->set_title(CuiResId(RID_SVXSTR_ERROR_TITLE));
+ xBox->run();
delete pMessage;
}
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 2ab19ca73d15..1d3cf77c746b 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -27,7 +27,7 @@
#include <strings.hrc>
#include <bitmaps.hlst>
#include <vcl/field.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <svl/eitem.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/uno/Exception.hpp>
@@ -275,8 +275,9 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, DeleteHdl, Button*, void)
SvTreeListEntry* pEntry = m_pPathBox->FirstSelected();
if ( pEntry )
{
- ScopedVclPtrInstance< MessageDialog > aQuery(this, CuiResId(RID_SVXSTR_QUERY_DELETE_CONFIRM), VclMessageType::Question, VclButtonsType::YesNo);
- if ( aQuery->Execute() == RET_YES )
+ std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo, CuiResId(RID_SVXSTR_QUERY_DELETE_CONFIRM)));
+ if (xQuery->run() == RET_YES)
m_pPathBox->GetModel()->Remove(pEntry);
}
}
diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx
index f57cd6210ebd..abaabd906b90 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -23,7 +23,8 @@
#include <comphelper/processfactory.hxx>
#include <strings.hrc>
#include <svl/filenotation.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
#include <ucbhelper/content.hxx>
#include <dialmgr.hxx>
#include <tools/urlobj.hxx>
@@ -126,8 +127,9 @@ namespace svx
{
OUString sMsg = CuiResId(STR_LINKEDDOC_DOESNOTEXIST);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
- aError->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, sMsg));
+ xErrorBox->run();
return;
} // if (!bFileExists)
INetURLObject aURL( sURL );
@@ -135,8 +137,9 @@ namespace svx
{
OUString sMsg = CuiResId(STR_LINKEDDOC_NO_SYSTEM_FILE);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
- aError->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, sMsg));
+ xErrorBox->run();
return;
}
@@ -147,8 +150,9 @@ namespace svx
{
OUString sMsg = CuiResId(STR_NAME_CONFLICT);
sMsg = sMsg.replaceFirst("$file$", sCurrentText);
- ScopedVclPtrInstance< MessageDialog > aError(this, sMsg, VclMessageType::Info);
- aError->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok, sMsg));
+ xErrorBox->run();
m_pName->SetSelection(Selection(0,sCurrentText.getLength()));
m_pName->GrabFocus();
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 7cecd8e01376..0cedb6e21e9b 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -22,6 +22,7 @@
#include <dialmgr.hxx>
#include <vcl/builderfactory.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <svx/svxids.hrc>
@@ -286,7 +287,7 @@ IMPL_LINK_NOARG(SvxDefaultColorOptPage, AddChartColor, Button*, void)
// RemoveChartColor
-IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, Button*, pButton, void )
+IMPL_LINK_NOARG( SvxDefaultColorOptPage, RemoveChartColor, Button*, void )
{
sal_Int32 nIndex = m_pLbChartColors->GetSelectedEntryPos();
@@ -297,9 +298,10 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, Button*, pButton, void )
{
OSL_ENSURE(pColorConfig->GetColorList().size() > 1, "don't delete the last chart color");
- ScopedVclPtrInstance<MessageDialog> aQuery(pButton, "QueryDeleteChartColorDialog",
- "cui/ui/querydeletechartcolordialog.ui");
- if (RET_YES == aQuery->Execute())
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletechartcolordialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteChartColorDialog"));
+
+ if (RET_YES == xQuery->run())
{
pColorConfig->GetColorList().remove( nIndex );
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index c20b723a26be..1e8e4c5b2dc3 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -34,6 +34,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
#include <vcl/builderfactory.hxx>
+#include <vcl/weld.hxx>
#include <svx/svxdlg.hxx>
#include <helpids.h>
#include <dialmgr.hxx>
@@ -1130,9 +1131,11 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, void )
else
{
DBG_ASSERT(m_pColorSchemeLB->GetEntryCount() > 1, "don't delete the last scheme");
- ScopedVclPtrInstance< MessageDialog > aQuery(pButton, CuiResId(RID_SVXSTR_COLOR_CONFIG_DELETE), VclMessageType::Question, VclButtonsType::YesNo);
- aQuery->SetText(CuiResId(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
- if(RET_YES == aQuery->Execute())
+ std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(pButton->GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ CuiResId(RID_SVXSTR_COLOR_CONFIG_DELETE)));
+ xQuery->set_title(CuiResId(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
+ if (RET_YES == xQuery->run())
{
OUString sDeleteScheme(m_pColorSchemeLB->GetSelectedEntry());
m_pColorSchemeLB->RemoveEntry(m_pColorSchemeLB->GetSelectedEntryPos());
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 695f358a0346..7b4e4ea5797e 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -27,7 +27,7 @@
#include <comphelper/string.hxx>
#include <unotools/intlwrapper.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/settings.hxx>
#include <vcl/builderfactory.hxx>
#include <svx/dialogs.hrc>
@@ -151,7 +151,10 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
if ( bFound )
{
// duplicate names?
- ScopedVclPtrInstance<MessageDialog>(this, CuiResId(RID_SVXSTR_OPT_DOUBLE_DICTS), VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ CuiResId(RID_SVXSTR_OPT_DOUBLE_DICTS)));
+ xInfoBox->run();
pNameEdit->GrabFocus();
return;
}
@@ -450,12 +453,14 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl, ListBox&, void)
if ( nLang != nOldLang )
{
- ScopedVclPtrInstance< MessageDialog > aBox(this, CuiResId( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VclMessageType::Question, VclButtonsType::YesNo);
- OUString sTxt(aBox->get_primary_text());
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ CuiResId(RID_SVXSTR_CONFIRM_SET_LANGUAGE)));
+ OUString sTxt(xBox->get_primary_text());
sTxt = sTxt.replaceFirst( "%1", pAllDictsLB->GetSelectedEntry() );
- aBox->set_primary_text(sTxt);
+ xBox->set_primary_text(sTxt);
- if ( aBox->Execute() == RET_YES )
+ if (xBox->run() == RET_YES)
{
xDic->setLocale( LanguageTag::convertToLocale( nLang ) );
bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index b1d5197e6687..1b4161575e67 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -39,7 +39,7 @@
#include <sfx2/objsh.hxx>
#include <unotools/bootstrap.hxx>
#include <vcl/help.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/builderfactory.hxx>
#include <sfx2/viewfrm.hxx>
#include <unotools/pathoptions.hxx>
@@ -138,7 +138,6 @@ void SvxNoSpaceEdit::KeyInput( const KeyEvent& rKEvent )
Edit::KeyInput(rKEvent);
}
-
void SvxNoSpaceEdit::Modify()
{
Edit::Modify();
@@ -146,7 +145,12 @@ void SvxNoSpaceEdit::Modify()
if ( bOnlyNumeric )
{
if ( !isValidPort(GetText()) )
- ScopedVclPtrInstance<MessageDialog>(this, CuiResId( RID_SVXSTR_OPT_PROXYPORTS))->Execute();
+ {
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok,
+ CuiResId( RID_SVXSTR_OPT_PROXYPORTS)));
+ xErrorBox->run();
+ }
}
}
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 26b34709384e..30d968607df6 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -35,7 +35,7 @@
#include <vcl/svapp.hxx>
#include <vcl/help.hxx>
#include <tools/urlobj.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/waitobj.hxx>
#include <unotools/pathoptions.hxx>
#include <svtools/imagemgr.hxx>
@@ -538,13 +538,17 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
}
else if ( JFW_E_NOT_RECOGNIZED == eErr )
{
- ScopedVclPtrInstance< MessageDialog > aErrBox( this, CuiResId( RID_SVXSTR_JRE_NOT_RECOGNIZED ) );
- aErrBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok,
+ CuiResId(RID_SVXSTR_JRE_NOT_RECOGNIZED)));
+ xBox->run();
}
else if ( JFW_E_FAILED_VERSION == eErr )
{
- ScopedVclPtrInstance< MessageDialog > aErrBox( this, CuiResId( RID_SVXSTR_JRE_FAILED_VERSION ) );
- aErrBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok,
+ CuiResId(RID_SVXSTR_JRE_FAILED_VERSION)));
+ xBox->run();
}
if ( bStartAgain )
@@ -928,7 +932,9 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl, Button*, void)
{
OUString sMsg( CuiResId( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sFile );
- ScopedVclPtrInstance<MessageDialog>(this, sMsg)->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, sMsg));
+ xBox->run();
}
}
EnableRemoveButton();
@@ -963,7 +969,9 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl, Button*, void)
{
OUString sMsg( CuiResId( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
sMsg = sMsg.replaceFirst( "%1", sNewFolder );
- ScopedVclPtrInstance<MessageDialog>(this, sMsg)->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, sMsg));
+ xBox->run();
}
}
EnableRemoveButton();
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 9400320e3d2d..c2adea57d669 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -21,6 +21,7 @@
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <unotools/lingucfg.hxx>
#include <editeng/unolingu.hxx>
@@ -1553,9 +1554,9 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void )
}
else if (m_pLinguDicsDelPB == pBtn)
{
- ScopedVclPtrInstance<MessageDialog> aQuery(this, "QueryDeleteDictionaryDialog",
- "cui/ui/querydeletedictionarydialog.ui");
- if (RET_NO == aQuery->Execute())
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletedictionarydialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteDictionaryDialog"));
+ if (RET_NO == xQuery->run())
return;
SvTreeListEntry *pEntry = m_pLinguDicsCLB->GetCurEntry();
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index 5e94bda5a12a..e757231a0c33 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -21,6 +21,7 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
#include <svl/zforlist.hxx>
#include <opencl/openclconfig.hxx>
#include <opencl/openclwrapper.hxx>
@@ -101,8 +102,10 @@ bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* )
if (bModified)
{
- ScopedVclPtrInstance<MessageDialog> aWarnBox(this, CuiResId(RID_SVXSTR_OPTIONS_RESTART), VclMessageType::Info);
- aWarnBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xWarnBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ CuiResId(RID_SVXSTR_OPTIONS_RESTART)));
+ xWarnBox->run();
batch->commit();
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index fa75e28873bf..37ee324e01f5 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -38,7 +38,7 @@
#include <svl/intitem.hxx>
#include <sfx2/request.hxx>
#include <sfx2/opengrf.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <svx/svxdlg.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/dialoghelper.hxx>
@@ -584,10 +584,9 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui" );
- aBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xBox->run();
}
}
}
@@ -600,9 +599,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, SvxPresetListBox*, void)
if( nPos != VALUESET_ITEM_NOTFOUND )
{
- ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" );
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog"));
- if( aQueryBox->Execute() == RET_YES )
+ if (xQueryBox->run() == RET_YES)
{
m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) );
m_pBitmapLB->RemoveItem( nId );
@@ -772,7 +772,6 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
if( !nError )
{
OUString aDesc(CuiResId(RID_SVXSTR_DESC_EXT_BITMAP));
- ScopedVclPtr<MessageDialog> pWarnBox;
// convert file URL to UI name
OUString aName;
@@ -798,19 +797,13 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
break;
}
- if( !pWarnBox )
- {
- pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui"));
- }
-
- if( pWarnBox->Execute() != RET_OK )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ if (xBox->run() != RET_OK)
break;
}
pDlg.disposeAndClear();
- pWarnBox.disposeAndClear();
if( !nError )
{
@@ -827,10 +820,12 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
}
}
else
+ {
// graphic couldn't be loaded
- ScopedVclPtrInstance<MessageDialog>( GetParentDialog()
- ,"NoLoadedFileDialog"
- ,"cui/ui/querynoloadedfiledialog.ui")->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog"));
+ xBox->run();
+ }
}
}
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index fe6e5118fd23..85ffbce5373f 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -28,6 +28,7 @@
#include <sfx2/dispatch.hxx>
#include <svtools/colrdlg.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <sfx2/filedlghelper.hxx>
#include <svx/ofaitem.hxx>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
@@ -365,7 +366,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
- ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError = 1;
while (pDlg->Execute() == RET_OK)
@@ -379,19 +379,13 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
break;
}
- if( !pWarnBox )
- {
- pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui"));
- }
-
- if( pWarnBox->Execute() != RET_OK )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ if (xWarnBox->run() != RET_OK)
break;
}
pDlg.disposeAndClear();
- pWarnBox.disposeAndClear();
if (!nError)
{
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index f145f8c4f509..52cf295e245e 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -21,6 +21,7 @@
#include <vcl/wrkwin.hxx>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dialoghelper.hxx>
@@ -377,7 +378,6 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
- ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError = 1;
while (pDlg->Execute() == RET_OK)
@@ -392,18 +392,12 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
break;
}
- if( !pWarnBox )
- {
- pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui"));
- }
-
- if( pWarnBox->Execute() != RET_OK )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ if (xWarnBox->run() != RET_OK)
break;
}
pDlg.disposeAndClear();
- pWarnBox.disposeAndClear();
if( !nError )
{
@@ -475,9 +469,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void
if( nPos != VALUESET_ITEM_NOTFOUND )
{
- ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui");
-
- if ( aQueryBox->Execute() == RET_YES )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletegradientdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelGradientDialog"));
+ if (xQueryBox->run() == RET_YES)
{
m_pGradientList->Remove(nPos);
m_pGradientLB->RemoveItem( nId );
@@ -531,10 +525,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void
}
else
{
- ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui" );
- aBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xBox->run();
}
}
}
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 17faefbdd114..c34e72484f13 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -21,6 +21,7 @@
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dialoghelper.hxx>
@@ -447,7 +448,6 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
assert(pFact && "Dialog creation failed!");
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
assert(pDlg && "Dialog creation failed!");
- ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
@@ -461,18 +461,12 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
break;
}
- if( !pWarnBox )
- {
- pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui"));
- }
-
- if( pWarnBox->Execute() != RET_OK )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ if (xWarnBox->run() != RET_OK)
break;
}
pDlg.disposeAndClear();
- pWarnBox.disposeAndClear();
if( !nError )
{
@@ -535,9 +529,9 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void)
if( nPos != VALUESET_ITEM_NOTFOUND )
{
- ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
-
- if( aQueryBox->Execute() == RET_YES )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletehatchdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelHatchDialog"));
+ if (xQueryBox->run() == RET_YES)
{
m_pHatchingList->Remove(nPos);
m_pHatchLB->RemoveItem( nId );
@@ -588,10 +582,9 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void )
}
else
{
- ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui" );
- aBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xBox->run();
}
}
}
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 5291075cc318..4c2ba2cd428e 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -20,6 +20,7 @@
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
@@ -590,10 +591,9 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui" );
- aBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xBox->run();
}
}
pDlg.disposeAndClear();
@@ -663,10 +663,9 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui" );
- aBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xBox->run();
}
}
}
@@ -679,11 +678,9 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickDeleteHdl_Impl, Button*, void)
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
- ,"AskDelLineStyleDialog"
- ,"cui/ui/querydeletelinestyledialog.ui" );
-
- if ( aQueryBox->Execute() == RET_YES )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletelinestyledialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelLineStyleDialog"));
+ if (xQueryBox->run() == RET_YES)
{
pDashList->Remove(nPos);
m_pLbLineStyles->RemoveEntry( nPos );
@@ -713,9 +710,10 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl, Button*, void)
if ( *pnDashListState & ChangeType::MODIFIED )
{
- nReturn = ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
- ,"AskSaveList"
- ,"cui/ui/querysavelistdialog.ui")->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querysavelistdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("AskSaveList"));
+
+ nReturn = xBox->run();
if ( nReturn == RET_YES )
pDashList->Save();
@@ -765,10 +763,11 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl, Button*, void)
*pnDashListState &= ~ChangeType::MODIFIED;
}
else
- //aIStream.Close();
- ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
- ,"NoLoadedFileDialog"
- ,"cui/ui/querynoloadedfiledialog.ui")->Execute();
+ {
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog"));
+ xBox->run();
+ }
}
}
@@ -832,9 +831,9 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
- ,"NoSaveFileDialog"
- ,"cui/ui/querynosavefiledialog.ui")->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynosavefiledialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoSaveFileDialog"));
+ xBox->run();
}
}
}
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index e669b92135ec..621d90929028 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -20,6 +20,7 @@
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
#include <sfx2/filedlghelper.hxx>
@@ -200,10 +201,9 @@ void SvxLineEndDefTabPage::CheckChanges_Impl()
if( aString != m_pLbLineEnds->GetSelectedEntry() )
{
- ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
- ,"AskChangeLineEndDialog"
- ,"cui/ui/querychangelineenddialog.ui" );
- if ( aQueryBox->Execute() == RET_YES )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querychangelineenddialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskChangeLineEndDialog"));
+ if (xQueryBox->run() == RET_YES)
ClickModifyHdl_Impl( nullptr );
}
}
@@ -321,10 +321,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void)
// if yes, repeat and demand a new name
if ( !bDifferent )
{
- ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui" );
- aWarningBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xWarningBox->run();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialog creation failed!");
@@ -346,7 +345,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void)
if( bDifferent )
bLoop = false;
else
- aWarningBox->Execute();
+ xWarningBox->run();
}
}
@@ -466,10 +465,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui" );
- aBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xWarningBox->run();
}
}
}
@@ -492,11 +490,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, Button*, void)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
- ,"AskDelLineEndDialog"
- ,"cui/ui/querydeletelineenddialog.ui" );
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletelineenddialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelLineEndDialog"));
- if ( aQueryBox->Execute() == RET_YES )
+ if (xQueryBox->run() == RET_YES)
{
pLineEndList->Remove(nPos);
m_pLbLineEnds->RemoveEntry( nPos );
@@ -526,9 +523,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
if ( *pnLineEndListState & ChangeType::MODIFIED )
{
- nReturn = ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
- ,"AskSaveList"
- ,"cui/ui/querysavelistdialog.ui")->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querysavelistdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("AskSaveList"));
+
+ nReturn = xBox->run();
if ( nReturn == RET_YES )
pLineEndList->Save();
@@ -580,9 +578,11 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
*pnLineEndListState &= ~ChangeType::MODIFIED;
}
else
- ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
- ,"NoLoadedFileDialog"
- ,"cui/ui/querynoloadedfiledialog.ui")->Execute();
+ {
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog"));
+ xBox->run();
+ }
}
}
@@ -647,9 +647,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl, Button*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog>(GetParentDialog()
- ,"NoSaveFileDialog"
- ,"cui/ui/querynosavefiledialog.ui")->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynosavefiledialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoSaveFileDialog"));
+ xBox->run();
}
}
}
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index 8933c5fbe18c..611edb2cc557 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -32,6 +32,7 @@
#include <svx/dialmgr.hxx>
#include <vcl/bitmapaccess.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
#include <svx/dialogs.hrc>
#include <svx/strings.hrc>
@@ -360,7 +361,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void)
assert(pFact && "Dialog creation failed!");
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
assert(pDlg && "Dialog creation failed!");
- ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError(1);
while( pDlg->Execute() == RET_OK )
@@ -374,19 +374,13 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void)
break;
}
- if( !pWarnBox )
- {
- pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui"));
- }
-
- if( pWarnBox->Execute() != RET_OK )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ if (xWarnBox->run() != RET_OK)
break;
}
pDlg.disposeAndClear();
- pWarnBox.disposeAndClear();
if( !nError )
{
@@ -496,17 +490,14 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void)
}
else
{
- ScopedVclPtrInstance<MessageDialog> aBox(
- GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox->Execute();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
+ xWarnBox->run();
}
}
}
}
-
IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void)
{
sal_uInt16 nId = m_pPatternLB->GetSelectItemId();
@@ -514,9 +505,9 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void)
if( nPos != VALUESET_ITEM_NOTFOUND )
{
- ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" );
-
- if( aQueryBox->Execute() == RET_YES )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog"));
+ if (xQueryBox->run() == RET_YES)
{
m_pPatternList->Remove(nPos);
m_pPatternLB->RemoveItem( nId );
diff --git a/cui/uiconfig/ui/querychangelineenddialog.ui b/cui/uiconfig/ui/querychangelineenddialog.ui
index b8e5f113a203..eddcaf4711aa 100644
--- a/cui/uiconfig/ui/querychangelineenddialog.ui
+++ b/cui/uiconfig/ui/querychangelineenddialog.ui
@@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.6"/>
<object class="GtkMessageDialog" id="AskChangeLineEndDialog">
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list