[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/qa sw/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Thu Sep 2 09:21:49 UTC 2021
sw/qa/extras/indexing/IndexingExportTest.cxx | 1 +
sw/source/filter/indexing/IndexingExport.cxx | 4 ++++
2 files changed, 5 insertions(+)
New commits:
commit a9b2ebe1ea5576ab1ef6e58b3da20162a056d217
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Aug 2 15:18:35 2021 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Sep 2 11:21:15 2021 +0200
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 at gmail.com>
(cherry picked from commit df3d733724de84a2b54398434b621049a326c4d8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121112
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
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..0827d4dc5ce5 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", OString("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", OString("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", OString("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", OString("1"));
m_rXmlWriter.attribute("name", pSectionNode->GetSection().GetSectionName());
maNodeStack.push_back(pSectionNode);
More information about the Libreoffice-commits
mailing list