summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docxbin0 -> 35416 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport21.cxx21
-rw-r--r--sw/qa/extras/ww8export/ww8export4.cxx7
3 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx b/sw/qa/extras/ooxmlexport/data/tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx
new file mode 100644
index 000000000000..dae6163b2af3
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index f07c93a04e0e..32892540e734 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -14,6 +14,7 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/XDocumentIndex.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
@@ -724,6 +725,26 @@ DECLARE_OOXMLEXPORT_TEST(testTdf162551, "tdf162551_notLayoutInCell_charLeft_from
CPPUNIT_ASSERT(getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf162612,
+ "tdf162612_notLayoutInCell_notWrapThrough_contourOpaque.docx")
+{
+ // given cell B2 with a centered, tight-wrapped image that is NOT layoutInCell
+ // (but Microsoft doesn't wrap any text around it)
+ xmlDocUniquePtr pDump = parseLayoutDump();
+ CPPUNIT_ASSERT_EQUAL(OUString("-anchor point-"),
+ getXPathContent(pDump, "//tab/row[2]/cell[2]/txt"_ostr));
+ sal_Int32 nParaHeight
+ = getXPath(pDump, "//tab/row[2]/cell[2]/txt/infos/bounds"_ostr, "height"_ostr).toInt32();
+ // text should not wrap as two lines(552) beside the shape. It is one line(276) behind the shape
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(276), nParaHeight);
+
+ // the image is over top of the text
+ CPPUNIT_ASSERT(getProperty<bool>(getShape(1), u"Opaque"_ustr));
+ // image should be wrapThrough, not PARALLEL (despite being wp:wrapTight wrapText="bothSides")
+ CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH,
+ getProperty<text::WrapTextMode>(getShape(1), u"Surround"_ustr));
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf159207_footerFramePrBorder)
{
loadFromFile(u"tdf159207_footerFramePrBorder.docx"); // re-imports as editeng Frame/Shape
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx
index 007e7f70cac4..084eb178af6a 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -209,6 +209,13 @@ DECLARE_WW8EXPORT_TEST(testTdf162541, "tdf162541_notLayoutInCell_paraLeft.doc")
CPPUNIT_ASSERT(nShapeLeft < nParaLeft); // shape is located in column A, not column B
CPPUNIT_ASSERT_EQUAL(nTableLeft, nShapeLeft);
CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr));
+
+ // tdf#162612
+ // Note that this round-trip will "fix" the weird splitting table around the image...
+
+ // image should be wrapThrough, not PARALLEL (despite being wrapTight on largest side)
+ CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH,
+ getProperty<text::WrapTextMode>(getShape(1), u"Surround"_ustr));
}
DECLARE_WW8EXPORT_TEST(testTdf162542, "tdf162542_notLayoutInCell_charLeft_wrapThrough.doc")