summaryrefslogtreecommitdiff
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
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
-rw-r--r--sw/inc/txatbase.hxx2
-rw-r--r--sw/inc/txtftn.hxx1
-rw-r--r--sw/source/core/txtnode/atrftn.cxx29
-rw-r--r--sw/source/core/txtnode/txatbase.cxx5
4 files changed, 36 insertions, 1 deletions
diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx
index 90509a929309..824f28ff1bd2 100644
--- a/sw/inc/txatbase.hxx
+++ b/sw/inc/txatbase.hxx
@@ -121,7 +121,7 @@ public:
inline const SwFormatINetFormat &GetINetFormat() const;
inline const SwFormatRuby &GetRuby() const;
- void dumpAsXml(xmlTextWriterPtr pWriter) const;
+ virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
class SAL_DLLPUBLIC_RTTI SwTextAttrEnd : public virtual SwTextAttr
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 9d6aa60ff49b..c451b89e7abe 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -64,6 +64,7 @@ public:
sal_uInt16 GetSeqRefNo() const { return m_nSeqNo; }
static void SetUniqueSeqRefNo( SwDoc& rDoc );
+ void dumpAsXml(xmlTextWriterPtr pWriter) const override;
};
inline const SwTextNode& SwTextFootnote::GetTextNode() const
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;