diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 10:20:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 10:22:03 +0000 |
commit | 705b6b61e3cb7c9180debaf90f8a08faf0de2bfb (patch) | |
tree | 2a07a8d9127108239e8c747038cd247a95bdd747 /ucb | |
parent | ffc3b11dc32e72651abc1ff054eafdbd424587cc (diff) |
coverity#983989 Uncaught exception
Change-Id: I7508ee67a10b43686600b41dd58c1a8a5aa90c51
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 71 |
1 files changed, 41 insertions, 30 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 720f16dfdef5..08d01a882640 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -1854,40 +1854,51 @@ namespace cmis uno::Sequence< uno::Type > SAL_CALL Content::getTypes() throw( uno::RuntimeException, std::exception ) { - if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) - { - static cppu::OTypeCollection aFolderCollection - (CPPU_TYPE_REF( lang::XTypeProvider ), - CPPU_TYPE_REF( lang::XServiceInfo ), - CPPU_TYPE_REF( lang::XComponent ), - CPPU_TYPE_REF( ucb::XContent ), - CPPU_TYPE_REF( ucb::XCommandProcessor ), - CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), - CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), - CPPU_TYPE_REF( beans::XPropertyContainer ), - CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), - CPPU_TYPE_REF( container::XChild ), - CPPU_TYPE_REF( ucb::XContentCreator ) ); - return aFolderCollection.getTypes(); + try + { + if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) + { + static cppu::OTypeCollection aFolderCollection + (CPPU_TYPE_REF( lang::XTypeProvider ), + CPPU_TYPE_REF( lang::XServiceInfo ), + CPPU_TYPE_REF( lang::XComponent ), + CPPU_TYPE_REF( ucb::XContent ), + CPPU_TYPE_REF( ucb::XCommandProcessor ), + CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), + CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), + CPPU_TYPE_REF( beans::XPropertyContainer ), + CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), + CPPU_TYPE_REF( container::XChild ), + CPPU_TYPE_REF( ucb::XContentCreator ) ); + return aFolderCollection.getTypes(); + } } - else + catch (const uno::RuntimeException&) { - static cppu::OTypeCollection aFileCollection - (CPPU_TYPE_REF( lang::XTypeProvider ), - CPPU_TYPE_REF( lang::XServiceInfo ), - CPPU_TYPE_REF( lang::XComponent ), - CPPU_TYPE_REF( ucb::XContent ), - CPPU_TYPE_REF( ucb::XCommandProcessor ), - CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), - CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), - CPPU_TYPE_REF( beans::XPropertyContainer ), - CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), - CPPU_TYPE_REF( container::XChild ) ); - - return aFileCollection.getTypes(); + throw; + } + catch (const uno::Exception& e) + { + uno::Any a(cppu::getCaughtException()); + throw lang::WrappedTargetRuntimeException( + "wrapped Exception " + e.Message, + uno::Reference<uno::XInterface>(), a); } - } + static cppu::OTypeCollection aFileCollection + (CPPU_TYPE_REF( lang::XTypeProvider ), + CPPU_TYPE_REF( lang::XServiceInfo ), + CPPU_TYPE_REF( lang::XComponent ), + CPPU_TYPE_REF( ucb::XContent ), + CPPU_TYPE_REF( ucb::XCommandProcessor ), + CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), + CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), + CPPU_TYPE_REF( beans::XPropertyContainer ), + CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), + CPPU_TYPE_REF( container::XChild ) ); + + return aFileCollection.getTypes(); + } uno::Sequence< ucb::ContentInfo > Content::queryCreatableContentsInfo( const uno::Reference< ucb::XCommandEnvironment >& xEnv) |