diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-24 09:27:19 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-24 11:26:31 +0200 |
commit | f8b5ecc622e2b3e82576b27bf0ded9c8eac21cae (patch) | |
tree | e00468e73ea405384b1ca01024fd0a5b82f7af71 /writerfilter | |
parent | 460d8428f9df48b13ae780b9e8a07ae8b31b8879 (diff) |
tdf#113202 RTF import: fix lack of expected contextual spacing
Upper, lower and contextual spacing are all stored in SvxULSpaceItem, so
if after spacing is set as direct formatting, contextual spacing has to
be set directly as well (having it in the paragraph style has no
effect).
Change-Id: Ie331c7561de7f2f16776a1613717e38fa083a541
Reviewed-on: https://gerrit.libreoffice.org/43735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index af3579441047..2a831262e6de 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -405,8 +405,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Spacing_after: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "after", OUString::number(nIntValue)); if (m_pImpl->GetTopContext()) + { // Don't overwrite NS_ooxml::LN_CT_Spacing_afterAutospacing. m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ), false); + + uno::Any aContextualSpacingFromStyle = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_CONTEXT_MARGIN); + if (aContextualSpacingFromStyle.hasValue()) + // Setting "after" spacing means Writer doesn't inherit + // contexual spacing anymore from style, but Word does. + m_pImpl->GetTopContext()->Insert(PROP_PARA_CONTEXT_MARGIN, aContextualSpacingFromStyle); + } break; case NS_ooxml::LN_CT_Spacing_afterLines: m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "afterLines", OUString::number(nIntValue)); |