From 425f18fd3b6a87694c540d4d0bb37c5b64df557b Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Sun, 21 Sep 2014 17:52:58 +0200 Subject: 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 --- sw/qa/extras/ooxmlimport/data/bnc891663.docx | Bin 0 -> 7911 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 sw/qa/extras/ooxmlimport/data/bnc891663.docx (limited to 'sw') 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 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/bnc891663.docx 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(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(); -- cgit