summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-24 09:22:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-11-27 09:57:42 +0000
commitd66df3d35030bf725fa7e3d78420344ddd44478c (patch)
tree28b8fdb553c77db152adf068cc48e679baafcd0d /sw
parenta38963a40eed7f1d85767b393a316870c31bff5c (diff)
tdf#78902 VML import: workaround for extreme top margin
Regression from commit 2b78f2cd7b9e4bab0f3b3b9119238f36a1bbc7b2 (rhbz#988516: DOCX import: fix context stack when importing header/footer, 2014-03-05), though that just made an existing Writer layout problem visible. RTF/WW8/newer (drawingML) DOCX import doesn't have this problem, as those import pictures as sw graphics, not draw ones. <w10:wrap type="through"/> is normally mapped to our page wrap (as it uses "through" in the "not only wrap around, but also in the holes of the shape, if it has any" context, not in our "text should go through it, so no wrapping" one), but for some reason in this case (most probably due to the extreme large negative margins) Word handles the situation as our through, i.e. the text should not go to the second page, as it would normally happen with a "Word through" wrapping. Work around the strange situation by ignoring the wrapping request for extreme top margin values. (cherry picked from commit 37b5f1ed3139b8569bfec0fcb5077f6b66b79acd) Conflicts: oox/source/vml/vmlshape.cxx sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I20555b1fa7a769e20c40a3a5ff3873807403e937 Reviewed-on: https://gerrit.libreoffice.org/20212 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf78902.docxbin0 -> 30230 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx6
2 files changed, 6 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf78902.docx b/sw/qa/extras/ooxmlimport/data/tdf78902.docx
new file mode 100644
index 000000000000..3cf3a443a975
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf78902.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index c56ed5e6cc03..87435f556916 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2853,6 +2853,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2267), xShape->getPosition().X);
}
+DECLARE_OOXMLIMPORT_TEST(testTdf78902, "tdf78902.docx")
+{
+ // This hung in layout.
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();