[Libreoffice-commits] core.git: 2 commits - sw/qa
LuboÅ¡ LuÅák
l.lunak at collabora.com
Wed Apr 23 09:11:00 PDT 2014
sw/qa/extras/README | 8 ++++----
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 20 ++++++++++++++++----
2 files changed, 20 insertions(+), 8 deletions(-)
New commits:
commit e5261dbd9317fc249f5ea07be6e9acbb86d78a5e
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Apr 23 18:10:02 2014 +0200
fix broken tests from cf33af732ed0d3d553bb74636e3b14c55d44c153
Change-Id: Ice31af80c3a837b2ee3a32ac973260476900ff35
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 7ca648c..f85da0d 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());
commit 93ef2c3efa48bb1d71b0d944b149eb588f10c432
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Apr 23 17:46:21 2014 +0200
link to the latest xray version
Change-Id: Ib4971227af78787cc98fc6b6c0def76871583dcd
diff --git a/sw/qa/extras/README b/sw/qa/extras/README
index aab53b1..01e0976 100644
--- a/sw/qa/extras/README
+++ b/sw/qa/extras/README
@@ -76,11 +76,11 @@ enough if you want to test a paragraph or character property.
Figuring out the UNO API just by reading the idl files under `offapi/` is not
that productive. Xray can help in this case. Download it from:
-http://dev-www.libreoffice.org/extern/XrayTool52_en.sxw
+http://bernard.marcelly.perso.sfr.fr/index2.html
-It's an SXW file, start Writer, Tools -> Options -> LibreOffice -> Security,
-Macro Security, and there choose Low. Then open the SXW, and click `Install
-Xray`. Now you can close the SXW. Open your testcase, which is imported
+It's a document file, start Writer, Tools -> Options -> LibreOffice -> Security,
+Macro Security, and there choose Low. Then open the document, and click `Install
+Xray`. Now you can close the file. Open your testcase, which is imported
correctly (from a fixed bugs's point of view). Then open the basic editor
(Tools -> Macros -> LibreOffice Basic -> Organize Macros, Edit), and start to
write your testcase as `Sub Main`. You don't have to know much about basic, for
More information about the Libreoffice-commits
mailing list