summaryrefslogtreecommitdiff
path: root/sw/source/ui/chrdlg
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-01 16:38:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-01 20:35:49 +0100
commite78a519285a5d2ca5ccc9ae6a5fda81975fa38d7 (patch)
tree3e0e8683ecfe0e41470ef780489050177b3f0f21 /sw/source/ui/chrdlg
parentd1ff9c1d650ada0049c867d76ba38890633a444c (diff)
tdf#145363 provide an explicit parent for numbering-style dialog
when launched from another dialog let it take that as the parent Change-Id: I64247b0b670c3e44176b6323c074cfd0711feefb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124558 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/chrdlg')
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index e57009b3b1fb..95b533c9c6bb 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -30,6 +30,7 @@
#include <numpara.hxx>
#include <sfx2/dispatch.hxx>
+#include <sfx2/frame.hxx>
#include <sfx2/viewsh.hxx>
const WhichRangesContainer SwParagraphNumTabPage::aPageRg(svl::Items<FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT>);
@@ -306,7 +307,6 @@ IMPL_LINK_NOARG(SwParagraphNumTabPage, EditNumStyleHdl_Impl, weld::Button&, void
bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl(
sal_uInt16 nId, const OUString &rStr, SfxStyleFamily nFamily)
{
-
SfxDispatcher &rDispatcher = *SfxViewShell::Current()->GetDispatcher();
SfxStringItem aItem(nId, rStr);
SfxUInt16Item aFamily(SID_STYLE_FAMILY, static_cast<sal_uInt16>(nFamily));
@@ -318,9 +318,16 @@ bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl(
pItems[ nCount++ ] = nullptr;
+ // tdf#145363 we want the current dialog to be the parent of the new dialog
+ weld::Window* pDialogParent = GetFrameWeld();
+ css::uno::Any aAny(pDialogParent->GetXWindow());
+ SfxUnoAnyItem aDialogParent(SID_DIALOG_PARENT, aAny);
+ const SfxPoolItem* pInternalItems[ 1 ];
+ pInternalItems[ 0 ] = &aDialogParent;
+
const SfxPoolItem* pItem = rDispatcher.Execute(
nId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
- pItems );
+ pItems, 0, pInternalItems);
return pItem != nullptr;