summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-02-12 22:04:55 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-02-13 09:58:09 +0100
commitf737c9386a605cb7d8c9dbc210c557f98f6cdc19 (patch)
treec1fc00ab826300d725cba1ce492f40b063466edc /sw
parentb75609faa1a5ecde608146fcd7952e5efbcb40c6 (diff)
tdf#113258 DOCX import: fix beforeAutospacing for shape first paragraph
Commit c761df1e42fd11acc5fc05b0baacd803c3788ca6 (tdf#84678 DOCX import: fix handling of textbox margins, 2016-10-25) uncovered a previously harder to notice problem that single-paragraph shapes have an incorrect upper paragraph margin for the first paragraph. Now that the shape margins are correct this problematic paragraph margin causes crop of the shape text. Fix the problem by adapting the DOCX import to the WW8 import's SwWW8ImplReader::AppendTextNode() (the "If this is the first paragraph in the document" part), where it seems the first paragraph is not only the literally first paragraph in the document, but also the first paragraph of shapes as well. Change-Id: I9d99b9cfabae2c9a7c33eefefb5a9f008669e93d Reviewed-on: https://gerrit.libreoffice.org/49617 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf113258.docxbin0 -> 17327 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf113258.docx b/sw/qa/extras/ooxmlexport/data/tdf113258.docx
new file mode 100644
index 000000000000..d60a2ee6413c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf113258.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 5a6cfd48cf13..d3cc7275a92e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -220,6 +220,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf114703, "tdf114703.docx")
comphelper::SequenceAsHashMap(xRules->getByIndex(0))["FirstLineIndent"].get<sal_Int32>());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf113258, "tdf113258.docx")
+{
+ uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY);
+ // This was 494, i.e. automatic spacing resulted in non-zero paragraph top
+ // margin for the first paragraph in a shape.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0),
+ getProperty<sal_Int32>(xShape->getStart(), "ParaTopMargin"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */