diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-09 09:54:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-05-09 15:51:56 +0200 |
commit | 2479ab8b788ca000f2e979d0858de8d05de8e858 (patch) | |
tree | 63de5f4b7ec9ca579c9128c9ee5cbdef59c60b9c /sfx2 | |
parent | 5c0653a4184ebf5353263083bd7b4818f7cd6c2e (diff) |
add a way to specify SfxRequest preferred dialog parent
when the parent isn't a XFrame, i.e. want the parent to be an open
dialog
Change-Id: I2dfaac1fd057095de154de549e9f395ce30d118b
Reviewed-on: https://gerrit.libreoffice.org/72034
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index c8e3bfd77124..c533c345330e 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -361,6 +361,17 @@ vcl::Window* SfxRequest::GetFrameWindow() const weld::Window* SfxRequest::GetFrameWeld() const { + const SfxItemSet* pIntArgs = GetInternalArgs_Impl(); + const SfxPoolItem* pItem = nullptr; + if (pIntArgs && pIntArgs->GetItemState(SID_DIALOG_PARENT, false, &pItem) == SfxItemState::SET) + { + assert(dynamic_cast<const SfxUnoAnyItem*>(pItem)); + auto aAny = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); + Reference<awt::XWindow> xWindow; + aAny >>= xWindow; + return Application::GetFrameWeld(xWindow); + } + vcl::Window* pWin = GetFrameWindow(); return pWin ? pWin->GetFrameWeld() : nullptr; } |