sw/source/core/inc/hffrm.hxx    |    2 ++
 sw/source/core/layout/hffrm.cxx |   13 +++++++++++++
 sw/source/core/text/xmldump.cxx |    3 ---
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 456b02476f2c8f101479db88087d93b2f57bc75e
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Mar 16 20:21:25 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Mar 17 07:18:26 2023 +0000

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

diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx
index 310e57d7e0c0..d8f9f0556265 100644
--- a/sw/source/core/inc/hffrm.hxx
+++ b/sw/source/core/inc/hffrm.hxx
@@ -44,6 +44,8 @@ class SwHeaderFrame final : public SwHeadFootFrame
 {
 public:
     SwHeaderFrame( SwFrameFormat* pFrame, SwFrame* pSib ) : 
SwHeadFootFrame(pFrame, pSib, SwFrameType::Header) {};
+
+    void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
 };
 
 /// Footer in the document layout, inside a page.
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index a8e9bfa5a45c..10c69f9a9bc1 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -765,4 +765,17 @@ void SwPageFrame::PrepareFooter()
     }
 }
 
+void SwHeaderFrame::dumpAsXml(xmlTextWriterPtr writer) const
+{
+    (void)xmlTextWriterStartElement(writer, reinterpret_cast<const 
xmlChar*>("header"));
+    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 e9abb27e6718..a7db17625cf9 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::Header:
-        name = "header";
-        break;
     case SwFrameType::Footer:
         name = "footer";
         break;

Reply via email to