diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-25 10:12:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-25 10:40:47 +0200 |
commit | f5ba3098b4406ff8656f2710df8af6ca6edcddc8 (patch) | |
tree | 5eda9dfaf3ae4c2f9670036f9670ec2e0b5c2ac3 /writerfilter | |
parent | 76034b4962027155a44b1c6aab665ac12fecf952 (diff) |
fdo#83465 writerfilter: import font of numbering
Change-Id: I0afe389fa6ea8b4c701232c6ecb425d5fdcde5fe
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 16 |
2 files changed, 24 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 2fe97d9f2862..417655e2bf7b 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -306,7 +306,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Fonts_ascii: if (m_pImpl->GetTopContext()) + { m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( sStringValue )); + if (m_pImpl->GetTopContextType() == CONTEXT_PARAGRAPH && m_pImpl->GetTopContext()->isSet(PROP_NUMBERING_RULES)) + { + // Font of the paragraph mark should be used for the numbering as well. + uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle()); + if (xCharStyle.is()) + xCharStyle->setPropertyValue("CharFontName", uno::makeAny(sStringValue)); + } + } break; case NS_ooxml::LN_CT_Fonts_asciiTheme: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "asciiTheme", ThemeTable::getStringForTheme(nIntValue)); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index bf5a748a3ea6..0259aca83f35 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4816,7 +4816,21 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::GetCurrentNumberingCharSt sal_Int32 nListLevel = -1; uno::Reference<container::XIndexAccess> xLevels = GetCurrentNumberingRules(&nListLevel); if (!xLevels.is()) - return xRet; + { + // In case numbering rules is not found via a style, try the direct formatting instead. + boost::optional<PropertyMap::Property> oProp = m_pTopContext->getProperty(PROP_NUMBERING_RULES); + if (oProp) + { + xLevels.set(oProp->second, uno::UNO_QUERY); + // Found the rules, then also try to look up our numbering level. + oProp = m_pTopContext->getProperty(PROP_NUMBERING_LEVEL); + if (oProp) + oProp->second >>= nListLevel; + } + + if (!xLevels.is()) + return xRet; + } uno::Sequence<beans::PropertyValue> aProps; xLevels->getByIndex(nListLevel) >>= aProps; for (int i = 0; i < aProps.getLength(); ++i) |