connectivity/source/drivers/jdbc/Array.cxx | 2 connectivity/source/drivers/jdbc/DatabaseMetaData.cxx | 48 +++++------ connectivity/source/drivers/jdbc/InputStream.cxx | 2 connectivity/source/drivers/jdbc/JConnection.cxx | 8 - connectivity/source/drivers/jdbc/JStatement.cxx | 19 ++-- connectivity/source/drivers/jdbc/Object.cxx | 53 +++++++++---- connectivity/source/drivers/jdbc/PreparedStatement.cxx | 2 connectivity/source/drivers/jdbc/ResultSet.cxx | 16 +-- connectivity/source/drivers/jdbc/ResultSetMetaData.cxx | 2 connectivity/source/drivers/jdbc/SQLException.cxx | 2 connectivity/source/inc/java/lang/Object.hxx | 9 +- dbaccess/source/core/dataaccess/databasedocument.cxx | 41 +++++----- dbaccess/source/sdbtools/connection/datasourcemetadata.cxx | 2 dbaccess/source/sdbtools/connection/objectnames.cxx | 2 dbaccess/source/sdbtools/connection/tablename.cxx | 3 filter/source/svg/svgreader.cxx | 2 sc/source/ui/unoobj/nameuno.cxx | 5 - sw/source/core/doc/DocumentContentOperationsManager.cxx | 2 sw/source/core/doc/docnew.cxx | 4 sw/source/filter/ww8/ww8par5.cxx | 2 sw/source/ui/frmdlg/frmpage.cxx | 2 21 files changed, 126 insertions(+), 102 deletions(-)
New commits: commit 246cd66af254687628b7cbd5aa64cb9bfa87f28d Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 21:10:23 2014 +0100 coverity#706421 Uncaught exception Change-Id: I91a6ac9d9bda0ea25f1f5385bbac71ea9d22d573 diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 45199e9..c520f92 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1088,6 +1088,18 @@ void ODatabaseDocument::impl_storeAs_throw( const OUString& _rURL, const ::comph if ( bIsInitializationProcess ) impl_setInitialized(); } + catch( const IOException& ) + { + if ( !bIsInitializationProcess ) + m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", NULL, makeAny( _rURL ) ); + throw; + } + catch( const RuntimeException& ) + { + if ( !bIsInitializationProcess ) + m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", NULL, makeAny( _rURL ) ); + throw; + } catch( const Exception& ) { Any aError = ::cppu::getCaughtException(); @@ -1096,14 +1108,6 @@ void ODatabaseDocument::impl_storeAs_throw( const OUString& _rURL, const ::comph if ( !bIsInitializationProcess ) m_aEventNotifier.notifyDocumentEventAsync( _eType == SAVE ? "OnSaveFailed" : "OnSaveAsFailed", NULL, makeAny( _rURL ) ); - if ( aError.isExtractableTo( ::cppu::UnoType< IOException >::get() ) - || aError.isExtractableTo( ::cppu::UnoType< RuntimeException >::get() ) - ) - { - // allowed to leave - throw; - } - impl_throwIOExceptionCausedBySave_throw( aError, _rURL ); } commit e7d3f4b704c42a9035891700cf57f35aeca2aec7 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 21:08:39 2014 +0100 coverity#706404 Uncaught exception Change-Id: I7717b61e89d95cb6d89bb273c22c0503b0853d96 diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 29dd1f4..45199e9 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -732,18 +732,21 @@ void SAL_CALL ODatabaseDocument::recoverFromFile( const OUString& i_SourceLocati impl_attachResource( sLogicalDocumentURL, aMediaDescriptor.getPropertyValues(), aGuard ); // <- SYNCHRONIZED } + catch( const IOException& ) + { + throw; + } + catch( const RuntimeException& ) + { + throw; + } + catch( const WrappedTargetException& ) + { + throw; + } catch( const Exception& ) { Any aError = ::cppu::getCaughtException(); - if ( aError.isExtractableTo( ::cppu::UnoType< IOException >::get() ) - || aError.isExtractableTo( ::cppu::UnoType< RuntimeException >::get() ) - || aError.isExtractableTo( ::cppu::UnoType< WrappedTargetException >::get() ) - ) - { - // allowed to leave - throw; - } - throw WrappedTargetException( OUString(), *this, aError ); } } commit 32db3f5dc4fccecc8c66b1cb4f4444f2e517e648 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:55:27 2014 +0100 coverity#706331 Uncaught exception Change-Id: I48e11a07924418721d45fcac55bd5aeb68f115a3 diff --git a/connectivity/source/drivers/jdbc/Array.cxx b/connectivity/source/drivers/jdbc/Array.cxx index 8fccdef..d3ff1ba 100644 --- a/connectivity/source/drivers/jdbc/Array.cxx +++ b/connectivity/source/drivers/jdbc/Array.cxx @@ -49,7 +49,7 @@ OUString SAL_CALL java_sql_Array::getBaseTypeName( ) throw(::com::sun::star::sd sal_Int32 SAL_CALL java_sql_Array::getBaseType( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - return callIntMethod("getBaseType",mID); + return callIntMethod_Throw("getBaseType", mID); } ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL java_sql_Array::getArray( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx index d256c7b..63b73cd 100644 --- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx @@ -241,73 +241,73 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getVersionColumns( sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxBinaryLiteralLength", mID ); + return impl_callIntMethod("getMaxBinaryLiteralLength", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxRowSize", mID ); + return impl_callIntMethod("getMaxRowSize", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxCatalogNameLength", mID ); + return impl_callIntMethod("getMaxCatalogNameLength", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxCharLiteralLength", mID ); + return impl_callIntMethod("getMaxCharLiteralLength", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxColumnNameLength", mID ); + return impl_callIntMethod("getMaxColumnNameLength", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxColumnsInIndex", mID ); + return impl_callIntMethod("getMaxColumnsInIndex", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxCursorNameLength", mID ); + return impl_callIntMethod("getMaxCursorNameLength", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxConnections", mID ); + return impl_callIntMethod("getMaxConnections", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxColumnsInTable", mID ); + return impl_callIntMethod("getMaxColumnsInTable", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxStatementLength", mID ); + return impl_callIntMethod("getMaxStatementLength", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxTableNameLength", mID ); + return impl_callIntMethod("getMaxTableNameLength", mID); } sal_Int32 java_sql_DatabaseMetaData::impl_getMaxTablesInSelect_throw( ) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxTablesInSelect", mID ); + return impl_callIntMethod("getMaxTablesInSelect", mID); } Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getExportedKeys( @@ -567,7 +567,7 @@ OUString java_sql_DatabaseMetaData::impl_callStringMethod( const char* _pMethodN sal_Int32 java_sql_DatabaseMetaData::impl_callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) { m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName ); - sal_Int32 out( (sal_Int32)callIntMethod(_pMethodName,_inout_MethodID) ); + sal_Int32 out( (sal_Int32)callIntMethod_Throw(_pMethodName,_inout_MethodID) ); m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, (sal_Int32)out ); return out; } @@ -722,7 +722,7 @@ bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( ) sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxIndexLength", mID ); + return impl_callIntMethod("getMaxIndexLength", mID); } sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException, std::exception) @@ -896,19 +896,19 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTableTypes( ) th sal_Int32 java_sql_DatabaseMetaData::impl_getMaxStatements_throw( ) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxStatements", mID ); + return impl_callIntMethod("getMaxStatements", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxProcedureNameLength", mID ); + return impl_callIntMethod("getMaxProcedureNameLength", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxSchemaNameLength", mID ); + return impl_callIntMethod("getMaxSchemaNameLength", mID); } sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException, std::exception) @@ -1215,19 +1215,19 @@ OUString SAL_CALL java_sql_DatabaseMetaData::getSchemaTerm( ) throw(SQLExceptio sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getDriverMajorVersion", mID ); + return impl_callIntMethod("getDriverMajorVersion", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getDefaultTransactionIsolation", mID ); + return impl_callIntMethod("getDefaultTransactionIsolation", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getDriverMinorVersion", mID ); + return impl_callIntMethod("getDriverMinorVersion", mID); } OUString SAL_CALL java_sql_DatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException, std::exception) @@ -1299,25 +1299,25 @@ sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLimitedOuterJoins( ) throw sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxColumnsInGroupBy", mID ); + return impl_callIntMethod("getMaxColumnsInGroupBy", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxColumnsInOrderBy", mID ); + return impl_callIntMethod("getMaxColumnsInOrderBy", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxColumnsInSelect", mID ); + return impl_callIntMethod("getMaxColumnsInSelect", mID); } sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return impl_callIntMethod( "getMaxUserNameLength", mID ); + return impl_callIntMethod("getMaxUserNameLength", mID); } sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/jdbc/InputStream.cxx b/connectivity/source/drivers/jdbc/InputStream.cxx index 26d8a15..16341a1 100644 --- a/connectivity/source/drivers/jdbc/InputStream.cxx +++ b/connectivity/source/drivers/jdbc/InputStream.cxx @@ -68,7 +68,7 @@ void SAL_CALL java_io_InputStream::skipBytes( sal_Int32 nBytesToSkip ) throw(::c sal_Int32 SAL_CALL java_io_InputStream::available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - return callIntMethod("available",mID); + return callIntMethod_Throw("available", mID); } void SAL_CALL java_io_InputStream::closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) { diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index a9b8ef9..d9a3881 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -401,13 +401,13 @@ sal_Bool SAL_CALL java_sql_Connection::getAutoCommit( ) throw(SQLException, Run void SAL_CALL java_sql_Connection::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethodWithBoolArg("setReadOnly",mID,readOnly); + callVoidMethodWithBoolArg_Throw("setReadOnly", mID, readOnly); } void SAL_CALL java_sql_Connection::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethodWithBoolArg("setAutoCommit",mID,autoCommit); + callVoidMethodWithBoolArg_Throw("setAutoCommit", mID, autoCommit); } Reference< ::com::sun::star::container::XNameAccess > SAL_CALL java_sql_Connection::getTypeMap( ) throw(SQLException, RuntimeException, std::exception) @@ -437,7 +437,7 @@ sal_Int32 SAL_CALL java_sql_Connection::getTransactionIsolation( ) throw(SQLExc checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed); static jmethodID mID(NULL); - return callIntMethod("getTransactionIsolation",mID); + return callIntMethod_Throw("getTransactionIsolation", mID); } void SAL_CALL java_sql_Connection::setTransactionIsolation( sal_Int32 level ) throw(SQLException, RuntimeException, std::exception) @@ -446,7 +446,7 @@ void SAL_CALL java_sql_Connection::setTransactionIsolation( sal_Int32 level ) th checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed); static jmethodID mID(NULL); - callVoidMethodWithIntArg("setTransactionIsolation",mID,level); + callVoidMethodWithIntArg_Throw("setTransactionIsolation", mID, level); } Reference< XStatement > SAL_CALL java_sql_Connection::createStatement( ) throw(SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx index 3f5958e..16d6631 100644 --- a/connectivity/source/drivers/jdbc/JStatement.cxx +++ b/connectivity/source/drivers/jdbc/JStatement.cxx @@ -368,7 +368,7 @@ sal_Int32 SAL_CALL java_sql_Statement_Base::getUpdateCount( ) throw(::com::sun: SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - sal_Int32 out = callIntMethod("getUpdateCount",mID); + sal_Int32 out = callIntMethod_Throw("getUpdateCount", mID); m_aLogger.log( LogLevel::FINER, STR_LOG_UPDATE_COUNT, (sal_Int32)out ); return out; } @@ -442,8 +442,7 @@ sal_Int32 java_sql_Statement_Base::impl_getProperty(const char* _pMethodName, jm { sal_Int32 out = _nDefault; if ( object ) - out = callIntMethod(_pMethodName,_inout_MethodID,true); - + out = callIntMethod_Nothrow(_pMethodName, _inout_MethodID); return out; } @@ -451,7 +450,7 @@ sal_Int32 java_sql_Statement_Base::impl_getProperty(const char* _pMethodName, jm { SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); - return callIntMethod(_pMethodName,_inout_MethodID,true); + return callIntMethod_Nothrow(_pMethodName, _inout_MethodID); } @@ -497,7 +496,7 @@ void java_sql_Statement_Base::setQueryTimeOut(sal_Int32 _par0) throw(SQLExceptio SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethodWithIntArg("setQueryTimeOut",mID,_par0,true); + callVoidMethodWithIntArg_Nothrow("setQueryTimeOut", mID, _par0); } @@ -511,7 +510,7 @@ void java_sql_Statement_Base::setEscapeProcessing(bool _par0) throw(SQLException m_bEscapeProcessing = _par0; createStatement( t.pEnv ); static jmethodID mID(NULL); - callVoidMethodWithBoolArg("setEscapeProcessing",mID,_par0,true); + callVoidMethodWithBoolArg_Nothrow("setEscapeProcessing", mID, _par0); } @@ -522,7 +521,7 @@ void java_sql_Statement_Base::setMaxRows(sal_Int32 _par0) throw(SQLException, Ru SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethodWithIntArg("setMaxRows",mID,_par0,true); + callVoidMethodWithIntArg_Nothrow("setMaxRows", mID, _par0); } void java_sql_Statement_Base::setResultSetConcurrency(sal_Int32 _par0) throw(SQLException, RuntimeException) @@ -553,7 +552,7 @@ void java_sql_Statement_Base::setFetchDirection(sal_Int32 _par0) throw(SQLExcept SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethodWithIntArg("setFetchDirection",mID,_par0,true); + callVoidMethodWithIntArg_Nothrow("setFetchDirection", mID, _par0); } void java_sql_Statement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, RuntimeException) @@ -565,7 +564,7 @@ void java_sql_Statement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethodWithIntArg("setFetchSize",mID,_par0,true); + callVoidMethodWithIntArg_Nothrow("setFetchSize", mID, _par0); } void java_sql_Statement_Base::setMaxFieldSize(sal_Int32 _par0) throw(SQLException, RuntimeException) @@ -575,7 +574,7 @@ void java_sql_Statement_Base::setMaxFieldSize(sal_Int32 _par0) throw(SQLExceptio SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethodWithIntArg("setMaxFieldSize",mID,_par0,true); + callVoidMethodWithIntArg_Nothrow("setMaxFieldSize", mID, _par0); } void java_sql_Statement_Base::setCursorName(const OUString &_par0) throw(SQLException, RuntimeException) diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 6752948..37538fa 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -262,19 +262,25 @@ jobject java_lang_Object::callResultSetMethod( JNIEnv& _rEnv,const char* _pMetho return out; } -sal_Int32 java_lang_Object::callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID,bool _bIgnoreException ) const +sal_Int32 java_lang_Object::callIntMethod_Throw(const char* _pMethodName, jmethodID& _inout_MethodID) const { SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); obtainMethodId(t.pEnv, _pMethodName,"()I", _inout_MethodID); - // call method jint out( t.pEnv->CallIntMethod( object, _inout_MethodID ) ); - if ( _bIgnoreException ) - isExceptionOccurred(t.pEnv,true); - else - ThrowSQLException( t.pEnv, NULL ); + ThrowSQLException( t.pEnv, NULL ); + return (sal_Int32)out; +} +sal_Int32 java_lang_Object::callIntMethod_Nothrow(const char* _pMethodName, jmethodID& _inout_MethodID) const +{ + SDBThreadAttach t; + OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); + obtainMethodId(t.pEnv, _pMethodName,"()I", _inout_MethodID); + // call method + jint out( t.pEnv->CallIntMethod( object, _inout_MethodID ) ); + isExceptionOccurred(t.pEnv,true); return (sal_Int32)out; } @@ -301,7 +307,7 @@ void java_lang_Object::callVoidMethod( const char* _pMethodName, jmethodID& _ino ThrowSQLException( t.pEnv, NULL ); } -void java_lang_Object::callVoidMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument,bool _bIgnoreException ) const +void java_lang_Object::callVoidMethodWithIntArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const { SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); @@ -309,23 +315,38 @@ void java_lang_Object::callVoidMethodWithIntArg( const char* _pMethodName, jmeth // call method t.pEnv->CallVoidMethod( object, _inout_MethodID,_nArgument ); - if ( _bIgnoreException ) - isExceptionOccurred(t.pEnv,true); - else - ThrowSQLException( t.pEnv, NULL ); + ThrowSQLException( t.pEnv, NULL ); +} + +void java_lang_Object::callVoidMethodWithIntArg_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const +{ + SDBThreadAttach t; + OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); + obtainMethodId(t.pEnv, _pMethodName,"(I)V", _inout_MethodID); + + // call method + t.pEnv->CallVoidMethod( object, _inout_MethodID,_nArgument ); + isExceptionOccurred(t.pEnv,true); +} + +void java_lang_Object::callVoidMethodWithBoolArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const +{ + SDBThreadAttach t; + OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); + obtainMethodId(t.pEnv, _pMethodName,"(Z)V", _inout_MethodID); + // call method + t.pEnv->CallVoidMethod( object, _inout_MethodID,int(_nArgument) ); + ThrowSQLException( t.pEnv, NULL ); } -void java_lang_Object::callVoidMethodWithBoolArg( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument,bool _bIgnoreException ) const +void java_lang_Object::callVoidMethodWithBoolArg_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const { SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); obtainMethodId(t.pEnv, _pMethodName,"(Z)V", _inout_MethodID); // call method t.pEnv->CallVoidMethod( object, _inout_MethodID,int(_nArgument) ); - if ( _bIgnoreException ) - isExceptionOccurred(t.pEnv,true); - else - ThrowSQLException( t.pEnv, NULL ); + isExceptionOccurred(t.pEnv,true); } OUString java_lang_Object::callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx index ecd7d01..7309a20 100644 --- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx +++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx @@ -113,7 +113,7 @@ sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate( ) throw(::com::su SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - return callIntMethod("executeUpdate",mID); + return callIntMethod_Throw("executeUpdate", mID); } diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx index d6553a8..881fc46 100644 --- a/connectivity/source/drivers/jdbc/ResultSet.cxx +++ b/connectivity/source/drivers/jdbc/ResultSet.cxx @@ -225,7 +225,7 @@ sal_Int32 SAL_CALL java_sql_ResultSet::getInt( sal_Int32 columnIndex ) throw(SQL sal_Int32 SAL_CALL java_sql_ResultSet::getRow( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - return callIntMethod("getRow",mID); + return callIntMethod_Throw("getRow", mID); } @@ -574,7 +574,7 @@ void SAL_CALL java_sql_ResultSet::moveToCurrentRow( ) throw(::com::sun::star::s void SAL_CALL java_sql_ResultSet::updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethodWithIntArg("updateNull",mID,columnIndex); + callVoidMethodWithIntArg_Throw("updateNull", mID, columnIndex); } @@ -824,25 +824,25 @@ void SAL_CALL java_sql_ResultSet::updateNumericObject( sal_Int32 columnIndex, co sal_Int32 java_sql_ResultSet::getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { static jmethodID mID(NULL); - return callIntMethod("getConcurrency",mID,true); + return callIntMethod_Nothrow("getConcurrency", mID); } sal_Int32 java_sql_ResultSet::getResultSetType() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { static jmethodID mID(NULL); - return callIntMethod("getType",mID,true); + return callIntMethod_Nothrow("getType",mID); } sal_Int32 java_sql_ResultSet::getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { static jmethodID mID(NULL); - return callIntMethod("getFetchDirection",mID,true); + return callIntMethod_Nothrow("getFetchDirection", mID); } sal_Int32 java_sql_ResultSet::getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { static jmethodID mID(NULL); - return callIntMethod("getFetchSize",mID,true); + return callIntMethod_Nothrow("getFetchSize", mID); } OUString java_sql_ResultSet::getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) @@ -855,7 +855,7 @@ OUString java_sql_ResultSet::getCursorName() const throw(::com::sun::star::sdbc: void java_sql_ResultSet::setFetchDirection(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { static jmethodID mID(NULL); - callVoidMethodWithIntArg("setFetchDirection",mID,_par0,true); + callVoidMethodWithIntArg_Nothrow("setFetchDirection", mID, _par0); } void SAL_CALL java_sql_ResultSet::refreshRow( ) throw(SQLException, RuntimeException, std::exception) @@ -867,7 +867,7 @@ void SAL_CALL java_sql_ResultSet::refreshRow( ) throw(SQLException, RuntimeExce void java_sql_ResultSet::setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { static jmethodID mID(NULL); - callVoidMethodWithIntArg("setFetchSize",mID,_par0,true); + callVoidMethodWithIntArg_Nothrow("setFetchSize", mID, _par0); } ::cppu::IPropertyArrayHelper* java_sql_ResultSet::createArrayHelper( ) const diff --git a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx index 74dc2f8..91c548a 100644 --- a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx +++ b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx @@ -74,7 +74,7 @@ sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnCount( ) throw(SQLExcep if ( m_nColumnCount == -1 ) { static jmethodID mID(NULL); - m_nColumnCount = callIntMethod("getColumnCount",mID); + m_nColumnCount = callIntMethod_Throw("getColumnCount", mID); } // if ( m_nColumnCount == -1 ) return m_nColumnCount; diff --git a/connectivity/source/drivers/jdbc/SQLException.cxx b/connectivity/source/drivers/jdbc/SQLException.cxx index be3d244..1b2cc88 100644 --- a/connectivity/source/drivers/jdbc/SQLException.cxx +++ b/connectivity/source/drivers/jdbc/SQLException.cxx @@ -84,7 +84,7 @@ OUString java_sql_SQLException_BASE::getSQLState() const sal_Int32 java_sql_SQLException_BASE::getErrorCode() const { static jmethodID mID(NULL); - return callIntMethod("getErrorCode",mID); + return callIntMethod_Throw("getErrorCode", mID); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/java/lang/Object.hxx b/connectivity/source/inc/java/lang/Object.hxx index 6fa0d3d..ed839c7 100644 --- a/connectivity/source/inc/java/lang/Object.hxx +++ b/connectivity/source/inc/java/lang/Object.hxx @@ -114,14 +114,17 @@ namespace connectivity bool callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const; bool callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const; jobject callResultSetMethod( JNIEnv& _rEnv, const char* _pMethodName, jmethodID& _inout_MethodID ) const; - sal_Int32 callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID,bool _bIgnoreException = false ) const; + sal_Int32 callIntMethod_Throw(const char* _pMethodName, jmethodID& _inout_MethodID) const; + sal_Int32 callIntMethod_Nothrow(const char* _pMethodName, jmethodID& _inout_MethodID) const; sal_Int32 callIntMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const; sal_Int32 callIntMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID,const OUString& _nArgument ) const; OUString callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const; OUString callStringMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const; void callVoidMethod( const char* _pMethodName, jmethodID& _inout_MethodID) const; - void callVoidMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument,bool _bIgnoreException = false ) const; - void callVoidMethodWithBoolArg( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument,bool _bIgnoreException = false ) const; + void callVoidMethodWithIntArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const; + void callVoidMethodWithIntArg_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const; + void callVoidMethodWithBoolArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const; + void callVoidMethodWithBoolArg_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const; void callVoidMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID, const OUString& _nArgument ) const; jobject callObjectMethod( JNIEnv * pEnv, const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID ) const; jobject callObjectMethodWithIntArg( JNIEnv * pEnv, const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const; commit aeac20e7bd2a2fe9b1c2ea3930e5aa3acffc3a74 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:49:22 2014 +0100 coverity#706478 Uncaught exception Change-Id: Ie37ebac80afb3e52668ae6ebeeb61eaddc892ef6 diff --git a/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx b/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx index c95334c..79f9169 100644 --- a/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx +++ b/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx @@ -43,8 +43,6 @@ namespace sdbtools :ConnectionDependentComponent( _rContext ) ,m_pImpl( new DataSourceMetaData_Impl ) { - if ( !_rxConnection.is() ) - throw NullPointerException(); setWeakConnection( _rxConnection ); } commit 92a65bd466cba57da8121a4da9f2f792e792d73b Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:48:32 2014 +0100 coverity#706476 Uncaught exception Change-Id: I1461c99fccb57ccf5375e372e50948b0b355d4bb diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx index cd3c088..3b4ace8 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.cxx +++ b/dbaccess/source/sdbtools/connection/objectnames.cxx @@ -368,8 +368,6 @@ namespace sdbtools :ConnectionDependentComponent( _rContext ) ,m_pImpl( new ObjectNames_Impl ) { - if ( !_rxConnection.is() ) - throw NullPointerException(); setWeakConnection( _rxConnection ); } commit f2747a0354daca73c606dad804d8c7336b0a5b6e Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:47:28 2014 +0100 coverity#706477 Uncaught exception Change-Id: If44507458f8473d6fede3e430e69620f8fb1d698 diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx index eef383e..64cce68 100644 --- a/dbaccess/source/sdbtools/connection/tablename.cxx +++ b/dbaccess/source/sdbtools/connection/tablename.cxx @@ -67,9 +67,6 @@ namespace sdbtools :ConnectionDependentComponent( _rContext ) ,m_pImpl( new TableName_Impl ) { - if ( !_rxConnection.is() ) - throw NullPointerException(); - setWeakConnection( _rxConnection ); } commit b8c9366803a4183d3c2088b47ddf097b72e191f5 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:42:03 2014 +0100 coverity#735337 Unchecked return value Change-Id: Ib1f27e51934d7deb4f30d74409554dfeb14928ff diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index cc148dc..740ed1c 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2567,7 +2567,7 @@ IMPL_LINK_NOARG(SwGrfExtPage, BrowseHdl) m_pBmpWin->MirrorVert(false); Graphic aGraphic; - GraphicFilter::LoadGraphic( pGrfDlg->GetPath(), aEmptyOUStr, aGraphic ); + (void)GraphicFilter::LoadGraphic(pGrfDlg->GetPath(), OUString(), aGraphic); m_pBmpWin->SetGraphic(aGraphic); bool bEnable = GRAPHIC_BITMAP == aGraphic.GetType() || commit 1119e4a98c4946ae65dfe8891e42b994148c7694 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:40:28 2014 +0100 coverity#735334 Unchecked return value Change-Id: I8023e8c11e76def505568125703f30531161dfa7 diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 0ba8fb2..227dcc7 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -904,7 +904,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const pRetShell->DoInitNew(); } - pRet->acquire(); + (void)pRet->acquire(); pRet->ReplaceDefaults(*this); @@ -924,7 +924,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const // remove the temporary shell if it is there as it was done before pRet->SetTmpDocShell( (SfxObjectShell*)NULL ); - pRet->release(); + (void)pRet->release(); return pRetShell; } commit 63fa3ba80e07b9bc88f805912920246ffe2fa5af Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:38:48 2014 +0100 coverity#735322 Unchecked return value Change-Id: I12f9392813f5fdd6f2d36398ea00a5cad812cd26 diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 74ee7a4..54b4d9f 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -896,7 +896,8 @@ ScNamedRangeObj* ScLocalNamedRangesObj::GetObjectByIndex_Impl( sal_uInt16 nIndex OUString aName = mxSheet->getName(); ScDocument& rDoc = pDocShell->GetDocument(); SCTAB nTab; - rDoc.GetTable( aName, nTab ); + if (!rDoc.GetTable(aName, nTab)) + return NULL; ScRangeName* pNames = rDoc.GetRangeName( nTab ); if (!pNames) commit 68bb74ddab23412af959436b892fdec3f963ac54 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:37:40 2014 +0100 coverity#735321 Unchecked return value Change-Id: I3733471b72e96c8d020b8b5238fdb5fc4bfcacce diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 8fe14eb..74ee7a4 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -925,7 +925,7 @@ ScRangeName* ScLocalNamedRangesObj::GetRangeName_Impl() SCTAB ScLocalNamedRangesObj::GetTab_Impl() { SCTAB nTab; - pDocShell->GetDocument().GetTable(mxSheet->getName(), nTab); + (void)pDocShell->GetDocument().GetTable(mxSheet->getName(), nTab); return nTab; } commit 7ec1643c9f6be0c0772e75ccbf8c528ac07d955f Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 20:36:00 2014 +0100 coverity#1226478 Unchecked return value Change-Id: Idcd3f35d1b5f097e61963083f11712e4ab87bdaa diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index c801788..0ae2356 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1465,7 +1465,7 @@ namespace //local functions originally from docfmt.cxx if( pNode->IsTxtNode() && pCharSet && pCharSet->Count() ) { SwRegHistory history( pNode, *pNode, pHistory ); - history.InsertItems(*pCharSet, + (void)history.InsertItems(*pCharSet, 0, aCntEnd.GetIndex(), nFlags); } commit 34de4f3e1c8cc66e11a2249143779133dd27ca89 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 17:36:15 2014 +0100 coverity#1130166 Unchecked return value Change-Id: I0730a099463ac77afce4bb999f3f00ad7bb097c7 diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 44df957..d8962e2 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -1266,7 +1266,7 @@ struct ShapeWritingVisitor { OUString sPoints = xElem->hasAttribute("points") ? xElem->getAttribute("points") : ""; basegfx::B2DPolygon aPoly; - basegfx::tools::importFromSvgPoints(aPoly, sPoints); + (void)basegfx::tools::importFromSvgPoints(aPoly, sPoints); if( nTokenId == XML_POLYGON || maCurrState.meFillType != NONE ) aPoly.setClosed(true); commit 06210e5ded4285775037104ba5c3bdf7af7ada04 Author: Caolán McNamara <[email protected]> Date: Sat Oct 11 17:34:31 2014 +0100 coverity#1078484 Unchecked return value Change-Id: Ia9ce3d94aa5b825e0b7ba28240f00733332e606c diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 7c1887f..4ca61b9 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2331,7 +2331,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, OUString& rSt break; case '*': //Skip over MERGEFORMAT - aReadParam.SkipToNextToken(); + (void)aReadParam.SkipToNextToken(); break; } }
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
