diff --git a/sw/qa/extras/ooxmlexport/data/tdf104354.docx b/sw/qa/extras/ooxmlexport/data/tdf104354.docx index 8645743f1fc1..d8655f4e0874 100644 Binary files a/sw/qa/extras/ooxmlexport/data/tdf104354.docx and b/sw/qa/extras/ooxmlexport/data/tdf104354.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index e6ac19f3df91..1b979bb79cb0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -310,6 +310,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354, "tdf104354.docx") // margin for the first paragraph in a text frame. CPPUNIT_ASSERT_EQUAL(static_cast(0), getProperty(xShape->getStart(), "ParaTopMargin")); + // still 494 in the second paragraph + CPPUNIT_ASSERT_EQUAL(static_cast(494), + getProperty(xShape->getEnd(), "ParaTopMargin")); } DECLARE_OOXMLEXPORT_TEST(testTdf107035, "tdf107035.docx") diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ce3508f4a90c..d3719e745b13 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -654,8 +654,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) default_spacing = 49; else { - // tdf#104354 fist paragraph has got zero top margin - if (m_pImpl->GetIsFirstParagraphInSection()) + // tdf#104354, tdf#118533 first paragraph of sections and shapes got zero top margin + if ((m_pImpl->GetIsFirstParagraphInSection() && !m_pImpl->IsInShape()) || + m_pImpl->GetIsFirstParagraphInShape()) default_spacing = 0; else default_spacing = 280;