summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-09-21 17:52:58 +0200
committerAndras Timar <andras.timar@collabora.com>2014-09-23 13:02:28 +0000
commitb6dae49f3913464dc76992fbb2d1ee8ca9c98f07 (patch)
treebe4c755463b67de4a88e45493dc693133607b174 /sw
parentbdefc56961919499cc6fda5a39c791ac6c67ca5f (diff)
handle docx's w:anchor layoutInCell attribute (bnc#891663)
(cherry picked from commit 3891ba42a886fa85eb43da24d1badf44e765d54c) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx writerfilter/source/dmapper/PropertyIds.cxx writerfilter/source/dmapper/PropertyIds.hxx Change-Id: I8268567b84aa0f6e42624bfd0f79c8c49c153edd Reviewed-on: https://gerrit.libreoffice.org/11569 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/bnc891663.docxbin0 -> 7911 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/bnc891663.docx b/sw/qa/extras/ooxmlimport/data/bnc891663.docx
new file mode 100644
index 000000000000..d5f057e66fd6
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/bnc891663.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 0035e7b660f9..2a7ab9a43973 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1723,6 +1723,15 @@ DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx")
CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty<sal_Int16>(xTable->getCellByName("A2"), "VertOrient"));
}
+DECLARE_OOXMLIMPORT_TEST(testBnc891663, "bnc891663.docx")
+{
+ // The image should be inside a cell, so the text in the following cell should be below it.
+ int imageTop = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "top").toInt32();
+ int imageHeight = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "height").toInt32();
+ int textNextRowTop = parseDump("/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds", "top").toInt32();
+ CPPUNIT_ASSERT( textNextRowTop >= imageTop + imageHeight );
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();