[Libreoffice-commits] core.git: sw/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jun 19 09:15:58 UTC 2021
sw/source/filter/indexing/IndexingExport.cxx | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 705fe1c44b41cd11518069e0627d0f48a65a7dfc
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Jun 18 21:13:38 2021 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Jun 19 11:15:12 2021 +0200
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 at gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
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();
}
More information about the Libreoffice-commits
mailing list