summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-07-20 14:05:30 +0200
committerLászló Németh <nemeth@numbertext.org>2020-07-21 11:01:12 +0200
commit1c3eb7e329cd2eaeb83068907ba0c9a5b3ef7852 (patch)
treea4756cbfb48e361860e201c2c07165c4e7330502 /writerfilter
parentdb470e2cb53cf2f7c8da9b7a06ab752de85c09d2 (diff)
tdf#134648 DOCX import: fix bottom auto margin of subitem
If style based spacing was set to auto in the previous list item, style of the actual paragraph must be the same to guarantee the same auto setting. Regression from commit 9cca15204af9cc44a8a9528ccf2f36616fb70e69 (tdf#133052: DOCX import: fix top auto margin of subitems). Change-Id: I39d2bad03a659a407b52550768b010cfa716d363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99096 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 25820d086c12..16f9e279a7fb 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1714,6 +1714,16 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
{
return rValue.Name == "ParaTopMarginBeforeAutoSpacing";
});
+ // if style based spacing was set to auto in the previous paragraph, style of the actual paragraph must be the same
+ if (bParaAutoBefore && !m_bParaAutoBefore && m_xPreviousParagraph->getPropertySetInfo()->hasPropertyByName("ParaStyleName"))
+ {
+ auto itParaStyle = std::find_if(aProperties.begin(), aProperties.end(), [](const beans::PropertyValue& rValue)
+ {
+ return rValue.Name == "ParaStyleName";
+ });
+ bParaAutoBefore = itParaStyle != aProperties.end() &&
+ m_xPreviousParagraph->getPropertyValue("ParaStyleName") == itParaStyle->Value;
+ }
// There was a previous textnode and it had the same numbering.
if (bParaAutoBefore)
{