sw/inc/docsh.hxx                           |    1 +
 sw/source/ui/misc/titlepage.cxx            |    2 +-
 sw/source/uibase/app/docst.cxx             |    3 ++-
 sw/source/uibase/docvw/HeaderFooterWin.cxx |    2 +-
 sw/source/uibase/shells/basesh.cxx         |    2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit f4b353c1f52fc78a102413cac94c7fb24292bec6
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Nov 1 16:53:07 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Nov 1 20:36:05 2021 +0100

    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 <caol...@redhat.com>

diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 73dc9cdee19d..018c46349c1a 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 8925a60d0faf..c943b014ce2d 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 f9514a81fc5c..44e42d6f58c3 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 60ea0c1f08aa..d74c25084f14 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 da474db91901..9db7e923bdd9 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()

Reply via email to