Kaydet (Commit) d60392fb authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#706316 help out coverity re tortured logic

Change-Id: I6d6a948fdac4442c69972316275349fe73b9e741
üst 553554d0
......@@ -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();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment