sw/source/core/text/portxt.cxx |   11 +++++++++++
 sw/source/core/text/portxt.hxx |    2 ++
 2 files changed, 13 insertions(+)

New commits:
commit 9fd5446c6f3281789ed21847f25cf56ce84dd395
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Mar 24 20:44:43 2022 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Mar 25 08:02:48 2022 +0100

    sw layout xml dump: handle hole portions
    
    Show their blank width.
    
    Change-Id: I8753c9ea4c861eae4618472f8ea24ea86576f251
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132089
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 219036aa834d..112eb26328b8 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -792,6 +792,17 @@ void SwHolePortion::HandlePortion( SwPortionHandler& rPH ) 
const
     rPH.Text( GetLen(), GetWhichPor() );
 }
 
+void SwHolePortion::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwHolePortion"));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("blank-width"),
+                                      
BAD_CAST(OString::number(m_nBlankWidth).getStr()));
+
+    SwLinePortion::dumpAsXml(pWriter);
+
+    (void)xmlTextWriterEndElement(pWriter);
+}
+
 void SwFieldMarkPortion::Paint( const SwTextPaintInfo & /*rInf*/) const
 {
     // These shouldn't be painted!
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index ec44a2bafc76..297fca5e8525 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -73,6 +73,8 @@ public:
 
     // Accessibility: pass information about this portion to the PortionHandler
     virtual void HandlePortion( SwPortionHandler& rPH ) const override;
+
+    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 class SwFieldMarkPortion : public SwTextPortion

Reply via email to