sw/source/core/fields/fldbas.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 02fa0d84262e35fc5c0ef763eedd3d5eb0ab107f Author: Miklos Vajna <[email protected]> AuthorDate: Fri Feb 9 08:34:07 2024 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Feb 9 15:32:49 2024 +0100 sw doc model xml dump: SwFieldType doesn't own its format fields The field type doesn't own its format fields, is just aware of them. So just show the pointer there, the matching text attribuet will do a full dump, as it's the owner. This fixes dumping e.g. post-it fields twice for no reason. Change-Id: I3ff40da059d25eddc87a2ce329c29af5f01d049c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163153 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index b3fab811f1c2..655a3a16f7df 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -164,7 +164,11 @@ void SwFieldType::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name())); for(const auto pFormatField: vFields) - pFormatField->dumpAsXml(pWriter); + { + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatField")); + (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", pFormatField); + (void)xmlTextWriterEndElement(pWriter); + } (void)xmlTextWriterEndElement(pWriter); }
