diff options
author | László Németh <nemeth@numbertext.org> | 2018-07-10 13:03:58 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-09-12 09:43:33 +0200 |
commit | 84a1586d55b29b7bf9d733f3e8233dfbdc4beb21 (patch) | |
tree | 7d763600e401eba5a40fd7af605de6722f978281 | |
parent | 57626bd356f7e01bf5a88a204638ba1687ed545f (diff) |
tdf#118533 fix shape import: zero top margin only in first paragraph
commit 0307a62790b33ee0c02c2323a8f759e53e2035a4 fixed the
top margin import of the paragraphs of document sections, and
import of first paragraph of the text frames with beforeAutospacing,
but nullified all other paragraph top margins in frames.
Note: there is no visible margin difference in the unit test (extended
by this commit) before and after the fix, because the first paragraph
uses also afterAutospacing, resulting still 14pt paragraph space.
But the tested beforeAutospacing value of the next paragraph checks
the fix correctly.
Change-Id: I0ab3b8bbff33c5488f4b4af1ea4dabf7105103f2
Reviewed-on: https://gerrit.libreoffice.org/57231
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 970eaaf1bdade63fd651db591c683e36e662f8f5)
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf104354.docx | bin | 9412 -> 10182 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 5 |
3 files changed, 6 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf104354.docx b/sw/qa/extras/ooxmlexport/data/tdf104354.docx Binary files differindex 8645743f1fc1..d8655f4e0874 100644 --- a/sw/qa/extras/ooxmlexport/data/tdf104354.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf104354.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 57c0296b1bd9..ec6153369569 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -231,6 +231,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354, "tdf104354.docx") // margin for the first paragraph in a text frame. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xShape->getStart(), "ParaTopMargin")); + // still 494 in the second paragraph + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), + getProperty<sal_Int32>(xShape->getEnd(), "ParaTopMargin")); } DECLARE_OOXMLEXPORT_TEST(testTdf107035, "tdf107035.docx") diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index beb43a5c07f9..499f402d8ad7 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -669,8 +669,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; |