summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-05 10:55:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-05 14:58:00 +0000
commitea272d9fe4bf2dc7419f76e2ddee707d768ccd50 (patch)
treeef16fc0ea4dba6f5604866f8e662b7f93b7d40b4 /filter
parent47db04bfdeb642c09a30f0ee85de30255c2ea2b7 (diff)
coverity#737143 Uncaught exception
Change-Id: If90208f2fb9be0a44cabfc9b281b3715772b30d1
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/test/svg2odf.cxx44
1 files changed, 24 insertions, 20 deletions
diff --git a/filter/source/svg/test/svg2odf.cxx b/filter/source/svg/test/svg2odf.cxx
index d923dd42715a..78188fa4ca1a 100644
--- a/filter/source/svg/test/svg2odf.cxx
+++ b/filter/source/svg/test/svg2odf.cxx
@@ -90,36 +90,40 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
// bootstrap UNO
uno::Reference< lang::XMultiServiceFactory > xFactory;
uno::Reference< uno::XComponentContext > xCtx;
+ int nRet = 1;
try
{
xCtx = ::cppu::defaultBootstrap_InitialComponentContext(aIniUrl);
xFactory = uno::Reference< lang::XMultiServiceFactory >(xCtx->getServiceManager(),
uno::UNO_QUERY);
- if( xFactory.is() )
- ::comphelper::setProcessServiceFactory( xFactory );
- }
- catch( const uno::Exception& )
- {
- }
+ if (!xFactory.is())
+ {
+ OSL_TRACE( "Could not bootstrap UNO, installation must be in disorder. Exiting." );
+ return 1;
+ }
- if( !xFactory.is() )
- {
- OSL_TRACE( "Could not bootstrap UNO, installation must be in disorder. Exiting." );
- return 1;
- }
+ ::comphelper::setProcessServiceFactory( xFactory );
+
+ osl::File aInputFile(aSrcURL);
+ if( osl::FileBase::E_None!=aInputFile.open(osl_File_OpenFlag_Read) )
+ {
+ OSL_TRACE( "Cannot open input file" );
+ return 1;
+ }
- osl::File aInputFile(aSrcURL);
- if( osl::FileBase::E_None!=aInputFile.open(osl_File_OpenFlag_Read) )
+ svgi::SVGReader aReader(xCtx,
+ uno::Reference<io::XInputStream>(
+ new comphelper::OSLInputStreamWrapper(aInputFile)),
+ svgi::createSerializer(new OutputWrap(aDstURL)));
+ nRet = aReader.parseAndConvert() ? 0 : 1;
+
+ }
+ catch (const uno::Exception& e)
{
- OSL_TRACE( "Cannot open input file" );
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
return 1;
}
-
- svgi::SVGReader aReader(xCtx,
- uno::Reference<io::XInputStream>(
- new comphelper::OSLInputStreamWrapper(aInputFile)),
- svgi::createSerializer(new OutputWrap(aDstURL)));
- return aReader.parseAndConvert() ? 0 : 1;
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */