summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/core/drawdoc3.cxx7
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx7
-rw-r--r--sd/source/filter/html/pubdlg.cxx8
-rw-r--r--sd/source/ui/app/sdmod1.cxx6
-rw-r--r--sd/source/ui/dlg/brkdlg.cxx7
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx7
-rw-r--r--sd/source/ui/func/fuinsert.cxx6
-rw-r--r--sd/source/ui/func/fuinsfil.cxx16
-rw-r--r--sd/source/ui/inc/ViewShell.hxx6
-rw-r--r--sd/source/ui/view/Outliner.cxx17
-rw-r--r--sd/source/ui/view/drviews2.cxx6
-rw-r--r--sd/source/ui/view/drviews6.cxx6
-rw-r--r--sd/source/ui/view/viewshel.cxx5
13 files changed, 68 insertions, 36 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index d1d3da08ac36..3e50db1f9643 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -37,8 +37,8 @@
#include <svx/svdpagv.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdundo.hxx>
-#include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <sot/formats.hxx>
#include <xmloff/autolayout.hxx>
@@ -244,8 +244,9 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium* pMedium)
if (!bOK)
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SdResId(STR_READ_DATA_ERROR));
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_READ_DATA_ERROR)));
+ xErrorBox->run();
CloseBookmarkDoc();
pBookmarkDoc = nullptr;
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 537f9e579b5d..d5dd2d1cedfb 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -26,7 +26,7 @@
#include <unotools/localfilehelper.hxx>
#include <vcl/errinf.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/metaact.hxx>
#include <vcl/virdev.hxx>
#include <sfx2/sfxsids.hrc>
@@ -149,8 +149,9 @@ void SdGRFFilter::HandleGraphicFilterError( ErrCode nFilterError, ErrCode nStrea
ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
else
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, pId ? SdResId(pId) : OUString());
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, pId ? SdResId(pId) : OUString()));
+ xErrorBox->run();
}
}
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index db3919fc527f..b12f9de4314a 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -30,6 +30,7 @@
#include <svl/itemset.hxx>
#include <svl/stritem.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <svtools/valueset.hxx>
#include <vcl/graph.hxx>
#include <svl/eitem.hxx>
@@ -1153,9 +1154,10 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl, Button*, void)
if (iter != m_aDesignList.end())
{
- ScopedVclPtrInstance<MessageDialog> aErrorBox(this, SdResId(STR_PUBDLG_SAMENAME),
- VclMessageType::Error, VclButtonsType::YesNo);
- bRetry = aErrorBox->Execute() == RET_NO;
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Error, VclButtonsType::YesNo,
+ SdResId(STR_PUBDLG_SAMENAME)));
+ bRetry = xErrorBox->run() == RET_NO;
if(!bRetry)
m_aDesignList.erase(iter);
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 7bdede6cd75a..5049d6fb42df 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -28,6 +28,7 @@
#include <editeng/langitem.hxx>
#include <editeng/editdata.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <editeng/svxenum.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
@@ -230,7 +231,10 @@ void SdModule::Execute(SfxRequest& rReq)
}
else
{
- ScopedVclPtrInstance<MessageDialog>(nullptr, SdResId(STR_CANT_PERFORM_IN_LIVEMODE))->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_CANT_PERFORM_IN_LIVEMODE)));
+
+ xErrorBox->run();
const SfxLinkItem* pLinkItem = rReq.GetArg<SfxLinkItem>(SID_DONELINK);
if( pLinkItem )
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index 9ef0228fb995..a0ffda6385d3 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -24,6 +24,7 @@
#include <svx/svdetc.hxx>
#include <sfx2/app.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <sdattr.hxx>
#include <sdresid.hxx>
@@ -107,8 +108,10 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit, bool )
// update status bar or show a error message?
if(nInit == reinterpret_cast<void*>(1))
{
- ScopedVclPtrInstance< MessageDialog > aErrBox(this, SdResId(STR_BREAK_FAIL));
- aErrBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok,
+ SdResId(STR_BREAK_FAIL)));
+ xErrBox->run();
}
else
{
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 57f1619f2613..71ac14cd518a 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -20,7 +20,7 @@
#include <sal/types.h>
#include <sot/formats.hxx>
#include <sot/storage.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <svl/urihelper.hxx>
#include <svx/svditer.hxx>
#include <sfx2/docfile.hxx>
@@ -841,8 +841,9 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
if ( !mpBookmarkDoc )
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(this, SdResId(STR_READ_DATA_ERROR));
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_READ_DATA_ERROR)));
+ xErrorBox->run();
mpMedium = nullptr; //On failure the SfxMedium is invalid
}
}
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 77cd60c685ea..7d18f8e6ab4c 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -191,8 +191,8 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
// really store as link only?
if( SvtMiscOptions().ShowLinkWarningDialog() )
{
- ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(mpWindow, aFileName);
- if( aWarnDlg->Execute() != RET_OK )
+ SvxLinkWarningDialog aWarnDlg(mpWindow->GetFrameWeld(), aFileName);
+ if (aWarnDlg.run() != RET_OK)
return; // don't store as link
}
@@ -726,7 +726,7 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
mpWindow->LeaveWait();
if( !bAPI )
- ::avmedia::MediaWindow::executeFormatErrorBox( mpWindow );
+ ::avmedia::MediaWindow::executeFormatErrorBox(mpWindow->GetFrameWeld());
}
else
{
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 0cd20acf99c8..01f5490ce035 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -27,6 +27,7 @@
#include <sfx2/request.hxx>
#include <sfx2/app.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <sfx2/printer.hxx>
#include <svx/svdorect.hxx>
#include <svx/svdundo.hxx>
@@ -318,8 +319,9 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
if( !bInserted )
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SdResId( STR_READ_DATA_ERROR));
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(mpWindow->GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_READ_DATA_ERROR)));
+ xErrorBox->run();
}
}
@@ -460,8 +462,9 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SdResId(STR_READ_DATA_ERROR));
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(mpWindow->GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_READ_DATA_ERROR)));
+ xErrorBox->run();
}
else
{
@@ -604,8 +607,9 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SdResId(STR_READ_DATA_ERROR));
- aErrorBox->Execute();
+ std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(mpWindow->GetFrameWeld(),
+ VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_READ_DATA_ERROR)));
+ xErrorBox->run();
}
else
{
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 868973a78b15..0686db158ea6 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -42,6 +42,11 @@ class ScrollBarBox;
class SdDrawDocument;
class ScrollBar;
+namespace weld
+{
+ class Window;
+}
+
namespace com { namespace sun { namespace star {
namespace embed {
class XEmbeddedObject;
@@ -155,6 +160,7 @@ public:
show running then the active window is a ShowWindow.
*/
::sd::Window* GetActiveWindow() const { return mpActiveWindow;}
+ weld::Window* GetFrameWeld() const;
/** Set the active window. When the shell is displayed in the center
pane then the window of the ViewShellBase is also set to the given
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 45ea0dcec4fa..f25fdd32b7f8 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -29,7 +29,7 @@
#include <vcl/outdev.hxx>
#include <svx/dlgutil.hxx>
#include <svx/xtable.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/printer.hxx>
@@ -1208,8 +1208,9 @@ void SdOutliner::ShowEndOfSearchDialog()
// Show the message in an info box that is modal with respect to the
// whole application.
- ScopedVclPtrInstance< MessageDialog > aInfoBox(nullptr, aString, VclMessageType::Info);
- ShowModalMessageBox (*aInfoBox.get());
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Info, VclButtonsType::Ok, aString));
+ ShowModalMessageBox(*xInfoBox.get());
}
bool SdOutliner::ShowWrapArroundDialog()
@@ -1247,9 +1248,9 @@ bool SdOutliner::ShowWrapArroundDialog()
// Pop up question box that asks the user whether to wrap around.
// The dialog is made modal with respect to the whole application.
- ScopedVclPtrInstance<QueryBox> aQuestionBox(nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, SdResId(pStringId));
- aQuestionBox->SetImage(QueryBox::GetStandardImage());
- sal_uInt16 nBoxResult = ShowModalMessageBox(*aQuestionBox.get());
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Question, VclButtonsType::YesNo, SdResId(pStringId)));
+ sal_uInt16 nBoxResult = ShowModalMessageBox(*xQueryBox.get());
return (nBoxResult == RET_YES);
}
@@ -1685,7 +1686,7 @@ bool SdOutliner::ConvertNextDocument()
return !mbEndOfSearch;
}
-sal_uInt16 SdOutliner::ShowModalMessageBox (Dialog& rMessageBox)
+sal_uInt16 SdOutliner::ShowModalMessageBox(weld::MessageDialog& rMessageBox)
{
// We assume that the parent of the given message box is NULL, i.e. it is
// modal with respect to the top application window. However, this
@@ -1718,7 +1719,7 @@ sal_uInt16 SdOutliner::ShowModalMessageBox (Dialog& rMessageBox)
if (pSearchDialog != nullptr)
pSearchDialog->EnableInput(false);
- sal_uInt16 nResult = rMessageBox.Execute();
+ sal_uInt16 nResult = rMessageBox.run();
// Unlock the search dialog.
if (pSearchDialog != nullptr)
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index de6c08948bd3..615bfb9e9a00 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -96,6 +96,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/waitobj.hxx>
+#include <vcl/weld.hxx>
#include <editeng/cmapitem.hxx>
#include <editeng/escapementitem.hxx>
@@ -1283,13 +1284,14 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (pObj && pObj->GetGraphicType() == GraphicType::Bitmap)
{
vcl::Window* pWin = GetActiveWindow();
+ weld::Window* pFrame = GetFrameWeld();
GraphicAttr aGraphicAttr = pObj->GetGraphicAttr();
short nState = RET_CANCEL;
if (aGraphicAttr != GraphicAttr()) // the image has been modified
{
- if (pWin)
+ if (pFrame)
{
- nState = GraphicHelper::HasToSaveTransformedImage(pWin);
+ nState = GraphicHelper::HasToSaveTransformedImage(pFrame);
}
}
else
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index d332935e4799..f9a736b7744b 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -24,6 +24,7 @@
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <sfx2/viewfrm.hxx>
#include <svx/svdograf.hxx>
#include <svx/svxids.hrc>
@@ -284,9 +285,10 @@ void DrawViewShell::ExecBmpMask( SfxRequest const & rReq )
if (xNewObj->IsLinkedGraphic())
{
- ScopedVclPtrInstance< MessageDialog > aQueryBox( static_cast<vcl::Window*>(GetActiveWindow()),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui");
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/sdraw/ui/queryunlinkimagedialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryUnlinkImageDialog"));
- if (RET_YES == aQueryBox->Execute())
+ if (RET_YES == xQueryBox->run())
xNewObj->ReleaseGraphicLink();
else
bCont = false;
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 0497d6693656..9a8c4e856198 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1655,6 +1655,11 @@ void ViewShell::NotifyAccUpdate( )
GetViewShellBase().GetDrawController().NotifyAccUpdate();
}
+weld::Window* ViewShell::GetFrameWeld() const
+{
+ return mpActiveWindow ? mpActiveWindow->GetFrameWeld() : nullptr;
+}
+
sd::Window* ViewShell::GetContentWindow() const
{
return mpContentWindow.get();