diff options
author | Justin Luth <justin_luth@sil.org> | 2018-07-17 09:24:58 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-07-24 06:09:20 +0200 |
commit | 0fbf627a4beca383c25cc50cfa9d555f18fade53 (patch) | |
tree | 29c17cea5a2f2d2734dda9d8dec59e509b854ead /writerfilter | |
parent | ea96a4815e456295ca7454475e54cd8b0ba5c388 (diff) |
tdf#72560 writerfilter: StyleProperty - also check DocDefaults
Styles without parents still have inheritance - from the DocDefaults.
So, make sure to check those properties too in
GetPropertyFromStyleSheet() (and therefore also in GetAnyProperty).
Currently, this should only impact when InStyleSheetImport(),
but if the docDefaults ever find a way to naturally migrate
into LO as doc defaults and not into the style itself, then
this will also be useful to check for paragraph properties etc.
Change-Id: Ic02cd10c104c0330684308f1380a77009206a664
Reviewed-on: https://gerrit.libreoffice.org/57805
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.hxx | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 7f0bbedfe4e0..6bfb6d7b65b6 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -715,6 +715,16 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) pEntry = pNewEntry; } + // not found in style, try the document's DocDefault properties + { + const PropertyMapPtr& pDefaultParaProps = GetStyleSheetTable()->GetDefaultParaProps(); + if ( pDefaultParaProps ) + { + boost::optional<PropertyMap::Property> aProperty = pDefaultParaProps->getProperty(eId); + if ( aProperty ) + return aProperty->second; + } + } return uno::Any(); } diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 2c7307a68d5c..8e71f5f28f2d 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -394,6 +394,11 @@ StyleSheetTable::~StyleSheetTable() { } +PropertyMapPtr const & StyleSheetTable::GetDefaultParaProps() +{ + return m_pImpl->m_pDefaultParaProps; +} + PropertyMapPtr const & StyleSheetTable::GetDefaultCharProps() { return m_pImpl->m_pDefaultCharProps; diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx index 1d461401055e..a5e1df2685d6 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.hxx +++ b/writerfilter/source/dmapper/StyleSheetTable.hxx @@ -97,6 +97,7 @@ public: OUString getOrCreateCharStyle( PropertyValueVector_t& rCharProperties, bool bAlwaysCreate ); + PropertyMapPtr const & GetDefaultParaProps(); /// Returns the default character properties. PropertyMapPtr const & GetDefaultCharProps(); |