summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-05-20 16:24:38 +0200
committerLászló Németh <nemeth@numbertext.org>2020-05-21 09:27:10 +0200
commit9cca15204af9cc44a8a9528ccf2f36616fb70e69 (patch)
tree77da0c2ab6e2ed819bce42a8ce352ad7bb2e39cb /writerfilter
parentd618441188dddc3c35aae733aa003b48389c6af7 (diff)
tdf#133052: DOCX import: fix top auto margin of subitems
(nested lists) and other items of lists, when auto margin is defined by paragraph style, and list items have got w:numPr. Follow-up of commit 162d74ae7a53eb1cde738f0a7558f297b8162f7a (tdf#132807 DOCX import: fix top auto margin in lists). Change-Id: I4cf470173fa367ac07e15dc901b0e202178c9fc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94588 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c570562d5e12..4b7b3ccd45ef 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1656,18 +1656,12 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
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
+ bool bParaAutoBefore = m_bParaAutoBefore || std::any_of(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
{
- 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 || bPrevParaAutoBefore)
+ if (bParaAutoBefore)
{
// 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)