diff options
author | Justin Luth <justin_luth@sil.org> | 2017-07-01 09:34:23 -0400 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2017-07-01 16:56:40 +0200 |
commit | 68c8d7faa219b36d5d17ca84f4f1002ec998b80c (patch) | |
tree | 2d586e1184bac52028416d70df1a870f79d2cf7e /sw/qa/extras/ww8export | |
parent | 51f616ddd7a2e3310e1b30dbd73d90e5138980ea (diff) |
tdf#108448 ww8export: endnote unit test
Change-Id: I3559e51c7fe9fedf616857b5ae612b4a8f6c67d5
Reviewed-on: https://gerrit.libreoffice.org/39431
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa/extras/ww8export')
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf108448_endNote.odt | bin | 0 -> 10911 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf108448_endNote.odt b/sw/qa/extras/ww8export/data/tdf108448_endNote.odt Binary files differnew file mode 100644 index 000000000000..bc4a751a8978 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf108448_endNote.odt 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); |