diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 10:19:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 10:22:03 +0000 |
commit | ffc3b11dc32e72651abc1ff054eafdbd424587cc (patch) | |
tree | 618c872060b1d1cc86da11d2a7e9a656524ff272 /ucb | |
parent | 0ac7311562bc059d803aa61186b5a5fc7f7dd1a7 (diff) |
coverity#983985 Uncaught exception
Change-Id: I0082d75aa2c00daa35d8d72e44fbb6da161f9774
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 4bc9d0058def..720f16dfdef5 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -1893,35 +1893,46 @@ namespace cmis const uno::Reference< ucb::XCommandEnvironment >& xEnv) throw( uno::RuntimeException ) { - if ( isFolder( xEnv ) ) + try { - uno::Sequence< ucb::ContentInfo > seq(2); - - // Minimum set of props we really need - uno::Sequence< beans::Property > props( 1 ); - props[0] = beans::Property( - OUString("Title"), - -1, - cppu::UnoType<OUString>::get(), - beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); - - // file - seq[0].Type = CMIS_FILE_TYPE; - seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | - ucb::ContentInfoAttribute::KIND_DOCUMENT ); - seq[0].Properties = props; - - // folder - seq[1].Type = CMIS_FOLDER_TYPE; - seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; - seq[1].Properties = props; - - return seq; + if ( isFolder( xEnv ) ) + { + uno::Sequence< ucb::ContentInfo > seq(2); + + // Minimum set of props we really need + uno::Sequence< beans::Property > props( 1 ); + props[0] = beans::Property( + OUString("Title"), + -1, + cppu::UnoType<OUString>::get(), + beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); + + // file + seq[0].Type = CMIS_FILE_TYPE; + seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | + ucb::ContentInfoAttribute::KIND_DOCUMENT ); + seq[0].Properties = props; + + // folder + seq[1].Type = CMIS_FOLDER_TYPE; + seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; + seq[1].Properties = props; + + return seq; + } } - else + catch (const uno::RuntimeException&) { - return uno::Sequence< ucb::ContentInfo >(); + throw; + } + catch (const uno::Exception& e) + { + uno::Any a(cppu::getCaughtException()); + throw lang::WrappedTargetRuntimeException( + "wrapped Exception " + e.Message, + uno::Reference<uno::XInterface>(), a); } + return uno::Sequence< ucb::ContentInfo >(); } list< uno::Reference< ucb::XContent > > Content::getChildren( ) |