Kaydet (Commit) 2479ab8b authored tarafından Caolán McNamara's avatar Caolán McNamara

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: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 5c0653a4
......@@ -259,8 +259,9 @@ class SvxSearchItem;
#define SID_NO_EMBEDDED_DS TypedWhichId<SfxBoolItem>(SID_SFX_START + 1731)
#define SID_IS_REDACT_MODE (SID_SFX_START + 1733)
#define SID_REDACTION_STYLE (SID_SFX_START + 1734)
#define SID_DIALOG_PARENT (SID_SFX_START + 1735)
// SID_SFX_free_START (SID_SFX_START + 1735)
// SID_SFX_free_START (SID_SFX_START + 1736)
// SID_SFX_free_END (SID_SFX_START + 3999)
#define SID_OPEN_NEW_VIEW (SID_SFX_START + 520)
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment