summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-09-01 22:37:13 -0400
committerJustin Luth <justin_luth@sil.org>2017-09-04 18:09:48 +0200
commite56f61c4637c09afbf125fa02f131b0c49e36351 (patch)
tree1aa2560767b0d4ecc39fe96e9a2cc1bb92ff0093 /sw/qa/extras
parent3cb59bff332b02f607d15b5ed41b4438e8102980 (diff)
tdf#37153 ConsiderWrapOnObjPos: always affect anchoring cell
MSO doesn't make a distinction where the object is located - whether it is contained within the boundaries of the anchoring cell or not. It always affects the anchoring cell's vertical orientation. Both DOC and DOCX enable this compatibility setting. Change-Id: Ifa066d3549b1a6183360b5b01c659e41c681d492 Reviewed-on: https://gerrit.libreoffice.org/41821 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/ooxmlexport/data/tdf37153_considerWrapOnObjPos.docxbin0 -> 8960 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf37153_considerWrapOnObjPos.docx b/sw/qa/extras/ooxmlexport/data/tdf37153_considerWrapOnObjPos.docx
new file mode 100644
index 000000000000..d89baaf084a2
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf37153_considerWrapOnObjPos.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 7dbd94bb910f..43639f622cac 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
@@ -568,6 +569,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99227, "tdf99227.docx")
assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.docx")
+{
+ 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 textbox 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 2865, not 5649", nFlyTop < sal_Int32(3000));
+ sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds", "top").toInt32();
+ CPPUNIT_ASSERT_MESSAGE("TextTop should be 3856", nTextTop > 3000);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf82173_footnoteStyle, "tdf82173_footnoteStyle.docx")
{
uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);