summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-08-22 19:08:33 -0400
committerJustin Luth <jluth@mail.com>2024-08-24 14:37:17 +0200
commita8125cd58309dfec84ea9d3de749fadb0f0505f8 (patch)
tree8983334a71382bdb63026f46776a90779b9639e2 /sw/qa/extras
parent34f04196575fd52bb117696df92177c3b7d2d190 (diff)
tdf#162541 docx import NOT-layoutInCell: hori-para => PAGE_PRINT_AREA
This was copied from DOC import. Since compat15 is always layoutInCell, the impact for DOCX is minimal. If the fly is not layoutInCell, then MSO applies the para-orientation against the paragraph that contains the entire table, not the cell paragraph it is anchored to. For the horizontal case, this table-paragraph is equivalent to the page margin, so change it to a meaningful value. The vertical case cannot be meaningfully mapped to an equivalent, so someone will need to implement that in layout code. Wrap through has NOTHING to do with this. make CppunitTest_sw_ooxmlexport21 CPPUNIT_TEST_NAME=testTdf162541 Change-Id: I17b28f9d77cd85b4104e8c8f0c347e61b6c8f5a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172297 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf162541_notLayoutInCell_paraLeft.docxbin0 -> 35104 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport21.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf162541_notLayoutInCell_paraLeft.docx b/sw/qa/extras/ooxmlexport/data/tdf162541_notLayoutInCell_paraLeft.docx
new file mode 100644
index 000000000000..765c87cd1519
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf162541_notLayoutInCell_paraLeft.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index a7c46b536f95..f07c93a04e0e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -676,6 +676,33 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, "tdf153909_followTextFlow
CPPUNIT_ASSERT(nTableLeft > nRectLeft);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf162541, "tdf162541_notLayoutInCell_paraLeft.docx")
+{
+ // given cell B2 with a para-left para-fromTop image that is NOT layoutInCell
+ xmlDocUniquePtr pDump = parseLayoutDump();
+ sal_Int32 nShapeLeft
+ = getXPath(pDump, "//tab/row[2]/cell[2]/txt[8]/anchored/fly/SwAnchoredObject/bounds"_ostr,
+ "left"_ostr)
+ .toInt32();
+ sal_Int32 nParaLeft
+ = getXPath(pDump, "//tab/row[2]/cell[2]/txt[8]/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nTableLeft = getXPath(pDump, "//tab/infos/bounds"_ostr, "left"_ostr).toInt32();
+ // The image uses the table-paragraph to orient to the left (bizarre MSO layout anomaly)
+ CPPUNIT_ASSERT(nShapeLeft < nParaLeft); // shape is located in column A, not column B
+ CPPUNIT_ASSERT_EQUAL(nTableLeft, nShapeLeft);
+
+ // sal_Int32 nShapeBottom
+ // = getXPath(pDump, "//tab/row[2]/cell[2]/txt[8]/anchored/fly/SwAnchoredObject/bounds"_ostr,
+ // "bottom"_ostr)
+ // .toInt32();
+ // sal_Int32 nPara8Top
+ // = getXPath(pDump, "//tab/row[2]/cell[2]/txt[8]/infos/bounds"_ostr, "top"_ostr).toInt32();
+ // The image uses the table-paragraph to orient to the left (bizarre MSO layout anomaly)
+ // CPPUNIT_ASSERT(nShapeBottom < nPara8Top); // shape is located at the top of the table para // tdf#133522
+
+ CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf162551, "tdf162551_notLayoutInCell_charLeft_fromTop.docx")
{
// given cell B2 with a para-fromTop, char-left image that is NOT layoutInCell