diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-01 19:05:48 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-04 13:20:16 +0200 |
commit | 683ba8bdbdbf718d1e26ddc0fd7e45b4aa7771a1 (patch) | |
tree | d761b81d3ba344915cd307a267190fcf60339412 /writerfilter/source | |
parent | AutoText: Reading multiple entries (diff) | |
download | core-683ba8bdbdbf718d1e26ddc0fd7e45b4aa7771a1.tar.gz core-683ba8bdbdbf718d1e26ddc0fd7e45b4aa7771a1.zip |
AutoText: read names of entries
+ extended model to parse <docPartPr> and <name> marks
+ names are inserted to the document before content
of each entry
+ SwDOCXReader interprets first paragraph of each section
as a name
Change-Id: Ib7de152ba1c6bea4f4665f98d321019c3f68863e
Reviewed-on: https://gerrit.libreoffice.org/37124
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 14 | ||||
-rw-r--r-- | writerfilter/source/ooxml/model.xml | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 94116020c8c6..003983b6e54c 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1080,6 +1080,13 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Cnf_val: m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "val", sStringValue); break; + case NS_ooxml::LN_CT_DocPartName_val: + { + // Add glossary entry name as a first paragraph in section + PropertyMapPtr pContext = m_pImpl->GetTopContext(); + m_pImpl->appendTextPortion(sStringValue, pContext); + break; + } default: SAL_WARN("writerfilter", "DomainMapper::lcl_attribute: unhandled token: " << nName); } @@ -2753,6 +2760,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) pProperties->resolve(m_pImpl->getSmartTagHandler()); } break; + case NS_ooxml::LN_CT_DocPartPr_name: + { + writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); + if (pProperties.get() != nullptr) + pProperties->resolve(*this); + } + break; default: { #ifdef DEBUG_WRITERFILTER diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 1b9b0933611d..bb1917307ff1 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -19062,6 +19062,13 @@ <action name="start" action="startGlossaryEntry"/> <action name="end" action="endGlossaryEntry"/> </resource> + <resource name="CT_DocPartPr" resource="Properties"> + <action name="start" action="startSectionGroup"/> + <element name="name" tokenid="ooxml:CT_DocPartPr_name"/> + </resource> + <resource name="CT_DocPartName" resource="Properties"> + <attribute name="val" tokenid="ooxml:CT_DocPartName_val"/> + </resource> <resource name="document" resource="Stream"/> <resource name="glossaryDocument" resource="Stream"/> <resource name="CT_TxbxContent" resource="Stream"> |