[Libreoffice-commits] core.git: filter/source

Caolán McNamara caolanm at redhat.com
Mon Jul 7 07:44:25 PDT 2014


 filter/source/svg/svgfilter.hxx |    2 +-
 filter/source/svg/svgimport.cxx |   21 ++++++++++++++++++---
 2 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit e110726bab424a8c84b919bc2ab0d7f009ba9359
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 7 14:52:16 2014 +0100

    don't terminate via unhandled exception on loading rhbz1013280-2.ppt
    
    Change-Id: Ie2bff125f6839d99280d441b823eb6e0a712844d

diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 7b68c2b..0435ef7 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 fc32d0f..b803b6d 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;
 }
 
 


More information about the Libreoffice-commits mailing list