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

New commits:
commit 9c75a7c950c6315b5f839d2711fb9ec0890739b8
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Mar 9 19:55:54 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Mar 10 08:35:50 2023 +0000

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

diff --git a/sw/source/core/inc/colfrm.hxx b/sw/source/core/inc/colfrm.hxx
index b481897f03f4..a223dfa8032a 100644
--- a/sw/source/core/inc/colfrm.hxx
+++ b/sw/source/core/inc/colfrm.hxx
@@ -33,6 +33,8 @@ public:
 
     virtual void PaintBreak() const override;
     virtual void PaintSubsidiaryLines(const SwPageFrame*, const SwRect&) const 
override;
+
+    void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
 };
 
 #endif // INCLUDED_SW_SOURCE_CORE_INC_COLFRM_HXX
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 4b13576a7b0b..872bdc44aef1 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <libxml/xmlwriter.h>
+
 #include <editeng/ulspitem.hxx>
 #include <osl/diagnose.h>
 #include <fmtclds.hxx>
@@ -66,6 +68,19 @@ SwColumnFrame::~SwColumnFrame()
 {
 }
 
+void SwColumnFrame::dumpAsXml(xmlTextWriterPtr writer) const
+{
+    (void)xmlTextWriterStartElement(writer, reinterpret_cast<const 
xmlChar*>("column"));
+    dumpAsXmlAttributes(writer);
+
+    (void)xmlTextWriterStartElement(writer, BAD_CAST("infos"));
+    dumpInfosAsXml(writer);
+    (void)xmlTextWriterEndElement(writer);
+    dumpChildrenAsXml(writer);
+
+    (void)xmlTextWriterEndElement(writer);
+}
+
 static void lcl_RemoveColumns( SwLayoutFrame *pCont, sal_uInt16 nCnt )
 {
     OSL_ENSURE( pCont && pCont->Lower() && pCont->Lower()->IsColumnFrame(),
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index f204b5c6d32a..e9abb27e6718 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::Column:
-        name = "column";
-        break;
     case SwFrameType::Header:
         name = "header";
         break;

Reply via email to