Related: tdf#145363 provide an explicit parent for page format
when launched from another dialog let it take that as the parent
Change-Id: I07bfe03717cbe140301060e6e85bdbdef953bf5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124560
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 73dc9cd..018c463 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -263,6 +263,7 @@ public:
/// @param nSlot
/// Identifies slot by which the dialog is triggered. Used to activate certain dialog pane
void FormatPage(
weld::Window* pDialogParent,
const OUString& rPage,
const OString& rPageId,
SwWrtShell& rActShell,
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index 8925a60..c943b01 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -257,7 +257,7 @@ SwTitlePageDlg::~SwTitlePageDlg()
IMPL_LINK_NOARG(SwTitlePageDlg, EditHdl, weld::Button&, void)
{
SwView& rView = mrSh.GetView();
rView.GetDocShell()->FormatPage(m_xPagePropertiesLB->get_active_text(), "page", mrSh);
rView.GetDocShell()->FormatPage(getDialog(), m_xPagePropertiesLB->get_active_text(), "page", mrSh);
rView.InvalidateRulerPos();
}
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index f9514a8..44e42d6 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -1628,12 +1628,13 @@ void SwDocShell::LoadStyles_( SfxObjectShell& rSource, bool bPreserveCurrentDocu
}
void SwDocShell::FormatPage(
weld::Window* pDialogParent,
const OUString& rPage,
const OString& rPageId,
SwWrtShell& rActShell,
SfxRequest* pRequest)
{
Edit(nullptr, rPage, OUString(), SfxStyleFamily::Page, SfxStyleSearchBits::Auto, false, rPageId, &rActShell, pRequest);
Edit(pDialogParent, rPage, OUString(), SfxStyleFamily::Page, SfxStyleSearchBits::Auto, false, rPageId, &rActShell, pRequest);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 60ea0c1..d74c250 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -427,7 +427,7 @@ void SwHeaderFooterWin::ExecuteCommand(std::string_view rIdent)
if (rIdent == "edit")
{
OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
rView.GetDocShell()->FormatPage(rView.GetFrameWeld(), rStyleName, sPageId, rSh);
}
else if (rIdent == "borderback")
{
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index da474db..9db7e92 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2639,7 +2639,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
sPageId = OUStringToOString(static_cast<const SfxStringItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);
break;
}
rTempView.GetDocShell()->FormatPage(rPageDesc.GetName(), sPageId, rSh, &rReq);
rTempView.GetDocShell()->FormatPage(rReq.GetFrameWeld(), rPageDesc.GetName(), sPageId, rSh, &rReq);
rTempView.InvalidateRulerPos();
bDone = true; // FormatPage() takes care of calling Done()