sw/source/core/inc/rootfrm.hxx   |    2 ++
 sw/source/core/layout/newfrm.cxx |    4 ++++
 2 files changed, 6 insertions(+)

New commits:
commit ff1640fd59560a2a9c9a5685fb349b1d4c936845
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Mar 9 10:54:35 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Mar 9 18:14:31 2023 +0000

    sw layout xml dump: allow invoking this from out sw/ in a debugger
    
    This is similar to SwDoc::s_pLast, but for the layout.
    
    Change-Id: I48bb53a7595a4cec3fe47c563e91db671643d6b7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148529
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 2243759d4dda..9cf2a4f13143 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -105,6 +105,8 @@ class SW_DLLPUBLIC SwRootFrame final : public SwLayoutFrame
     static SwLayVout     *s_pVout;
     static bool           s_isInPaint; // Protection against double Paints
     static bool           s_isNoVirDev;// No virt. Device for SystemPaints
+    /// The last, still alive SwRootFrame instance, for debugging.
+    static SwRootFrame* s_pLast;
 
     /// Width of the HTML / Web document if not defined otherwise: 20cm.
     static constexpr sal_Int64 MIN_BROWSE_WIDTH = o3tl::toTwips(20000, 
o3tl::Length::mm100);
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 95af08baa6e3..85c9f3bf68c7 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -46,6 +46,7 @@
 SwLayVout     *SwRootFrame::s_pVout = nullptr;
 bool           SwRootFrame::s_isInPaint = false;
 bool           SwRootFrame::s_isNoVirDev = false;
+SwRootFrame* SwRootFrame::s_pLast = nullptr;
 
 SwCache *SwFrame::spCache = nullptr;
 
@@ -432,6 +433,8 @@ SwRootFrame::SwRootFrame( SwFrameFormat *pFormat, 
SwViewShell * pSh ) :
 {
     mnFrameType = SwFrameType::Root;
     setRootFrame( this );
+
+    s_pLast = this;
 }
 
 void SwRootFrame::Init( SwFrameFormat* pFormat )
@@ -565,6 +568,7 @@ void SwRootFrame::DestroyImpl()
 
 SwRootFrame::~SwRootFrame()
 {
+    s_pLast = nullptr;
 }
 
 void SwRootFrame::RemoveMasterObjs( SdrPage *pPg )

Reply via email to