tdf#160077 unit test: this file was helpful identifying a "bad fix"
...since I'm walking away from doing any fix at all
as it involves layout code for layoutInCell.
Following the createGraphicObject route could also benefit from
a similar fix as d210667c72ff821b8cb50b386a83ed55d65ae9bf,
but placing that code outside of the try/catch
will be important because this example exceptions out.
However, my first instinct was to put the code in the "obvious spot"
and it didn't work, so adding this as a separate unit test.
make CppunitTest_sw_ooxmlexport21 \
CPPUNIT_TEST_NAME=testTdf160077_layoutInCellB
Change-Id: Ifa6a62d9708d9248e48766b913d54a79cfcb230a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164578
Tested-by: Justin Luth <jluth@mail.com>
Reviewed-by: Justin Luth <jluth@mail.com>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf160077_layoutInCellB.docx b/sw/qa/extras/ooxmlexport/data/tdf160077_layoutInCellB.docx
new file mode 100644
index 0000000..741bf82
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf160077_layoutInCellB.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index 5e320bb..2683cca 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -381,6 +381,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf160077_layoutInCell, "tdf160077_layoutInCell.doc
CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), "IsFollowingTextFlow"));
}
DECLARE_OOXMLEXPORT_TEST(testTdf160077_layoutInCellB, "tdf160077_layoutInCellB.docx")
{
// given an in-table, group-shape vertically aligned -1.35 cm (above) the top page margin
// (which is actually forced to layoutInCell, so that turns into 1.35cm above the paragraph)
xmlDocUniquePtr pDump = parseLayoutDump();
const sal_Int32 nShapeTop
= getXPath(pDump,
"//body/tab[1]/row[1]/cell[1]/txt[1]/anchored/SwAnchoredDrawObject/bounds"_ostr,
"top"_ostr)
.toInt32();
// The shape is approximately 1 cm below the top of the page, and ~0.5cm above the cell
// correct ShapeTop: 888 TWIPS, while incorrect value was -480. Cell top is 1148, PageTop is 284
CPPUNIT_ASSERT_DOUBLES_EQUAL(888, nShapeTop, 50);
}
DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, "tdf153909_followTextFlow.docx")
{
// Although MSO's UI reports "layoutInCell" for the rectangle, it isn't specified or honored