diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-01-16 21:25:25 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-01-19 07:01:43 +0000 |
commit | a2ad27a2be429c6d17ef28c28ac5aee66ad8545d (patch) | |
tree | 64ee5565d4bcfcf90d227c811c4ec23c2a70012a /writerfilter | |
parent | use rtl::Reference in AsyncExecuteInfo (diff) | |
download | core-a2ad27a2be429c6d17ef28c28ac5aee66ad8545d.tar.gz core-a2ad27a2be429c6d17ef28c28ac5aee66ad8545d.zip |
tdf#104718: Prompt user to continue on SAXException
Change-Id: Ib0f9a89c670f8d513ebee206a6a1487802f901ff
Reviewed-on: https://gerrit.libreoffice.org/33181
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index f836cf85ac42..94f2fbba4c7e 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -41,6 +41,7 @@ #include <unotools/mediadescriptor.hxx> #include <iostream> +#include "sfx2/objsh.hxx" // this extern variable is declared in OOXMLStreamImpl.hxx OUString customTarget; @@ -503,11 +504,14 @@ void OOXMLDocumentImpl::resolve(Stream & rStream) { xParser->parseStream(aParserInput); } - catch (xml::sax::SAXException const&) + catch (xml::sax::SAXException const& rErr) { - // don't swallow these - handlers may not have been executed, + // don't silently swallow these - handlers may not have been executed, // and the domain mapper is likely in an inconsistent state - throw; + // In case user chooses to try to continue loading, don't ask again for this file + SfxObjectShell* rShell = SfxObjectShell::GetShellFromComponent(mxModel); + if (!rShell || !rShell->IsContinueImportOnFilterExceptions("SAXException: " + rErr.Message)) + throw; } catch (uno::RuntimeException const&) { |