summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-09 12:34:28 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-02-09 15:01:25 +0100
commit0239f033f77eeaac5ae3d74f2a9cb273cf0bfd41 (patch)
tree2e06398b92ab1ba1e19defc4c328e870fb86d7e4 /sw/source
parent2b042a343d25294360972492e36cb84e448eb211 (diff)
sw doc model xml dump: show more details of SwTextFootnote
Most importantly the node index of the referred footnote. Change-Id: Ibfa333a57052ffd5c9d7edab960f72041348c9fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110632 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/txtnode/atrftn.cxx29
-rw-r--r--sw/source/core/txtnode/txatbase.cxx5
2 files changed, 34 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 02188cf011de..a621f2a41902 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <libxml/xmlwriter.h>
+
#include <fmtftn.hxx>
#include <doc.hxx>
@@ -576,4 +578,31 @@ void SwTextFootnote::CheckCondColl()
//FEATURE::CONDCOLL
}
+void SwTextFootnote::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFootnote"));
+ SwTextAttr::dumpAsXml(pWriter);
+
+ if (m_pStartNode)
+ {
+ xmlTextWriterStartElement(pWriter, BAD_CAST("m_pStartNode"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"),
+ BAD_CAST(OString::number(m_pStartNode->GetIndex()).getStr()));
+ xmlTextWriterEndElement(pWriter);
+ }
+ if (m_pTextNode)
+ {
+ xmlTextWriterStartElement(pWriter, BAD_CAST("m_pTextNode"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"),
+ BAD_CAST(OString::number(m_pTextNode->GetIndex()).getStr()));
+ xmlTextWriterEndElement(pWriter);
+ }
+ xmlTextWriterStartElement(pWriter, BAD_CAST("m_nSeqNo"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
+ BAD_CAST(OString::number(m_nSeqNo).getStr()));
+ xmlTextWriterEndElement(pWriter);
+
+ xmlTextWriterEndElement(pWriter);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx
index 7f46fd178f37..cf4583f1473a 100644
--- a/sw/source/core/txtnode/txatbase.cxx
+++ b/sw/source/core/txtnode/txatbase.cxx
@@ -89,6 +89,9 @@ void SwTextAttrEnd::SetEnd(sal_Int32 n)
void SwTextAttr::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextAttr"));
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s",
+ BAD_CAST(typeid(*this).name()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("start"), BAD_CAST(OString::number(m_nStart).getStr()));
if (End())
@@ -154,6 +157,8 @@ void SwTextAttr::dumpAsXml(xmlTextWriterPtr pWriter) const
case RES_TXTATR_INPUTFIELD:
GetFormatField().dumpAsXml(pWriter);
break;
+ case RES_TXTATR_FTN:
+ break;
default:
SAL_WARN("sw.core", "Unhandled TXTATR");
break;