summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-06 12:05:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-06 16:35:46 +0000
commitd60392fb5b387175dbd2e575848993c02c56922f (patch)
tree5f31b199a10761570552c6fe92c2334db65bbb3e /connectivity
parent553554d0c837b768bd24847320e0b4087a172aad (diff)
coverity#706316 help out coverity re tortured logic
Change-Id: I6d6a948fdac4442c69972316275349fe73b9e741
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/hsqldb/HView.cxx23
-rw-r--r--connectivity/source/inc/hsqldb/HView.hxx8
2 files changed, 15 insertions, 16 deletions
diff --git a/connectivity/source/drivers/hsqldb/HView.cxx b/connectivity/source/drivers/hsqldb/HView.cxx
index 15cec42de916..4749a0651e39 100644
--- a/connectivity/source/drivers/hsqldb/HView.cxx
+++ b/connectivity/source/drivers/hsqldb/HView.cxx
@@ -101,7 +101,7 @@ namespace connectivity { namespace hsqldb
aRestoreCommand.appendAscii( "CREATE VIEW " );
aRestoreCommand.append ( sQualifiedName );
aRestoreCommand.appendAscii( " AS " );
- aRestoreCommand.append ( impl_getCommand_throw( true ) );
+ aRestoreCommand.append ( impl_getCommand_throw() );
OUString sRestoreCommand( aRestoreCommand.makeStringAndClear() );
bool bDropSucceeded( false );
@@ -150,15 +150,23 @@ namespace connectivity { namespace hsqldb
{
// retrieve the very current command, don't rely on the base classes cached value
// (which we initialized empty, anyway)
- _rValue <<= impl_getCommand_throw( false );
- return;
+ try
+ {
+ _rValue <<= impl_getCommand_throw();
+ }
+ catch (const SQLException& e)
+ {
+ throw WrappedTargetException(e.Message,
+ static_cast< XAlterView* >( const_cast< HView* >( this ) ),
+ ::cppu::getCaughtException() );
+ }
}
HView_Base::getFastPropertyValue( _rValue, _nHandle );
}
- OUString HView::impl_getCommand_throw( bool _bAllowSQLException ) const
+ OUString HView::impl_getCommand_throw() const
{
OUString sCommand;
@@ -180,12 +188,7 @@ namespace connectivity { namespace hsqldb
sCommand = xRow->getString( 1 );
}
catch( const RuntimeException& ) { throw; }
- catch( const SQLException& e )
- {
- if ( _bAllowSQLException )
- throw;
- throw WrappedTargetException( e.Message, static_cast< XAlterView* >( const_cast< HView* >( this ) ), ::cppu::getCaughtException() );
- }
+ catch( const SQLException& ) { throw; }
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
diff --git a/connectivity/source/inc/hsqldb/HView.hxx b/connectivity/source/inc/hsqldb/HView.hxx
index 3752a128f99f..a554a0b65143 100644
--- a/connectivity/source/inc/hsqldb/HView.hxx
+++ b/connectivity/source/inc/hsqldb/HView.hxx
@@ -65,14 +65,10 @@ namespace connectivity { namespace hsqldb
private:
/** retrieves the current command of the View
- @throws ::com::sun::star::lang::WrappedTargetException
- if an error occurs while retrieving the command from the database and
- <arg>_bAllowSQLExceptin</arg> is <FALSE/>
@throws ::com::sun::star::sdbc::SQLException
- if an error occurs while retrieving the command from the database and
- <arg>_bAllowSQLException</arg> is <TRUE/>
+ if an error occurs while retrieving the command from the database.
*/
- OUString impl_getCommand_throw( bool _bAllowSQLException ) const;
+ OUString impl_getCommand_throw() const;
private:
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;