diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-06-18 21:36:29 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-06-19 11:15:30 +0200 |
commit | 2ce10eedfb1de8beef8ddfa457f1e19545846f86 (patch) | |
tree | 82eac0f63f1a0b556d86fbf697c2ff48d9e1de7d /sw/source/filter/indexing/IndexingExport.cxx | |
parent | 705fe1c44b41cd11518069e0627d0f48a65a7dfc (diff) |
indexing: indexing sections for the IndexingExport
Adds handling of sections to the IndexingExport. SectionNode also
derives from StartNode, so we handle it similar as the tables.
Change-Id: I5eb8d599bdf680144b161aa93295ea3d360eb5c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117452
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/filter/indexing/IndexingExport.cxx')
-rw-r--r-- | sw/source/filter/indexing/IndexingExport.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sw/source/filter/indexing/IndexingExport.cxx b/sw/source/filter/indexing/IndexingExport.cxx index b02bef0c9fe2..17a1670bd73c 100644 --- a/sw/source/filter/indexing/IndexingExport.cxx +++ b/sw/source/filter/indexing/IndexingExport.cxx @@ -56,8 +56,11 @@ public: { handleTableNode(pNode->GetTableNode()); } - - if (pNode->IsEndNode()) + else if (pNode->IsSectionNode()) + { + handleSectionNode(pNode->GetSectionNode()); + } + else if (pNode->IsEndNode()) { handleEndNode(pNode->GetEndNode()); } @@ -138,6 +141,15 @@ public: maNodeStack.push_back(pTableNode); } + void handleSectionNode(SwSectionNode* pSectionNode) + { + m_rXmlWriter.startElement("section"); + m_rXmlWriter.attribute("index", pSectionNode->GetIndex()); + m_rXmlWriter.attribute("name", pSectionNode->GetSection().GetSectionName()); + + maNodeStack.push_back(pSectionNode); + } + void handleEndNode(SwEndNode* pEndNode) { if (!maNodeStack.empty() && pEndNode->StartOfSectionNode() == maNodeStack.back()) |