summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-09-08 16:49:09 +0300
committerJustin Luth <justin_luth@sil.org>2020-09-10 07:40:04 +0200
commitd865ae748ae3b1d054051b89938eaef30680e06c (patch)
tree5ce070973ba8b503c00e1dd34d49f4799b7ca42b /sw
parent2dc30bd6ee88a2e3a1b4607c144f151e7329f3b9 (diff)
tdf#135943 writerfilter: ignore compat LayoutInCell for txbx
... until such a time when the underlying problem of textbox position not syncing with the moved frame is fixed. Bug 77794 moved the frame to the correct position, but the text only followed when going to the frame property, looking at the values, and pressing OK. So, it seems like the layout is re-positioning the frame, but that frame change is not being synchronized back to the paired up textbox. Since I couldn't figure out how to resolve that, I'm just temporarily avoiding the problem that my 7.1 change for tdf#77794 has exposed. That means that the textbox/frame is in the wrong position (same as in previous LO versions), but at least the text is inside of the frame. Change-Id: I7dc712c613b164317bc4adf19ac231488d610c95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102258 Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf135943_shapeWithText_LayoutInCell0_compat15.docxbin0 -> 16850 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx23
2 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135943_shapeWithText_LayoutInCell0_compat15.docx b/sw/qa/extras/ooxmlexport/data/tdf135943_shapeWithText_LayoutInCell0_compat15.docx
new file mode 100644
index 000000000000..b4bbcb94e82c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf135943_shapeWithText_LayoutInCell0_compat15.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 834c59c785c2..fcbda86665cd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -111,6 +111,29 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135595_HFtableWrap, "tdf135595_HFtableWrap.odt")
CPPUNIT_ASSERT_MESSAGE("Image must be contained inside the table cell", nRowHeight > 2000);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf135943_shapeWithText_L0c15,
+ "tdf135943_shapeWithText_LayoutInCell0_compat15.docx")
+{
+ // With compat15, layoutinCell ought to be ignored/forced to true.
+ // HOWEVER, currently only the shape is correctly placed, while its text is un-synced separately.
+ // So to prevent this ugly mess, just leave everything together in the historical (wrong) spot.
+ xmlDocUniquePtr pDump = parseLayoutDump();
+ sal_Int32 nFrameLeft = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds", "left").toInt32();
+ sal_Int32 nFrameRight = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds", "right").toInt32();
+ sal_Int32 nTextLeft = getXPath(pDump, "//anchored/fly/infos/bounds", "left").toInt32();
+ sal_Int32 nTextRight = getXPath(pDump, "//anchored/fly/infos/bounds", "right").toInt32();
+ // The text must be inside of its frame boundaries
+ CPPUNIT_ASSERT(nFrameRight >= nTextRight);
+ CPPUNIT_ASSERT(nFrameLeft <= nTextLeft);
+ // LayoutInCell: The text must fit inside cell A1 //cell[1]/info/bounds/right = 4703
+ //CPPUNIT_ASSERT(nTextRight < 4704);
+
+ uno::Reference<beans::XPropertySet> xShapeProperties(getShape(1), uno::UNO_QUERY);
+ bool bValue;
+ xShapeProperties->getPropertyValue("IsFollowingTextFlow") >>= bValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("YOU FIXED ME? LayoutInCell ought to be true", false, bValue);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf135595_HFtableWrap_c12, "tdf135595_HFtableWrap_c12.docx")
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();