sw/source/core/text/porexp.cxx |   13 +++++++++++++
 sw/source/core/text/porexp.hxx |    3 +++
 2 files changed, 16 insertions(+)

New commits:
commit e1572ca283cb8aad35a3c81f22aecf18aa86ab90
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Mar 10 20:17:21 2022 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Mar 11 08:09:41 2022 +0100

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

diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 29f470c1490c..6739419484f6 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -210,6 +210,19 @@ void SwBlankPortion::HandlePortion( SwPortionHandler& rPH 
) const
     rPH.Special( GetLen(), OUString( m_cChar ), GetWhichPor() );
 }
 
+void SwBlankPortion::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwBlankPortion"));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("char"),
+                                      
BAD_CAST(OUString(m_cChar).toUtf8().getStr()));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("multi"),
+                                      
BAD_CAST(OString::boolean(m_bMulti).getStr()));
+
+    SwExpandPortion::dumpAsXml(pWriter);
+
+    (void)xmlTextWriterEndElement(pWriter);
+}
+
 SwPostItsPortion::SwPostItsPortion( bool bScrpt )
     : m_bScript( bScrpt )
 {
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index 9c7be5be5aaf..1ea608c9dfa2 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -35,6 +35,7 @@ public:
     virtual void HandlePortion( SwPortionHandler& rPH ) const override;
 };
 
+/// Non-breaking space or non-breaking hyphen.
 class SwBlankPortion : public SwExpandPortion
 {
     sal_Unicode m_cChar;
@@ -54,6 +55,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 SwPostItsPortion : public SwExpandPortion

Reply via email to