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 02:06:33 -0700
commit425f18fd3b6a87694c540d4d0bb37c5b64df557b (patch)
tree516b0520bedefbca7f00ad982bdb47f133334abe /sw
parentd8acb63264d80e54d639318a2bfd341d8e293879 (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
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();