diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-25 21:29:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-25 21:29:00 +0200 |
commit | c1f8437dbed0e8b989e41a345ef7e658a6e8a4cd (patch) | |
tree | 1be63ae37ca941c29b6da2f13e7c7f8cca04fa53 /writerfilter | |
parent | fd0a49bdd7cf7979d18feff003d1b5fbe53fdc14 (diff) |
fdo#83465 RTF import: handle font of numbering
Change-Id: If0da6e0e34ce50bbe7dceda089b6bb81b4a63f36
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 417655e2bf7b..5330076352fc 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -308,7 +308,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) 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)) + if (m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) && m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)->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()); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 0259aca83f35..471e59ed9bac 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4817,15 +4817,24 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::GetCurrentNumberingCharSt uno::Reference<container::XIndexAccess> xLevels = GetCurrentNumberingRules(&nListLevel); if (!xLevels.is()) { + // Looking up the paragraph context explicitly (and not just taking + // the top context) is necessary for RTF, where formatting of a run + // and of the paragraph mark is not separated. + PropertyMapPtr pContext = GetTopContextOfType(CONTEXT_PARAGRAPH); + if (!pContext) + 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); + boost::optional<PropertyMap::Property> oProp = pContext->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); + oProp = pContext->getProperty(PROP_NUMBERING_LEVEL); if (oProp) oProp->second >>= nListLevel; + else + nListLevel = 0; } if (!xLevels.is()) |