[Libreoffice-commits] core.git: sw/qa

Justin Luth justin_luth at sil.org
Sat Jul 1 14:57:05 UTC 2017


 sw/qa/extras/ww8export/data/tdf108448_endNote.odt |binary
 sw/qa/extras/ww8export/ww8export2.cxx             |   19 +++++++++++++++++++
 2 files changed, 19 insertions(+)

New commits:
commit 68c8d7faa219b36d5d17ca84f4f1002ec998b80c
Author: Justin Luth <justin_luth at sil.org>
Date:   Sat Jul 1 09:34:23 2017 -0400

    tdf#108448 ww8export: endnote unit test
    
    Change-Id: I3559e51c7fe9fedf616857b5ae612b4a8f6c67d5
    Reviewed-on: https://gerrit.libreoffice.org/39431
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ww8export/data/tdf108448_endNote.odt b/sw/qa/extras/ww8export/data/tdf108448_endNote.odt
new file mode 100644
index 000000000000..bc4a751a8978
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf108448_endNote.odt differ
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index d429d53b0404..70aa498d5fdc 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -15,6 +15,7 @@
 #include <com/sun/star/text/XTextFramesSupplier.hpp>
 #include <com/sun/star/text/XTextTable.hpp>
 #include <com/sun/star/text/XTextTablesSupplier.hpp>
+#include <com/sun/star/text/XFootnote.hpp>
 #include <pagedesc.hxx>
 
 class Test : public SwModelTestBase
@@ -96,6 +97,24 @@ DECLARE_WW8EXPORT_TEST(testBnc863018b, "bnc863018b.doc")
     CPPUNIT_ASSERT_EQUAL( 1, getPages() );
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf108448_endNote, "tdf108448_endNote.odt")
+{
+    uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xEndnotes(xEndnotesSupplier->getEndnotes(), uno::UNO_QUERY);
+    uno::Reference<text::XText> xEndnote;
+    xEndnotes->getByIndex(0) >>= xEndnote;
+
+    uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xEndnote->getText(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+    int nRet = 0;
+    while (xParaEnum->hasMoreElements())
+    {
+        xParaEnum->nextElement();
+        nRet++;
+    }
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of paragraphs in Endnote i", 1, nRet );
+}
+
 DECLARE_WW8EXPORT_TEST(testTdf104805, "tdf104805.doc")
 {
     uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WW8Num1"), uno::UNO_QUERY);


More information about the Libreoffice-commits mailing list