[Libreoffice-commits] core.git: sw/qa
Serge Krot
Serge.Krot at cib.de
Mon Nov 6 09:36:54 UTC 2017
sw/qa/extras/ooxmlexport/data/tdf102466.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 34 +++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
New commits:
commit b68362cfca936752d07f643e4dfdfce411ea6358
Author: Serge Krot <Serge.Krot at cib.de>
Date: Fri Nov 3 17:12:02 2017 +0100
tdf#102466 Added unit test: ensure 1st page is not missing
Change-Id: Icbc97d6a69447575aa2980a700a663ece226f781
Reviewed-on: https://gerrit.libreoffice.org/44273
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Serge Krot (CIB) <Serge.Krot at cib.de>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf102466.docx b/sw/qa/extras/ooxmlexport/data/tdf102466.docx
new file mode 100644
index 000000000000..68a88799ce66
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf102466.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 52fed19b7dc8..d7f548dcb4de 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -1037,6 +1037,40 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92521, "tdf92521.odt")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx")
+{
+ // the problem was: file is truncated: the first page is missing.
+
+ // check how much pages we have
+ CPPUNIT_ASSERT_EQUAL(10, getPages());
+
+ // check content of the first page
+ {
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+
+ // no border
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xFrame, "LineWidth"));
+ }
+
+ // Make sure we have 19 tables created
+ {
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(19), xTables->getCount( ));
+
+ // check the text inside first cell of the first table
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+
+ const OUString aMustHaveText = "Requerimientos del Cliente";
+ const OUString aActualText = xCell->getString();
+
+ CPPUNIT_ASSERT(aActualText.indexOf(aMustHaveText) > 0);
+ }
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf99090_pgbrkAfterTable, "tdf99090_pgbrkAfterTable.docx")
{
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
More information about the Libreoffice-commits
mailing list