diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-21 11:07:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-21 13:59:35 +0100 |
commit | 0317d53f7c9ae73846c03bd38d46049cdf774c4f (patch) | |
tree | 9b0724571ba16db3d6dbf2c21cd25c7ab02fbb5d /svl | |
parent | 10e0de4ee69c409d2b33f3819abaefeace7d05dd (diff) |
coverity#707209 Uncaught exception
Change-Id: I876e25678d68cba09099776bf303a6540761d2ed
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/fsstor/fsstorage.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 37ca676568a1..1cf6403042a2 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -1034,18 +1034,18 @@ uno::Sequence< OUString > SAL_CALL FSStorage::getElementNames() if ( !m_pImpl ) throw lang::DisposedException(); - if ( !GetContent() ) - throw io::IOException(); // TODO: error handling - - uno::Sequence< OUString > aProps( 1 ); - aProps[0] = "Title"; - ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; - uno::Sequence< OUString > aResult; - sal_Int32 nSize = 0; try { + if ( !GetContent() ) + throw io::IOException(); // TODO: error handling + + uno::Sequence< OUString > aProps( 1 ); + aProps[0] = "Title"; + ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; + + sal_Int32 nSize = 0; uno::Reference< sdbc::XResultSet > xResultSet = GetContent()->createCursor( aProps, eInclude ); uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY ); @@ -1072,11 +1072,11 @@ uno::Sequence< OUString > SAL_CALL FSStorage::getElementNames() aCaught ); } } - catch( uno::RuntimeException& ) + catch (const uno::RuntimeException&) { throw; } - catch ( uno::Exception& ) + catch (const uno::Exception&) { uno::Any aCaught( ::cppu::getCaughtException() ); throw lang::WrappedTargetRuntimeException( "Can not open storage!", @@ -1087,7 +1087,6 @@ uno::Sequence< OUString > SAL_CALL FSStorage::getElementNames() return aResult; } - sal_Bool SAL_CALL FSStorage::hasByName( const OUString& aName ) throw ( uno::RuntimeException, std::exception ) { |