summaryrefslogtreecommitdiff
path: root/svx/source/gallery2
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/gallery2')
-rw-r--r--svx/source/gallery2/galbrws1.cxx6
-rw-r--r--svx/source/gallery2/galbrws2.cxx11
2 files changed, 13 insertions, 4 deletions
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 1217a632a0a0..2082050ecc4e 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -24,6 +24,8 @@
#include <unotools/datetime.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
#include <ucbhelper/content.hxx>
#include <sfx2/app.hxx>
#include <helpids.h>
@@ -358,7 +360,9 @@ void GalleryBrowser1::ImplExecute(const OString &rIdent)
}
else if (rIdent == "delete")
{
- if( ScopedVclPtrInstance<MessageDialog>(nullptr, "QueryDeleteThemeDialog","svx/ui/querydeletethemedialog.ui")->Execute() == RET_YES )
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "svx/ui/querydeletethemedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteThemeDialog"));
+ if (xQuery->run() == RET_YES)
mpGallery->RemoveTheme( mpThemes->GetSelectedEntry() );
}
else if (rIdent == "rename")
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 220e358380ae..43b79f3bd33a 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -43,6 +43,7 @@
#include <galbrws2.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
+#include <vcl/weld.hxx>
#include <svx/fmmodel.hxx>
#include <svx/dialmgr.hxx>
#include <svx/svxdlg.hxx>
@@ -1099,10 +1100,14 @@ void GalleryBrowser2::Execute(const OString &rIdent)
SetMode( ( GALLERYBROWSERMODE_PREVIEW != GetMode() ) ? GALLERYBROWSERMODE_PREVIEW : meLastMode );
else if (rIdent == "delete")
{
- if( !mpCurTheme->IsReadOnly() &&
- ScopedVclPtrInstance<MessageDialog>(nullptr, "QueryDeleteObjectDialog","svx/ui/querydeleteobjectdialog.ui")->Execute() == RET_YES )
+ if (!mpCurTheme->IsReadOnly())
{
- mpCurTheme->RemoveObject( mnCurActionPos );
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "svx/ui/querydeleteobjectdialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteObjectDialog"));
+ if (xQuery->run() == RET_YES)
+ {
+ mpCurTheme->RemoveObject( mnCurActionPos );
+ }
}
}
else if (rIdent == "title")