diff options
author | László Németh <nemeth@numbertext.org> | 2018-08-10 11:49:14 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-09-02 13:13:15 +0200 |
commit | 5e2caf236091c71b2148970eba36b22655d8845a (patch) | |
tree | b6afa44ceb4afcfce65c5464edd8d020e26fdfc7 /writerfilter | |
parent | 307e84ac706345510a4d347fbaaf3d53f8249dea (diff) |
tdf#119188 DOCX import: fix zero margins of numbered lines in cells
regression from 5c6bce38a01b21403a603acd3148cf3bbb4c685f
(tdf#104354 DOCX import: fix paragraph auto spacing in tables).
Change-Id: I486d155eb4463599ab922837fd2f4347b48e0851
Reviewed-on: https://gerrit.libreoffice.org/58818
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index e881f279a83f..c1a579b308f8 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1323,6 +1323,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con } } std::vector<beans::PropertyValue> aProperties; + bool bNumberedParagraph = false; if (pPropertyMap.get()) aProperties = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(pPropertyMap->GetPropertyValues()); if( !bIsDropCap ) @@ -1367,6 +1368,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con if (itNumberingRules != aProperties.end()) { // This textnode has numbering. Look up the numbering style name of the current and previous paragraph. + bNumberedParagraph = true; OUString aCurrentNumberingRuleName; uno::Reference<container::XNamed> xCurrentNumberingRules(itNumberingRules->Value, uno::UNO_QUERY); if (xCurrentNumberingRules.is()) @@ -1448,8 +1450,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con uno::Reference< text::XTextRange > xParaEnd( xCur, uno::UNO_QUERY ); CheckParaMarkerRedline( xParaEnd ); } - - // set top margin of the previous auto paragraph in cells, keeping zero bottom margin only at the first one + // set top margin of the previous auto paragraph in cells, keeping zero top margin only at the first one if (m_nTableDepth > 0 && m_nTableDepth == m_nTableCellDepth && m_xPreviousParagraph.is()) { bool bParaChangedTopMargin = std::any_of(aProperties.begin(), aProperties.end(), [](const beans::PropertyValue& rValue) @@ -1467,7 +1468,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con if ((bPrevParaAutoBefore && !bParaChangedTopMargin) || (bParaChangedTopMargin && m_bParaAutoBefore)) { - sal_Int32 nSize = m_bFirstParagraphInCell ? 0 : 280; + sal_Int32 nSize = (m_bFirstParagraphInCell || bNumberedParagraph) ? 0 : 280; // Previous before spacing is set to auto, set previous before space to 280, except in the first paragraph. m_xPreviousParagraph->setPropertyValue("ParaTopMargin", uno::makeAny( ConversionHelper::convertTwipToMM100(nSize))); |