diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2014-04-23 18:10:02 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2014-04-23 18:10:32 +0200 |
commit | e5261dbd9317fc249f5ea07be6e9acbb86d78a5e (patch) | |
tree | 94026ce6d79f481f05dc471270219126172c110a | |
parent | 93ef2c3efa48bb1d71b0d944b149eb588f10c432 (diff) |
fix broken tests from cf33af732ed0d3d553bb74636e3b14c55d44c153
Change-Id: Ice31af80c3a837b2ee3a32ac973260476900ff35
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 7ca648c6c9b5..f85da0de7180 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2006,8 +2006,15 @@ DECLARE_OOXMLIMPORT_TEST(testNegativeCellMarginTwips, "negative-cell-margin-twip DECLARE_OOXMLIMPORT_TEST(testFdo38414, "fdo38414.docx" ) { // The cells in the last (4th) column were merged properly and so the result didn't have the same height. - OUString height3 = parseDump("/root/page/body/tab/row[1]/cell[3]/infos/bounds", "height" ); - OUString height4 = parseDump("/root/page/body/tab/row[1]/cell[4]/infos/bounds", "height" ); + // (Since w:gridBefore is worked around by faking another cell in the row, so column count is thus 5 + // instead of 4, therefore compare height of cells 4 and 5 rather than 3 and 4.) + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableColumns> xTableColumns(xTextTable->getColumns(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 5 ), xTableColumns->getCount()); + OUString height3 = parseDump("/root/page/body/tab/row[1]/cell[4]/infos/bounds", "height" ); + OUString height4 = parseDump("/root/page/body/tab/row[1]/cell[5]/infos/bounds", "height" ); CPPUNIT_ASSERT_EQUAL( height3, height4 ); } @@ -2070,8 +2077,13 @@ DECLARE_OOXMLIMPORT_TEST(testGridBefore, "gridbefore.docx") // w:gridBefore is faked by inserting two cells without border (because Writer can't do non-rectangular tables). // So check the first cell in the first row is in fact 3rd and that it's more to the right than the second // cell on the second row. - OUString textA3 = parseDump("/root/page/body/tab/row[1]/cell[1]/txt/text()" ); - OUString leftA3 = parseDump("/root/page/body/tab/row[1]/cell[1]/infos/bounds", "left" ); + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableColumns> xTableColumns(xTextTable->getColumns(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 3 ), xTableColumns->getCount()); + OUString textA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/txt/text()" ); + OUString leftA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/infos/bounds", "left" ); OUString leftB2 = parseDump("/root/page/body/tab/row[2]/cell[2]/infos/bounds", "left" ); CPPUNIT_ASSERT_EQUAL( OUString( "A3" ), textA3 ); CPPUNIT_ASSERT( leftA3.toInt32() > leftB2.toInt32()); |