summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-08-02 15:18:35 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-08-10 08:09:05 +0200
commitdf3d733724de84a2b54398434b621049a326c4d8 (patch)
tree7e5386cbe3849ca90177b20169d026f119ebf1ab
parentea1818b8ba34378b777b8706069d28fade2cc924 (diff)
indexing: add "type" to the xml for paragraph nodes
The type is either WriterNode (1) or SdrObect (2) as we need to know for which one the index is refering to. Change-Id: I0f4bc95d91e37cf75db5ed49cd14df61133f5f19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120193 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--sw/qa/extras/indexing/IndexingExportTest.cxx1
-rw-r--r--sw/source/filter/indexing/IndexingExport.cxx4
2 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/extras/indexing/IndexingExportTest.cxx b/sw/qa/extras/indexing/IndexingExportTest.cxx
index 41cbfa1c9d79..346ff783d2c4 100644
--- a/sw/qa/extras/indexing/IndexingExportTest.cxx
+++ b/sw/qa/extras/indexing/IndexingExportTest.cxx
@@ -74,6 +74,7 @@ void IndexingExportTest::testIndexingExport_Paragraphs()
assertXPath(pXmlDoc, "/indexing");
assertXPathContent(pXmlDoc, "/indexing/paragraph[1]", "Title");
+ assertXPath(pXmlDoc, "/indexing/paragraph[1]", "type", "1");
assertXPathContent(pXmlDoc, "/indexing/paragraph[2]", "Heading 1");
assertXPathContent(pXmlDoc, "/indexing/paragraph[3]", "Heading 2");
assertXPathContent(pXmlDoc, "/indexing/paragraph[4]", "Paragraph 1");
diff --git a/sw/source/filter/indexing/IndexingExport.cxx b/sw/source/filter/indexing/IndexingExport.cxx
index 17a1670bd73c..c7bf032ba83e 100644
--- a/sw/source/filter/indexing/IndexingExport.cxx
+++ b/sw/source/filter/indexing/IndexingExport.cxx
@@ -95,6 +95,7 @@ public:
= pTextNode->GetText().replaceAll(OUStringChar(CH_TXTATR_BREAKWORD), "");
m_rXmlWriter.startElement("paragraph");
m_rXmlWriter.attribute("index", pTextNode->GetIndex());
+ m_rXmlWriter.attribute("type", "1");
if (nParentIndex >= 0)
m_rXmlWriter.attribute("parent", nParentIndex);
m_rXmlWriter.content(rString);
@@ -121,6 +122,7 @@ public:
m_rXmlWriter.startElement("paragraph");
m_rXmlWriter.attribute("index", nParagraph);
+ m_rXmlWriter.attribute("type", "2");
m_rXmlWriter.content(sText);
m_rXmlWriter.endElement();
}
@@ -136,6 +138,7 @@ public:
m_rXmlWriter.startElement("table");
m_rXmlWriter.attribute("index", pTableNode->GetIndex());
+ m_rXmlWriter.attribute("type", "1");
m_rXmlWriter.attribute("name", sName);
maNodeStack.push_back(pTableNode);
@@ -145,6 +148,7 @@ public:
{
m_rXmlWriter.startElement("section");
m_rXmlWriter.attribute("index", pSectionNode->GetIndex());
+ m_rXmlWriter.attribute("type", "1");
m_rXmlWriter.attribute("name", pSectionNode->GetSection().GetSectionName());
maNodeStack.push_back(pSectionNode);