diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-09-09 20:30:01 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-09-10 09:22:11 +0200 |
commit | 1c75df810439c71e975b166a66087c3d5a9ecdf3 (patch) | |
tree | e4625959266a575497b47012966d879bf16d0fb1 /sw/source | |
parent | 2752c4aaa2f9509a7c54e1814d9dee3522070fb3 (diff) |
sw layout xml dump: show SwParaPortion
Towards showing details of multi-portions, which are invisible to
XmlPortionDumper, which uses SwPortionHandler, which was introduced for
SwAccessiblePortionData, and is currently misused for debugging.
Change-Id: Ib62df8c9338855b6f03b24ca2d83b4d0e4408761
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121861
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/text/porlay.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/text/porlay.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 2aeced43f463..1af44ae369e3 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -2505,6 +2505,13 @@ const SwDropPortion *SwParaPortion::FindDropPortion() const return nullptr; } +void SwParaPortion::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwParaPortion")); + (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + (void)xmlTextWriterEndElement(pWriter); +} + void SwLineLayout::Init( SwLinePortion* pNextPortion ) { Height( 0, false ); diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx index 5234a537fa4c..3a3d458f2cf8 100644 --- a/sw/source/core/text/porlay.hxx +++ b/sw/source/core/text/porlay.hxx @@ -18,6 +18,8 @@ */ #pragma once +#include <libxml/xmlwriter.h> + #include <scriptinfo.hxx> #include <swrect.hxx> @@ -321,6 +323,8 @@ public: void SetErgoSumNum( const OUString &rErgo ); const SwDropPortion *FindDropPortion() const; + + void dumpAsXml(xmlTextWriterPtr pWriter) const; }; inline void SwParaPortion::ResetPreps() diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 03cf10e86b80..d188a0698373 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -28,6 +28,8 @@ #include <view.hxx> #include <svx/svdobj.hxx> +#include "porlay.hxx" + namespace { class XmlPortionDumper:public SwPortionHandler @@ -481,6 +483,10 @@ void SwFrame::dumpAsXml( xmlTextWriterPtr writer ) const reinterpret_cast<const xmlChar *>(aText8.getStr( )) ); XmlPortionDumper pdumper( writer, aText ); pTextFrame->VisitPortions( pdumper ); + if (const SwParaPortion* pPara = pTextFrame->GetPara()) + { + pPara->dumpAsXml(writer); + } } else |