summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-09-01 11:04:03 -0400
committerJustin Luth <justin_luth@sil.org>2017-09-02 19:35:09 +0200
commit7a9fb40cb07de8c2ea33f92735be5008d30d6704 (patch)
tree279eb686cfe57a8440a1d2ed9bd2a1fff33bda3e /sw/qa/extras
parent5fdec960fa2f85d53c05cf509c91168043368ad5 (diff)
tdf#37153 ConsiderWrapOnObjPos: also affect wrap-thru objs
MSO doesn't make a distinction when the wrapping is THROUGH. Both DOC and DOCX enable this compatibility setting. Change-Id: I123801fc83b5f4ac6a26a5ea77ba6dba2c60ec39 Reviewed-on: https://gerrit.libreoffice.org/41795 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ww8export/data/tdf37153_considerWrapOnObjPos.docbin0 -> 15872 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf37153_considerWrapOnObjPos.doc b/sw/qa/extras/ww8export/data/tdf37153_considerWrapOnObjPos.doc
new file mode 100644
index 000000000000..08ba2f9d52cb
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf37153_considerWrapOnObjPos.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 1aadcb17326f..f9e69f03cf90 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -18,6 +18,7 @@
#include <com/sun/star/text/XFootnote.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
#include <ftninfo.hxx>
#include <pagedesc.hxx>
@@ -49,6 +50,23 @@ DECLARE_WW8EXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPaddi
CPPUNIT_ASSERT_EQUAL( 3, getPages() );
}
+DECLARE_WW8EXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.doc")
+{
+ CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, getProperty<text::WrapTextMode>(getShape(1), "Surround"));
+
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(text::VertOrientation::BOTTOM, getProperty<sal_Int16>(xTable->getCellByName("A1"), "VertOrient"));
+
+ //For MSO compatibility, the image should be at the top of the cell, not at the bottom - despite VertOrientation::BOTTOM
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds", "top").toInt32();
+ CPPUNIT_ASSERT_MESSAGE("FlyTop should be 3820, not 6623", nFlyTop < 4000);
+ sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds", "top").toInt32();
+ CPPUNIT_ASSERT_MESSAGE("TextTop should be 5388", nTextTop > 4000);
+}
+
DECLARE_WW8EXPORT_TEST(testTdf49102_mergedCellNumbering, "tdf49102_mergedCellNumbering.doc")
{
CPPUNIT_ASSERT_EQUAL( OUString("2."), parseDump("/root/page/body/tab/row[4]/cell/txt/Special[@nType='POR_NUMBER']", "rText") );