sw/CppunitTest_sw_uiwriter.mk | 3 +++ sw/qa/extras/rtfimport/data/tdf90046.rtf | 8 ++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 9 +++++++++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1 + 4 files changed, 21 insertions(+)
New commits: commit eb7516064df402f35f8bbfa7c1962f49aa6a7c00 Author: Michael Stahl <mst...@redhat.com> Date: Fri Jul 24 15:09:43 2015 +0200 sw: partial build needs another dependency from uiwriter to msword Change-Id: I59e03895f8676bd7f91e8aaf4994e4f4b8231773 diff --git a/sw/CppunitTest_sw_uiwriter.mk b/sw/CppunitTest_sw_uiwriter.mk index 45112a4..efe9174 100644 --- a/sw/CppunitTest_sw_uiwriter.mk +++ b/sw/CppunitTest_sw_uiwriter.mk @@ -15,11 +15,14 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sw_uiwriter, \ sw/qa/extras/uiwriter/uiwriter \ )) +# note: this links msword only for the reason to have a order dependency, +# because "make sw.check" will not see the dependency through services.rdb $(eval $(call gb_CppunitTest_use_libraries,sw_uiwriter, \ comphelper \ cppu \ cppuhelper \ editeng \ + msword \ sal \ sfx \ svl \ commit a61fd02c819433a1206b3b3e61017ba2d0d3d467 Author: Michael Stahl <mst...@redhat.com> Date: Fri Jul 24 14:40:53 2015 +0200 tdf#90046: RTF import: ensure that a run is started before \footnote Avoids crashing with empty context stacks. Change-Id: I0ee8b457fdbb19b55f5c15876b7253680cde6e23 diff --git a/sw/qa/extras/rtfimport/data/tdf90046.rtf b/sw/qa/extras/rtfimport/data/tdf90046.rtf new file mode 100644 index 0000000..656adb5 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf90046.rtf @@ -0,0 +1,8 @@ +{\rtf1\ansi\deflang1035 +{\fonttbl {\f0\fcharset0 Arial;} } + +\pard\ltrpar\uc1\lang1035 +{\super \chftn +{\footnote {\pard\plain\super \chftn }{\plain\ltrch\f0 \fs18 \cf1 \uc0\u77 \u97 } +}} +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 7ec1931..feb2e0a 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2173,6 +2173,15 @@ DECLARE_RTFIMPORT_TEST(testFdo85889pca, "fdo85889-pca.rtf") CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); } +DECLARE_RTFIMPORT_TEST(testTdf90046, "tdf90046.rtf") +{ + // this was crashing on importing the footnote + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Ma"), xTextRange->getString()); +} + DECLARE_RTFIMPORT_TEST(testFdo85889mac, "fdo85889-mac.rtf") { uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 43c73c2..8b25158 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1675,6 +1675,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) } break; case RTF_FOOTNOTE: + checkFirstRun(); if (!m_pSuperstream) { Id nId = NS_ooxml::LN_footnote; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits