summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2017-11-03 17:12:02 +0100
committerSerge Krot (CIB) <Serge.Krot@cib.de>2017-11-06 10:36:25 +0100
commitb68362cfca936752d07f643e4dfdfce411ea6358 (patch)
tree7be83b002d2236466db80a27e414d4dcf5e83c4a
parentbee1daa15fedd3e27521dd66e7595c17087b6b3a (diff)
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@libreoffice.org> Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf102466.docxbin0 -> 101162 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx34
2 files changed, 34 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf102466.docx
Binary files 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"))