summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-10-24 09:27:19 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-25 14:27:23 +0200
commit63054103570377ef8949addfa153b23838c1672a (patch)
treef87c578062bde2aa1492988c4dc8e146a87754d4 /writerfilter
parent2851316853b6c9106d9dc89a8ea4c3ca42eab01e (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). (cherry picked from commit f8b5ecc622e2b3e82576b27bf0ded9c8eac21cae) Change-Id: Ie331c7561de7f2f16776a1613717e38fa083a541 Reviewed-on: https://gerrit.libreoffice.org/43808 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 95ff12ec8ae7..30e8faa54fe3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -407,8 +407,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));