diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-04-01 11:33:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-04-01 13:06:23 +0200 |
commit | 4cc7c5010f9ed93a7b112ce2f6fc72690c46ce2d (patch) | |
tree | 4f42c4b93bf367c3973765a9b55aeb4bb0670455 /editeng | |
parent | eaa3f84301affbb29378982ec7c263483e7b8571 (diff) |
add some more SvxFieldData to the model.xml dump
which I found useful in debugging
Change-Id: I28045cbedbba14633a85fa6b4ebc0b8c02f36cc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183580
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/flditem.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index ca0b9f43546a..6f51528519d0 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -31,6 +31,7 @@ #include <editeng/unonames.hxx> #include <tools/debug.hxx> +#include <libxml/xmlwriter.h> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/text/XTextContent.hpp> @@ -275,6 +276,13 @@ MetaAction* SvxFieldData::createEndComment() return new MetaCommentAction( "FIELD_SEQ_END"_ostr ); } +void SvxFieldData::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxFieldData")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("classId"), BAD_CAST(OString::number(GetClassId()).getStr())); + (void)xmlTextWriterEndElement(pWriter); +} + SvxFieldItem::SvxFieldItem( std::unique_ptr<SvxFieldData> pField, const sal_uInt16 nId ) : SfxPoolItem( nId ) @@ -317,6 +325,14 @@ bool SvxFieldItem::operator==( const SfxPoolItem& rItem ) const && ( *mpField == *pOtherFld ); } +void SvxFieldItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxFieldItem")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + if (mpField) + mpField->dumpAsXml(pWriter); + (void)xmlTextWriterEndElement(pWriter); +} // The following are the derivatives of SvxFieldData ... @@ -473,6 +489,18 @@ MetaAction* SvxURLField::createBeginComment() const 2*aURL.getLength() ); } +void SvxURLField::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxURLField")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("classId"), BAD_CAST(OString::number(GetClassId()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("format"), BAD_CAST(OString::number(static_cast<int>(eFormat)).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("url"), BAD_CAST(aURL.toUtf8().getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("representation"), BAD_CAST(aRepresentation.toUtf8().getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("targetFrame"), BAD_CAST(aTargetFrame.toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); +} + + // // SvxPageTitleField methods // |