summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-05-13 12:01:35 +0200
committerLászló Németh <nemeth@numbertext.org>2020-05-13 15:08:27 +0200
commit162d74ae7a53eb1cde738f0a7558f297b8162f7a (patch)
tree17489fca462e63656a1c3a9e5bcf533e577e670e /writerfilter
parent2088a5e598452a1592023d7606ba4447dc2b3242 (diff)
tdf#132807 DOCX import: fix top auto margin in lists
at paragraph style based numbering. See also commit 99b2d53346d4b01b491cd1f7fae3304ac0572e12 (tdf#132802 DOCX import: fix list bottom auto margins). Change-Id: I6bfea3ace5c94f9d45267e309a21ac8a97c20a37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94111 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 6d8f0822e7ce..e34268cb04d2 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1653,9 +1653,21 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
if (!aPreviousNumberingName.isEmpty() && aCurrentNumberingName == aPreviousNumberingName)
{
-
+ uno::Sequence<beans::PropertyValue> aPrevPropertiesSeq;
+ m_xPreviousParagraph->getPropertyValue("ParaInteropGrabBag") >>= aPrevPropertiesSeq;
+ auto aPrevProperties = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(aPrevPropertiesSeq);
+ bool bPrevParaAutoBefore;
+ if (isNumberingViaRule)
+ bPrevParaAutoBefore = false;
+ else
+ {
+ bPrevParaAutoBefore = std::any_of(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
+ {
+ return rValue.Name == "ParaTopMarginBeforeAutoSpacing";
+ });
+ }
// There was a previous textnode and it had the same numbering.
- if (m_bParaAutoBefore)
+ if (m_bParaAutoBefore || bPrevParaAutoBefore)
{
// This before spacing is set to auto, set before space to 0.
auto itParaTopMargin = std::find_if(aProperties.begin(), aProperties.end(), [](const beans::PropertyValue& rValue)
@@ -1668,9 +1680,6 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
aProperties.push_back(comphelper::makePropertyValue("ParaTopMargin", static_cast<sal_Int32>(0)));
}
- uno::Sequence<beans::PropertyValue> aPrevPropertiesSeq;
- m_xPreviousParagraph->getPropertyValue("ParaInteropGrabBag") >>= aPrevPropertiesSeq;
- auto aPrevProperties = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(aPrevPropertiesSeq);
bool bPrevParaAutoAfter = std::any_of(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
{
return rValue.Name == "ParaBottomMarginAfterAutoSpacing";