summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-08-28 09:30:18 -0400
committerMiklos Vajna <vmiklos@collabora.com>2024-09-09 12:48:11 +0200
commit1de6bea27ed36167ec138818607da7b49e92ec4a (patch)
treed886636d80b77e9d7bf347329cfbf19d5e6c738a /sw/qa/extras/ooxmlimport
parentdce8738344e8fb6d000c71feb6a02e570e4660ec (diff)
tdf#143899 compat15 layout: restrict body fly to PAGE_PRINT_AREA
For some inexplicable reason, Microsoft decided to change a non-table layout restriction for DOCX >= 2013. Now most floating objects are not allowed to cross the vertical margin (header/footer) boundaries (although floating tables are one exception) (and so are framePr textboxes) (and horizontal margin boundaries can still be crossed). This is similar to layoutInCell's whimsical vertical aversion to margins. There are already good unit tests in place to ensure compat14 works, and for the compat15 table exception. (see earlier patchsets for all affected unit tests) make CppunitTest_sw_ooxmlexport9 CPPUNIT_TEST_NAME=testTdf103544 make CppunitTest_sw_ooxmlexport21 CPPUNIT_TEST_NAME=testTdf143899 Change-Id: I5788c35e57cbc84a6b5fcd0ef97dc4394b0f6395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172536 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 7e0a1a7676c3..6b109ec3aa62 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1459,6 +1459,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf60351)
CPPUNIT_ASSERT_EQUAL(sal_Int32(316), aPolygon[4].Y);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[5].X);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[5].Y);
+
+ // tdf143899: image affected by compat15's aversion to vertical page margin.
+ // although the image is set to -0.3cm above the first paragraph, it can't move up at all.
+ xmlDocUniquePtr pDump = parseLayoutDump();
+ sal_Int32 nBodyTop = getXPath(pDump, "//page/body/infos/bounds"_ostr, "top"_ostr).toInt32();
+ sal_Int32 nImageTop = getXPath(pDump, "//fly/infos/bounds"_ostr, "top"_ostr).toInt32();
+ // The image (like most floating objects) is vertically limited to the page margins
+ CPPUNIT_ASSERT_EQUAL(nBodyTop, nImageTop);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf95970)