sw/source/core/inc/sectfrm.hxx    |    1 +
 sw/source/core/layout/sectfrm.cxx |   13 +++++++++++++
 sw/source/core/text/xmldump.cxx   |    3 ---
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit ee5c6039d73fee9201fa93ac7973728725422e53
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu May 11 23:38:59 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri May 12 09:52:26 2023 +0200

    sw layout xml dump: extract SwSectionFrame::dumpAsXml() from SwFrame
    
    Ideally SwFrame should not really know anything about section frames.
    
    Change-Id: I713c4646815e681c377e18ae0e1e0b77c15cf5a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151688
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index e08a9b0a7137..80d8185bc1c0 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -155,6 +155,7 @@ public:
 
     bool IsBalancedSection() const;
 
+    virtual void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
     virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override;
 
     bool IsFootnoteAtEnd() const { return m_bFootnoteAtEnd; }
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 0b1ac612bfd9..bc8930cd4332 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2941,4 +2941,17 @@ bool SwSectionFrame::IsBalancedSection() const
     return bRet;
 }
 
+void SwSectionFrame::dumpAsXml(xmlTextWriterPtr writer) const
+{
+    (void)xmlTextWriterStartElement(writer, reinterpret_cast<const 
xmlChar*>("section"));
+    dumpAsXmlAttributes(writer);
+
+    (void)xmlTextWriterStartElement(writer, BAD_CAST("infos"));
+    dumpInfosAsXml(writer);
+    (void)xmlTextWriterEndElement(writer);
+    dumpChildrenAsXml(writer);
+
+    (void)xmlTextWriterEndElement(writer);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 4c66104c12af..622dae730d88 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -174,9 +174,6 @@ void SwFrame::dumpAsXml( xmlTextWriterPtr writer ) const
 
     switch ( GetType(  ) )
     {
-    case SwFrameType::Section:
-        name = "section";
-        break;
     case SwFrameType::Tab:
         name = "tab";
         break;

Reply via email to