summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-08 10:34:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-09 10:07:13 +0200
commit200626e41f004b6b8588f89fa3707c71ae2b375c (patch)
treef81bf21c9442ea75d80d1ceb7f1cc3ad11ca71fa /sfx2
parentce9f23c6196b17985d14e441aa93175b31650f34 (diff)
remove need for an intermediate vcl::Window
Change-Id: I59f24888e47ec17e46bf651d8530fc9468f16f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113795 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/app.cxx3
-rw-r--r--sfx2/source/doc/objserv.cxx12
-rw-r--r--sfx2/source/doc/objxtor.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx5
-rw-r--r--sfx2/source/view/viewsh.cxx6
5 files changed, 17 insertions, 11 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index bad0e60b41b4..89bc3fdc50ea 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <basic/basmgr.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
#include <sfx2/sfxhelp.hxx>
#include <sfx2/progress.hxx>
#include <sfx2/objsh.hxx>
@@ -415,7 +416,7 @@ IMPL_STATIC_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBas
const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
std::shared_ptr<weld::MessageDialog> xBox;
xBox.reset(Application::CreateMessageDialog(
- pViewFrame->GetWindow().GetFrameWeld(),
+ pViewFrame->GetFrameWeld(),
VclMessageType::Error,
VclButtonsType::Ok,
aError,
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index c368755816d2..46d69bd1dd4b 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -334,7 +334,7 @@ void SfxObjectShell::CheckOut( )
}
catch ( const uno::RuntimeException& e )
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetWindow().GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok, e.Message));
xBox->run();
}
@@ -353,7 +353,7 @@ void SfxObjectShell::CancelCheckOut( )
}
catch ( const uno::RuntimeException& e )
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetWindow().GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok, e.Message));
xBox->run();
}
@@ -365,7 +365,7 @@ void SfxObjectShell::CheckIn( )
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
// Pop up dialog to ask for comment and major
- SfxCheckinDialog checkinDlg(GetFrame()->GetWindow().GetFrameWeld());
+ SfxCheckinDialog checkinDlg(GetFrame()->GetFrameWeld());
if (checkinDlg.run() == RET_OK)
{
xCmisDoc->checkIn(checkinDlg.IsMajor(), checkinDlg.GetComment());
@@ -376,7 +376,7 @@ void SfxObjectShell::CheckIn( )
}
catch ( const uno::RuntimeException& e )
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetWindow().GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok, e.Message));
xBox->run();
}
@@ -391,7 +391,7 @@ uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( ) const
}
catch ( const uno::RuntimeException& e )
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetWindow().GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrame()->GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok, e.Message));
xBox->run();
}
@@ -475,7 +475,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if (!pFrame)
pFrame = SfxViewFrame::GetFirst(this);
if (pFrame)
- pDialogParent = pFrame->GetWindow().GetFrameWeld();
+ pDialogParent = pFrame->GetFrameWeld();
}
sal_uInt16 nId = rReq.GetSlot();
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index d52bf51c3eed..6c6c7852c8d2 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -557,7 +557,7 @@ bool SfxObjectShell::PrepareClose
{
const Reference<XTitle> xTitle(*pImpl->pBaseModel, UNO_QUERY_THROW);
const OUString sTitle = xTitle->getTitle ();
- nRet = ExecuteQuerySaveDocument(pFrame->GetWindow().GetFrameWeld(), sTitle);
+ nRet = ExecuteQuerySaveDocument(pFrame->GetFrameWeld(), sTitle);
}
/*HACK for plugin::destroy()*/
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 360ed8f75adb..596d8ab3d9fb 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2512,6 +2512,11 @@ vcl::Window& SfxViewFrame::GetWindow() const
return m_pImpl->pWindow ? *m_pImpl->pWindow : GetFrame().GetWindow();
}
+weld::Window* SfxViewFrame::GetFrameWeld() const
+{
+ return GetWindow().GetFrameWeld();
+}
+
bool SfxViewFrame::DoClose()
{
return GetFrame().DoClose();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index d3554ed0be1a..671e6888e102 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -447,7 +447,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
{
SfxObjectShell* pDoc = GetObjectShell();
if ( pDoc && pDoc->QueryHiddenInformation(
- HiddenWarningFact::WhenSaving, GetViewFrame()->GetWindow().GetFrameWeld() ) != RET_YES )
+ HiddenWarningFact::WhenSaving, GetViewFrame()->GetFrameWeld() ) != RET_YES )
break;
@@ -507,7 +507,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
SfxBluetoothModel aModel;
SfxObjectShell* pDoc = GetObjectShell();
if ( pDoc && pDoc->QueryHiddenInformation(
- HiddenWarningFact::WhenSaving, GetViewFrame()->GetWindow().GetFrameWeld() ) != RET_YES )
+ HiddenWarningFact::WhenSaving, GetViewFrame()->GetFrameWeld() ) != RET_YES )
break;
uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
SfxMailModel::SendMailResult eResult = aModel.SaveAndSend( xFrame );
@@ -1133,7 +1133,7 @@ bool SfxViewShell::PrepareClose
{
if ( bUI )
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetViewFrame()->GetWindow().GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetViewFrame()->GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SfxResId(STR_CANT_CLOSE)));
xBox->run();