sfx2/source/appl/appserv.cxx | 9 +++++++++ sw/source/uibase/wrtsh/wrtsh2.cxx | 5 +---- 2 files changed, 10 insertions(+), 4 deletions(-)
New commits: commit d7b33b1be8fee684e906f170f4001735c095056e Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Nov 23 08:53:30 2023 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Nov 23 11:48:55 2023 +0100 use SID_DOCFRAME for dialog parents if there is no SID_FILLFRAME if there is no other hint which avoids: sfx2/source/appl/appserv.cxx:314: no parent for dialogs without the need to add extra SID_FILLFRAME just to smuggle a default parent in. Change-Id: I99980c951a0046afa3cc22e02b4f79850e3b2736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159850 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index d58b62a9bf3b..9c1b3c9d2a57 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -256,6 +256,13 @@ namespace return xFrame; } + Reference<XFrame> GetDocFrame(const SfxRequest& rReq) + { + const SfxFrameItem* pFrameItem = rReq.GetArg<SfxFrameItem>(SID_DOCFRAME); + SfxFrame* pFrame = pFrameItem ? pFrameItem->GetFrame() : nullptr; + return pFrame ? pFrame->GetFrameInterface() : nullptr; + } + class LicenseDialog : public weld::GenericDialogController { public: @@ -309,6 +316,8 @@ weld::Window* SfxRequest::GetFrameWeld() const } Reference<XFrame> xFrame(GetRequestFrame(*this)); + if (!xFrame) + xFrame = GetDocFrame(*this); if (!xFrame) { SAL_WARN("sfx.appl", "no parent for dialogs"); diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 029b728bb30a..3a9e51136fd0 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -597,8 +597,6 @@ static void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter, if ((nFilter & LoadUrlFlags::NewView) && !comphelper::LibreOfficeKit::isActive()) aTargetFrameName.SetValue( "_blank" ); - SfxUnoFrameItem aDocFrame(SID_FILLFRAME, rViewFrame.GetFrame().GetFrameInterface()); - rViewFrame.GetDispatcher()->ExecuteList(SID_OPENDOC, SfxCallMode::ASYNCHRON|SfxCallMode::RECORD, { @@ -607,8 +605,7 @@ static void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter, &aReferer, &aView, &aTargetFrameName, &aBrowse - }, - { &aDocFrame } ); + }); } void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter,