diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-31 11:42:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-31 13:04:14 +0000 |
commit | 9b5718284e22902641e76377cdc96f8399f8657e (patch) | |
tree | 0e3785dfed49cee8e7be2ecaee53e701d7b58a4b /ucb | |
parent | 337abdbc67d4e021c31bc5990c199fd3f18d6417 (diff) |
coverity#707418 Uncaught exception
and
coverity#707419 Uncaught exception
coverity#707420 Uncaught exception
Change-Id: I98d752c14be5f7b1fccb4bdf2eeefb6bbfe12e0e
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.cxx | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 954aa09feaa6..eedcc07c641b 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -25,9 +25,11 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/script/Converter.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <rtl/ustring.hxx> #include <osl/diagnose.h> #include <comphelper/processfactory.hxx> +#include <cppuhelper/exc_hlp.hxx> #include <boost/scoped_ptr.hpp> using namespace com::sun::star::beans; @@ -1275,7 +1277,7 @@ void SAL_CALL CachedContentResultSet // XContentAccess methods. ( inherited ) ( -- position dependent ) -#define XCONTENTACCESS_queryXXX( queryXXX, XXX, TYPE ) \ +#define XCONTENTACCESS_queryXXX( queryXXX, XXX, TYPE ) \ impl_EnsureNotDisposed(); \ ReacquireableGuard aGuard( m_aMutex ); \ sal_Int32 nRow = m_nRow; \ @@ -1283,33 +1285,46 @@ sal_Int32 nFetchSize = m_nFetchSize; \ sal_Int32 nFetchDirection = m_nFetchDirection; \ if( !m_aCache##XXX.hasRow( nRow ) ) \ { \ - if( !m_aCache##XXX.hasCausedException( nRow ) ) \ -{ \ - if( !m_xFetchProviderForContentAccess.is() ) \ + try \ + { \ + if( !m_aCache##XXX.hasCausedException( nRow ) ) \ { \ - OSL_FAIL( "broadcaster was disposed already" );\ - throw RuntimeException(); \ + if( !m_xFetchProviderForContentAccess.is() ) \ + { \ + OSL_FAIL( "broadcaster was disposed already" ); \ + throw RuntimeException(); \ + } \ + aGuard.clear(); \ + if( impl_isForwardOnly() ) \ + applyPositionToOrigin( nRow ); \ + \ + FETCH_XXX( m_aCache##XXX, m_xFetchProviderForContentAccess, fetch##XXX##s ); \ } \ - aGuard.clear(); \ - if( impl_isForwardOnly() ) \ + aGuard.reacquire(); \ + if( !m_aCache##XXX.hasRow( nRow ) ) \ + { \ + aGuard.clear(); \ applyPositionToOrigin( nRow ); \ - \ - FETCH_XXX( m_aCache##XXX, m_xFetchProviderForContentAccess, fetch##XXX##s ); \ + TYPE aRet = ContentResultSetWrapper::queryXXX();\ + if( m_xContentIdentifierMapping.is() ) \ + return m_xContentIdentifierMapping->map##XXX( aRet );\ + return aRet; \ + } \ + } \ + catch (const RuntimeException&) \ + { \ + throw; \ } \ - aGuard.reacquire(); \ - if( !m_aCache##XXX.hasRow( nRow ) ) \ + catch (const Exception& e) \ { \ - aGuard.clear(); \ - applyPositionToOrigin( nRow ); \ - TYPE aRet = ContentResultSetWrapper::queryXXX(); \ - if( m_xContentIdentifierMapping.is() ) \ - return m_xContentIdentifierMapping->map##XXX( aRet );\ - return aRet; \ + Any a(cppu::getCaughtException()); \ + throw WrappedTargetRuntimeException( \ + "wrapped Exception " + e.Message, \ + Reference<XInterface>(), a); \ } \ } \ return m_aCache##XXX.get##XXX( nRow ); - // virtual OUString SAL_CALL CachedContentResultSet ::queryContentIdentifierString() |