diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-23 08:53:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-23 11:48:55 +0100 |
commit | d7b33b1be8fee684e906f170f4001735c095056e (patch) | |
tree | 491373177b1440e9002e10c03dc20d0174d7dbb9 /sfx2 | |
parent | 93aa534cee0ab74b9ad4b72b739e9a26c6dfc129 (diff) |
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.mcnamara@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
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: @@ -310,6 +317,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"); return nullptr; |