summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-07 14:52:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-07 15:44:00 +0100
commite110726bab424a8c84b919bc2ab0d7f009ba9359 (patch)
tree0d597ab370cc8f564d05ecf39d74fb52a88b5473
parent24d20bce789063f6dba2df1c5d2c5a8948d24370 (diff)
don't terminate via unhandled exception on loading rhbz1013280-2.ppt
Change-Id: Ie2bff125f6839d99280d441b823eb6e0a712844d
-rw-r--r--filter/source/svg/svgfilter.hxx2
-rw-r--r--filter/source/svg/svgimport.cxx21
2 files changed, 19 insertions, 4 deletions
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 7b68c2b640ed..0435ef78c9b6 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -266,7 +266,7 @@ private:
Link maOldFieldHdl;
- bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException);
+ bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException, std::exception);
bool implExport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException);
Reference< XWriter > implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm );
diff --git a/filter/source/svg/svgimport.cxx b/filter/source/svg/svgimport.cxx
index fc32d0f94eec..b803b6d62285 100644
--- a/filter/source/svg/svgimport.cxx
+++ b/filter/source/svg/svgimport.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/xml/XImportFilter.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <unotools/mediadescriptor.hxx>
@@ -45,8 +46,8 @@
using namespace ::com::sun::star;
using namespace ::svgi;
-bool SVGFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
- throw (RuntimeException)
+bool SVGFilter::implImport(const Sequence< PropertyValue >& rDescriptor)
+ throw (RuntimeException, std::exception)
{
utl::MediaDescriptor aMediaDescriptor(rDescriptor);
uno::Reference<io::XInputStream> xInputStream;
@@ -95,8 +96,22 @@ bool SVGFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
xImporter->setTargetDocument(mxDstDoc);
+ bool bRet = false;
SVGReader aReader(mxContext, xInputStream, xInternalHandler);
- return aReader.parseAndConvert();
+ try
+ {
+ bRet = aReader.parseAndConvert();
+ }
+ catch (const RuntimeException&)
+ {
+ throw;
+ }
+ catch (const Exception& e)
+ {
+ throw css::lang::WrappedTargetRuntimeException("SVGFilter::implImport non-RuntimeException",
+ static_cast<uno::XWeak*>(this), uno::makeAny(e));
+ }
+ return bRet;
}