summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-06-18 21:13:38 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-06-19 11:15:12 +0200
commit705fe1c44b41cd11518069e0627d0f48a65a7dfc (patch)
treeb5e50cdefff805697c0a73dcbdf17db89fd8072e
parentb3a62ab0a43510cf43c88aa4d6e145e46db7e7e5 (diff)
indexing: write parent index to paragraphs if possible
When writing paragraphs from a table we want to associate the parent table to the paragraphs so we also write the parent index. Change-Id: Idf9c285f08481ed0556700e92adda27027b91408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117451 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--sw/source/filter/indexing/IndexingExport.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/filter/indexing/IndexingExport.cxx b/sw/source/filter/indexing/IndexingExport.cxx
index 83bac26fc51d..b02bef0c9fe2 100644
--- a/sw/source/filter/indexing/IndexingExport.cxx
+++ b/sw/source/filter/indexing/IndexingExport.cxx
@@ -83,10 +83,17 @@ public:
void handleTextNode(SwTextNode* pTextNode)
{
+ sal_Int64 nParentIndex = -1;
+ if (!maNodeStack.empty() && maNodeStack.back())
+ {
+ nParentIndex = maNodeStack.back()->GetIndex();
+ }
const OUString& rString
= pTextNode->GetText().replaceAll(OUStringChar(CH_TXTATR_BREAKWORD), "");
m_rXmlWriter.startElement("paragraph");
m_rXmlWriter.attribute("index", pTextNode->GetIndex());
+ if (nParentIndex >= 0)
+ m_rXmlWriter.attribute("parent", nParentIndex);
m_rXmlWriter.content(rString);
m_rXmlWriter.endElement();
}