summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-10-26 15:31:30 +0100
committerLászló Németh <nemeth@numbertext.org>2020-10-26 18:17:45 +0100
commit41e230e81b50235b5b86f883ef424a8ba5b42288 (patch)
treea1c1ca2d278448fcf67b9d79eef7433bffafd03b /sw
parent7988adf2bd250a32885d67306c73e07caa910778 (diff)
tdf#137593 DOCX import: fix para top margin in cells with shapes
and text boxes. Auto top margin value of the first table cell paragraph is zero. Paragraphs of shapes and text boxes anchored to this cell paragraph don't matter here, so keep m_bFirstParagraphInCell=true in shapes and text box paragraphs to avoid extra top margin of the anchoring point. Regression from commit 5c6bce38a01b21403a603acd3148cf3bbb4c685f (tdf#104354 DOCX import: fix paragraph auto spacing in tables). Change-Id: I22c4ae230bc0192f06d3d155217887c471c67b67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104816 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf137593.docxbin0 -> 15697 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf137593.docx b/sw/qa/extras/ooxmlexport/data/tdf137593.docx
new file mode 100644
index 000000000000..8b63fd39a8f2
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf137593.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index e5fd69650911..1ff3ccf8ec3e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -1543,6 +1543,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354_2, "tdf104354-2.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell5->getText()), "ParaBottomMargin"));
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf137593, "tdf137593.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+ // zero auto spacing, if the first paragraph contains text boxes
+ // This was 280.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115557, "tdf115557.docx")
{
// A chart anchored to a footnote multiplied during import