diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-01-10 11:05:58 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-01-10 14:02:26 +0000 |
commit | 5b49927760fc4b5f5563a39646e3e5fe23c7fbc5 (patch) | |
tree | a097a9dcbc450a647cc53aa871a2b6d6d831f129 | |
parent | 9be2c049db01233e521e93fb3d09651204447b74 (diff) |
sw doc model xml dump: show section names
The one in SwSectionData seems to the section name visible on the UI.
SwSectionFormat also has a name, but it looks like even the UI doesn't
bother with maintaining that on section rename, so that's not really
used anywhere, and only that was visible in the dump previously.
Change-Id: I9a7444561cee0e42d23eaf06cb4d53171603c0df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145259
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/inc/section.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index 5bcd3f0c1b9a..9e29e952cdec 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -132,6 +132,8 @@ public: bool IsConnectFlag() const { return m_bConnectFlag; } void SetConnectFlag(bool const bFlag){ m_bConnectFlag = bFlag; } + + void dumpAsXml(xmlTextWriterPtr pWriter) const; }; class SW_DLLPUBLIC SwSection diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index a92694e5b58f..46ac8308abd5 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -177,6 +177,14 @@ bool SwSectionData::operator==(SwSectionData const& rOther) const // FIXME: old code ignored m_bCondHiddenFlag m_bHiddenFlag m_bConnectFlag } +void SwSectionData::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwSectionData")); + (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("section-name"), BAD_CAST(m_sSectionName.toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); +} + SwSection::SwSection( SectionType const eType, OUString const& rName, SwSectionFormat & rFormat) : SwClient(& rFormat) @@ -1494,6 +1502,7 @@ void SwSection::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("registered-in"), "%p", GetRegisteredIn()); + m_Data.dumpAsXml(pWriter); (void)xmlTextWriterEndElement(pWriter); } |