sw/inc/dbfld.hxx | 1 + sw/source/core/fields/dbfld.cxx | 13 +++++++++++++ 2 files changed, 14 insertions(+)
New commits: commit 94a9dff34a0484b641fb898223de60c08c999a23 Author: Miklos Vajna <[email protected]> AuthorDate: Tue Oct 21 08:23:15 2025 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Tue Oct 21 12:52:08 2025 +0200 sw doc model xml dump: handle SwDBField Otherwise the expanded field value is not visible in the dump, which was interesting when working on tdf#168688. Change-Id: I8ed84bbb233d18f97de3c519d6e07473d1ecd790 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192777 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx index 867804802806..132a5de5241c 100644 --- a/sw/inc/dbfld.hxx +++ b/sw/inc/dbfld.hxx @@ -108,6 +108,7 @@ public: static bool FormatValue( SvNumberFormatter const * pDocFormatter, OUString const &aString, sal_uInt32 nFormat, double &aNumber, sal_Int32 nColumnType, SwDBField *pField = nullptr ); + void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; inline void SwDBField::SetExpansion(const OUString& rStr) diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 573269e1ae01..119f34273e57 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -300,6 +300,19 @@ bool SwDBField::FormatValue( SvNumberFormatter const * pDocFormatter, OUString c return bValidValue; } +void SwDBField::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwDBField")); + SwValueField::dumpAsXml(pWriter); + + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("content")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), + BAD_CAST(m_aContent.toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); + + (void)xmlTextWriterEndElement(pWriter); +} + /// get current field value and cache it void SwDBField::Evaluate() {
