sw/source/core/text/xmldump.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
New commits: commit 20caf52668931a49e5a93267c7760d133298fb70 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Apr 13 20:04:27 2021 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Jun 21 11:55:46 2022 +0200 sw: layout dump: sorted_objs of SwPageFrame Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114065 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 3d64587c53eea47674d51e84622a167db1635909) Change-Id: I2bf8493744d054c513ab9b65136b6e29e9aa07f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136179 Tested-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index b93577838258..147ed5a97eb7 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -15,6 +15,7 @@ #include <pagefrm.hxx> #include <txtfrm.hxx> #include <cellfrm.hxx> +#include <flyfrm.hxx> #include <hffrm.hxx> #include <rootfrm.hxx> #include <editsh.hxx> @@ -350,6 +351,29 @@ void SwFrame::dumpAsXml( xmlTextWriterPtr writer ) const OUString aFormatName = pPageFrame->GetPageDesc()->GetName(); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("pageDesc"), "%s", BAD_CAST(OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr())); xmlTextWriterEndElement(writer); +#ifdef UNX + // disable for tests to avoid resolving loads of merge conflicts (var is only set on UNX in this branch) + if (!getenv("LO_TESTNAME")) if (auto const* pObjs = pPageFrame->GetSortedObjs()) + { + (void)xmlTextWriterStartElement(writer, BAD_CAST("sorted_objs")); + for (SwAnchoredObject const*const pObj : *pObjs) + { // just print pointer, full details will be printed on its anchor frame + // this nonsense is needed because of multiple inheritance + if (SwFlyFrame const*const pFly = dynamic_cast<SwFlyFrame const*>(pObj)) + { + (void)xmlTextWriterStartElement(writer, BAD_CAST("fly")); + (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("ptr"), "%p", pFly); + } + else + { + (void)xmlTextWriterStartElement(writer, BAD_CAST(pObj->getElementName())); + (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("ptr"), "%p", pObj); + } + (void)xmlTextWriterEndElement(writer); + } + (void)xmlTextWriterEndElement(writer); + } +#endif } if (IsTextFrame())