sw/qa/extras/ooxmlimport/data/tdf95777.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 5 +++++ writerfilter/source/ooxml/Handler.cxx | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-)
New commits: commit 26eb0debda788d996d9bd63d72947652a5066087 Author: Mike Kaganski <mike.kagan...@collabora.com> Date: Sat Nov 14 21:12:49 2015 +1000 tdf#69640: Treat errors opening OLE stream gracefully The testcase for tdf#69640 includes links (relations) to external pptx files. It demonstrates two non-fatal reasons for failure opening OLE stream: 1. it fails OStorageHelper::IsValidZipEntryFileName check, because the file path contains ":\"; 2. even if that were not the case, the required file can be absent from user's system. I suppose that intercepting the failure at the level of OOXMLOLEHandler::attribute() is the best option, because at the lower level it's unknown if this failure is fatal or not. I suppose that it could be also useful to intercept specifically failures in OStorageHelper::IsValidZipEntryFileName, checking if the file exist externally, and asking users if they want to update external links (as MSO does). Possibly it should be discussed with UX team if that should be done, and if so, do it in separate commit. Change-Id: I240a6f69abe236eb790bb406c79f3b761fb4638a Reviewed-on: https://gerrit.libreoffice.org/19963 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sw/qa/extras/ooxmlimport/data/tdf95777.docx b/sw/qa/extras/ooxmlimport/data/tdf95777.docx new file mode 100644 index 0000000..e71fdea Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf95777.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f5cc1f6..ed5c7da 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2901,6 +2901,11 @@ DECLARE_OOXMLIMPORT_TEST(testTdf89165, "tdf89165.docx") // This must not hang in layout } +DECLARE_OOXMLIMPORT_TEST(testTdf95777, "tdf95777.docx") +{ + // This must not fail on open +} + DECLARE_OOXMLIMPORT_TEST(testTdf94374, "hello.docx") { uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/ooxml/Handler.cxx b/writerfilter/source/ooxml/Handler.cxx index 89d7cdb..2010be4 100644 --- a/writerfilter/source/ooxml/Handler.cxx +++ b/writerfilter/source/ooxml/Handler.cxx @@ -125,7 +125,14 @@ void OOXMLOLEHandler::attribute(Id name, Value & val) switch (name) { case NS_ooxml::LN_CT_OLEObject_r_id: - mpFastContext->resolveData(val.getString()); + try { + mpFastContext->resolveData(val.getString()); + } + catch (const ::css::uno::Exception&) + { + // Can't resolve OLE stream + SAL_WARN("OOXMLOLEHandler::attribute", "Failed to open OLE stream!"); + } break; default: ; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits