[Libreoffice-commits] core.git: sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 16 06:19:30 UTC 2021


 sw/source/core/text/porlay.cxx |    9 +++++++++
 sw/source/core/text/porlay.hxx |    2 +-
 sw/source/core/text/porlin.cxx |    8 ++++++++
 sw/source/core/text/porlin.hxx |    4 ++++
 4 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit cf548fbcc637f2049c9c924e1ff774787cff06ec
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Sep 15 19:57:27 2021 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Sep 16 08:18:55 2021 +0200

    sw layout xml dump: show SwLinePortion
    
    Towards showing details of multi-portions.
    
    Change-Id: If086df39127483820c245fe58f2de0ddf2c98694
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122160
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index eddab2b7ea00..3b85c71fb624 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -751,6 +751,15 @@ void SwLineLayout::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
     (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwLineLayout"));
     (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+
+    const SwLinePortion* pFirstPor = GetFirstPortion();
+    pFirstPor->SwLinePortion::dumpAsXml(pWriter);
+    for (const SwLinePortion* pPor = pFirstPor->GetNextPortion(); pPor;
+         pPor = pPor->GetNextPortion())
+    {
+        pPor->dumpAsXml(pWriter);
+    }
+
     (void)xmlTextWriterEndElement(pWriter);
 }
 
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 3f2d1e478448..daeee36c7ad5 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -243,7 +243,7 @@ public:
                            const SwLinePortion* _pDontConsiderPortion = nullptr,
                            const bool _bNoFlyCntPorAndLinePor = false ) const;
 
-    virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
+    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 /// Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index c5dc41ff3db5..09283b4978e4 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -317,4 +317,12 @@ void SwLinePortion::HandlePortion( SwPortionHandler& rPH ) const
     rPH.Special( GetLen(), OUString(), GetWhichPor(), Height(), Width() );
 }
 
+void SwLinePortion::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwLinePortion"));
+    (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("symbol"), BAD_CAST(typeid(*this).name()));
+    (void)xmlTextWriterEndElement(pWriter);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 3dc7ff9e287d..6e7525a1a6ad 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -18,6 +18,8 @@
  */
 #pragma once
 
+#include <libxml/xmlwriter.h>
+
 #include "possiz.hxx"
 #include <txttypes.hxx>
 #include <TextFrameIndex.hxx>
@@ -170,6 +172,8 @@ public:
     bool GetJoinBorderWithNext() const { return m_bJoinBorderWithNext; }
     void SetJoinBorderWithPrev( const bool bJoinPrev ) { m_bJoinBorderWithPrev = bJoinPrev; }
     void SetJoinBorderWithNext( const bool bJoinNext ) { m_bJoinBorderWithNext = bJoinNext; }
+
+    virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 };
 
 inline SwLinePortion &SwLinePortion::operator=(const SwLinePortion &rPortion)


More information about the Libreoffice-commits mailing list