diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-04-05 08:08:20 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-04-05 09:22:15 +0200 |
commit | 2b55a58a2b6918018eca11f8f8cd0452992f239a (patch) | |
tree | 6d8ee494abbbf3913d193df9ba5a207ed255bba4 /sw/source | |
parent | 438f0742320a5999e5ca785d152fd14a279799e1 (diff) |
sw doc model xml dump: show SwTableLine::m_aBoxes
Which means we get boxes (cells) grouped by lines (rows), instead of a
flat list of all cells in a table.
Change-Id: Ibb14c6fb26b2f4b502b18544d9a08d964c45a97e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165806
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/table/swtable.cxx | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index c71aec30e7aa..53ab9bbc465b 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1745,17 +1745,10 @@ void SwTable::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTable")); (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("table-format"), "%p", GetFrameFormat()); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("lines")); for (const auto& pLine : m_aLines) { - (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTableLine")); - (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", pLine); - pLine->GetFrameFormat()->dumpAsXml(pWriter); - (void)xmlTextWriterEndElement(pWriter); - } - (void)xmlTextWriterStartElement(pWriter, BAD_CAST("tab-sort-content-boxes")); - for (const auto& pBox : m_TabSortContentBoxes) - { - pBox->dumpAsXml(pWriter); + pLine->dumpAsXml(pWriter); } (void)xmlTextWriterEndElement(pWriter); (void)xmlTextWriterEndElement(pWriter); @@ -2001,6 +1994,23 @@ RedlineType SwTableLine::GetRedlineType() const return RedlineType::None; } +void SwTableLine::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTableLine")); + (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + + GetFrameFormat()->dumpAsXml(pWriter); + + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("boxes")); + for (const auto& pBox : m_aBoxes) + { + pBox->dumpAsXml(pWriter); + } + (void)xmlTextWriterEndElement(pWriter); + + (void)xmlTextWriterEndElement(pWriter); +} + SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, sal_uInt16 nLines, SwTableLine *pUp ) : SwClient(nullptr) , m_aLines() |