diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-10-13 12:57:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-10-13 16:14:05 +0200 |
commit | 17f5c8ef18202355189f8b1b11f67b4e106fd31e (patch) | |
tree | 4ac8b2b41ac80a87f6e68a5d6803f8844c66b077 /sd/source | |
parent | 665d1633c9e08da85fae179e62923211bc07c480 (diff) |
crashtesting: uncaught exception on export of forum-fr-20226.sxi to pptx
due to not-found wav file linked to from presentation
Change-Id: I48c7b4615d660a2a292feea36e228237235ab04f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141294
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 9a6bd502958c..d08b399309d7 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -53,6 +53,7 @@ #include <com/sun/star/container/XIndexContainer.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> +#include <comphelper/diagnose_ex.hxx> #include <oox/export/utils.hxx> @@ -2414,24 +2415,31 @@ void PowerPointExport::embedEffectAudio(const FSHelperPtr& pFS, const OUString& return; uno::Reference<io::XInputStream> xAudioStream; - if (sUrl.startsWith("vnd.sun.star.Package:")) + try { - uno::Reference<document::XStorageBasedDocument> xStorageBasedDocument(getModel(), uno::UNO_QUERY); - if (!xStorageBasedDocument.is()) - return; + if (sUrl.startsWith("vnd.sun.star.Package:")) + { + uno::Reference<document::XStorageBasedDocument> xStorageBasedDocument(getModel(), uno::UNO_QUERY); + if (!xStorageBasedDocument.is()) + return; - uno::Reference<embed::XStorage> xDocumentStorage = xStorageBasedDocument->getDocumentStorage(); - if (!xDocumentStorage.is()) - return; + uno::Reference<embed::XStorage> xDocumentStorage = xStorageBasedDocument->getDocumentStorage(); + if (!xDocumentStorage.is()) + return; - uno::Reference<io::XStream> xStream = comphelper::OStorageHelper::GetStreamAtPackageURL(xDocumentStorage, sUrl, - css::embed::ElementModes::READ, aProxy); + uno::Reference<io::XStream> xStream = comphelper::OStorageHelper::GetStreamAtPackageURL(xDocumentStorage, sUrl, + css::embed::ElementModes::READ, aProxy); - if (xStream.is()) - xAudioStream = xStream->getInputStream(); + if (xStream.is()) + xAudioStream = xStream->getInputStream(); + } + else + xAudioStream = comphelper::OStorageHelper::GetInputStreamFromURL(sUrl, getComponentContext()); + } + catch (const Exception&) + { + TOOLS_WARN_EXCEPTION("sd", "PowerPointExport::embedEffectAudio"); } - else - xAudioStream = comphelper::OStorageHelper::GetInputStreamFromURL(sUrl, getComponentContext()); if (!xAudioStream.is()) return; |