diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-09 11:56:35 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-10 12:04:17 +0200 |
commit | 5841441ed9c0b78286706145b01ddd3f8111455c (patch) | |
tree | dc6a4fee6cac35aa556fe7ad9a8d7d54db8c4df3 /writerfilter/source | |
parent | tdf#86001: Pass on the language info from the cell to the engine. (diff) | |
download | core-5841441ed9c0b78286706145b01ddd3f8111455c.tar.gz core-5841441ed9c0b78286706145b01ddd3f8111455c.zip |
AutoText: add only real AutoText entries
* add only autoTxT gallery type
* new test with other types of entries
Change-Id: Ibf7751c73dcf3b6ebd69eec5f4931dbeaaf098c8
Reviewed-on: https://gerrit.libreoffice.org/37425
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit a470d16208a78ae6893d199b3b6bc77a8559b06a)
Reviewed-on: https://gerrit.libreoffice.org/37460
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 29 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.hxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 2 | ||||
-rw-r--r-- | writerfilter/source/ooxml/model.xml | 10 |
5 files changed, 35 insertions, 11 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 003983b6e54c..2fe1705bde61 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1082,9 +1082,18 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) 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); + m_sGlossaryEntryName = sStringValue; + break; + } + case NS_ooxml::LN_CT_DocPartGallery_val: + { + OUString sGlossaryEntryGallery = sStringValue; + if(m_pImpl->GetTopContext().get()) + { + OUString sName = sGlossaryEntryGallery + ":" + m_sGlossaryEntryName; + // Add glossary entry name as a first paragraph in section + m_pImpl->appendTextPortion(sName, m_pImpl->GetTopContext()); + } break; } default: @@ -2767,6 +2776,20 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) pProperties->resolve(*this); } break; + case NS_ooxml::LN_CT_DocPartPr_category: + { + writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); + if (pProperties.get() != nullptr) + pProperties->resolve(*this); + } + break; + case NS_ooxml::LN_CT_DocPartCategory_gallery: + { + 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/dmapper/DomainMapper.hxx b/writerfilter/source/dmapper/DomainMapper.hxx index 7a346884d642..f509efef8870 100644 --- a/writerfilter/source/dmapper/DomainMapper.hxx +++ b/writerfilter/source/dmapper/DomainMapper.hxx @@ -166,6 +166,7 @@ private: bool mbIsSplitPara; std::unique_ptr< GraphicZOrderHelper > zOrderHelper; std::unique_ptr<GraphicNamingHelper> m_pGraphicNamingHelper; + OUString m_sGlossaryEntryName; }; } // namespace dmapper diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 5ae6f3f2b14f..47ae4e654438 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1537,9 +1537,9 @@ uno::Reference< beans::XPropertySet > DomainMapper_Impl::appendTextSectionAfter( return xRet; } -uno::Reference< beans::XPropertySet > DomainMapper_Impl::appendGlossaryEntry() +void DomainMapper_Impl::appendGlossaryEntry() { - return appendTextSectionAfter(m_xGlossaryEntryStart); + appendTextSectionAfter(m_xGlossaryEntryStart); } void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::PageType eType) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 7bd388025305..6823e741619d 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -560,7 +560,7 @@ public: css::uno::Reference<css::beans::XPropertySet> appendTextSectionAfter(css::uno::Reference<css::text::XTextRange>& xBefore); /// AutoText import: each entry is placed in the separate section - css::uno::Reference<css::beans::XPropertySet> appendGlossaryEntry(); + void appendGlossaryEntry(); /// Remember where entry was started void setGlossaryEntryStart( css::uno::Reference<css::text::XTextRange>& xStart ) { diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index bb1917307ff1..b79f290cfc9d 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -19006,9 +19006,8 @@ <attribute name="val" tokenid="ooxml:CT_DocPartType_val" action="setValue"/> <action name="start" action="setDefaultStringValue"/> </resource> - <resource name="CT_DocPartGallery" resource="Value"> - <attribute name="val" tokenid="ooxml:CT_DocPartGallery_val" action="setValue"/> - <action name="start" action="setDefaultStringValue"/> + <resource name="CT_DocPartGallery" resource="Properties"> + <attribute name="val" tokenid="ooxml:CT_DocPartGallery_val"/> </resource> <resource name="CT_DocPartName" resource="Properties"> <attribute name="val" tokenid="ooxml:CT_DocPartName_val"/> @@ -19065,9 +19064,10 @@ <resource name="CT_DocPartPr" resource="Properties"> <action name="start" action="startSectionGroup"/> <element name="name" tokenid="ooxml:CT_DocPartPr_name"/> + <element name="category" tokenid="ooxml:CT_DocPartPr_category"/> </resource> - <resource name="CT_DocPartName" resource="Properties"> - <attribute name="val" tokenid="ooxml:CT_DocPartName_val"/> + <resource name="CT_DocPartCategory" resource="Properties"> + <element name="gallery" tokenid="ooxml:CT_DocPartCategory_gallery"/> </resource> <resource name="document" resource="Stream"/> <resource name="glossaryDocument" resource="Stream"/> |