diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-09-15 19:57:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-09-16 08:18:55 +0200 |
commit | cf548fbcc637f2049c9c924e1ff774787cff06ec (patch) | |
tree | 6c2c02412fe8c4d9445014b01ae1aacc225e0912 | |
parent | d5e55d204b71710eb5eb5d2c683dd6698626df3c (diff) |
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@collabora.com>
-rw-r--r-- | sw/source/core/text/porlay.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/text/porlay.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/porlin.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/porlin.hxx | 4 |
4 files changed, 22 insertions, 1 deletions
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) |