connectivity/source/commontools/DateConversion.cxx | 7 - connectivity/source/commontools/dbcharset.cxx | 2 connectivity/source/commontools/dbtools.cxx | 4 - connectivity/source/cpool/ZPoolCollection.cxx | 1 connectivity/source/drivers/ado/Aolevariant.cxx | 24 ------ connectivity/source/drivers/ado/Awrapado.cxx | 4 - connectivity/source/drivers/dbase/DIndex.cxx | 8 -- connectivity/source/drivers/dbase/dindexnode.cxx | 4 - connectivity/source/drivers/file/FPreparedStatement.cxx | 6 - connectivity/source/drivers/hsqldb/HDriver.cxx | 1 connectivity/source/drivers/hsqldb/HStorageAccess.cxx | 22 +++-- connectivity/source/drivers/hsqldb/HStorageMap.cxx | 1 connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx | 8 +- connectivity/source/drivers/jdbc/DatabaseMetaData.cxx | 17 ++-- connectivity/source/drivers/jdbc/JDriver.cxx | 1 connectivity/source/drivers/mork/MConnection.cxx | 3 connectivity/source/drivers/mork/MPreparedStatement.cxx | 6 - connectivity/source/drivers/mork/MStatement.cxx | 1 connectivity/source/drivers/mozab/MConnection.cxx | 3 connectivity/source/drivers/mozab/MPreparedStatement.cxx | 6 - connectivity/source/drivers/mozab/MStatement.cxx | 3 connectivity/source/drivers/odbc/OConnection.cxx | 6 - connectivity/source/drivers/odbc/OPreparedStatement.cxx | 6 - connectivity/source/drivers/odbc/ORealDriver.cxx | 4 - connectivity/source/drivers/odbc/OResultSet.cxx | 9 -- connectivity/source/drivers/odbc/OStatement.cxx | 4 - connectivity/source/drivers/odbc/OTools.cxx | 2 connectivity/source/inc/diagnose_ex.h | 40 ---------- connectivity/source/parse/sqliterator.cxx | 2 include/svtools/table/tablemodel.hxx | 7 - include/tools/diagnose_ex.h | 3 svtools/source/table/mousefunction.cxx | 8 -- svtools/source/table/tablecontrol_impl.cxx | 9 -- svtools/source/table/tablecontrol_impl.hxx | 4 - svtools/source/uno/svtxgridcontrol.cxx | 6 - svtools/source/uno/unocontroltablemodel.cxx | 8 -- svtools/source/uno/unogridcolumnfacade.cxx | 3 toolkit/source/controls/grid/sortablegriddatamodel.cxx | 4 - 38 files changed, 56 insertions(+), 201 deletions(-)
New commits: commit 0e13c94ad3615dd20d83a95efc18b99b16e074e3 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Sep 8 18:46:11 2015 +0200 Get rid of connectivity's diagnose_ex.h ...that rather trivially wrapped some osl/diagnose.h functionality Change-Id: I4105708488114a9c87aa415affb997a783241248 diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index a3e5bb8..4678990 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/extract.hxx> #include "TConnection.hxx" -#include "diagnose_ex.h" #include <comphelper/numbers.hxx> #include <rtl/ustrbuf.hxx> #include <tools/diagnose_ex.h> @@ -131,7 +130,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b else bOk = _rVal >>= aDateTime; - OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not datetime!"); + OSL_ENSURE( bOk, "DBTypeConversion::toSQLString: _rVal is not datetime!"); // check if this is really a timestamp or only a date if ( bOk ) { @@ -164,7 +163,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b } else bOk = _rVal >>= aDate; - OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not date!"); + OSL_ENSURE( bOk, "DBTypeConversion::toSQLString: _rVal is not date!"); if (bQuote) aRet.append("{d '"); aRet.append(DBTypeConversion::toDateString(aDate)); @@ -191,7 +190,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b } else bOk = _rVal >>= aTime; - OSL_VERIFY_RES( bOk,"DBTypeConversion::toSQLString: _rVal is not time!"); + OSL_ENSURE( bOk,"DBTypeConversion::toSQLString: _rVal is not time!"); if (bQuote) aRet.append("{t '"); aRet.append(DBTypeConversion::toTimeString(aTime)); diff --git a/connectivity/source/commontools/dbcharset.cxx b/connectivity/source/commontools/dbcharset.cxx index c9d41d8..78529a6 100644 --- a/connectivity/source/commontools/dbcharset.cxx +++ b/connectivity/source/commontools/dbcharset.cxx @@ -18,7 +18,6 @@ */ #include <connectivity/dbcharset.hxx> -#include "diagnose_ex.h" #include <osl/diagnose.h> #include <rtl/tencinfo.h> diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 593f701..feb4fd4 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -18,7 +18,6 @@ */ #include <connectivity/CommonTools.hxx> -#include "diagnose_ex.h" #include "TConnection.hxx" #include <connectivity/ParameterCont.hxx> diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx index df677dc..b0798bc 100644 --- a/connectivity/source/cpool/ZPoolCollection.cxx +++ b/connectivity/source/cpool/ZPoolCollection.cxx @@ -31,7 +31,6 @@ #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <osl/diagnose.h> -#include "diagnose_ex.h" using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx index cd89425..1319f02 100644 --- a/connectivity/source/drivers/ado/Aolevariant.cxx +++ b/connectivity/source/drivers/ado/Aolevariant.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/util/Time.hpp> #include <com/sun/star/util/Date.hpp> #include <com/sun/star/util/DateTime.hpp> -#include "diagnose_ex.h" #include "resource/sharedresources.hxx" #include "resource/ado_res.hrc" #include <com/sun/star/bridge/oleautomation/Date.hpp> diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index 1c2ddd4..bed72dd5 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -22,7 +22,6 @@ #include "ado/Awrapadox.hxx" #include <comphelper/types.hxx> #include <rtl/ustrbuf.hxx> -#include "diagnose_ex.h" namespace connectivity { diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index 57ee565..4652a11 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -36,7 +36,6 @@ #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> #include "dbase/DResultSet.hxx" -#include "diagnose_ex.h" #include "resource/dbase_res.hrc" #include <unotools/sharedunocomponent.hxx> @@ -365,7 +364,7 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ODbaseIndex& rInd SvStream& connectivity::dbase::WriteODbaseIndex(SvStream &rStream, ODbaseIndex& rIndex) { rStream.Seek(0); - OSL_VERIFY_EQUALS( rStream.Write(&rIndex.m_aHeader,DINDEX_PAGE_SIZE), DINDEX_PAGE_SIZE, "Write not successful: Wrong header size for dbase index!"); + OSL_VERIFY( rStream.Write(&rIndex.m_aHeader,DINDEX_PAGE_SIZE) == DINDEX_PAGE_SIZE ); return rStream; } @@ -430,9 +429,8 @@ bool ODbaseIndex::DropImpl() m_pTable->getName() + ".inf"; OUString sPhysicalPath; - OSL_VERIFY_RES( osl::FileBase::getSystemPathFromFileURL(sCfgFile, sPhysicalPath) - == osl::FileBase::E_None, - "Can not convert Config Filename into Physical Name!"); + OSL_VERIFY( osl::FileBase::getSystemPathFromFileURL(sCfgFile, sPhysicalPath) + == osl::FileBase::E_None ); Config aInfFile(sPhysicalPath); aInfFile.SetGroup(dBASE_III_GROUP); diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 0eadcc3..edbbf5c 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -22,7 +22,6 @@ #include <osl/thread.h> #include "dbase/DIndex.hxx" #include <tools/debug.hxx> -#include "diagnose_ex.h" #include <algorithm> #include <memory> diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index ca465c9..4abd1ed 100644 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -31,7 +31,6 @@ #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> #include <connectivity/PColumn.hxx> -#include "diagnose_ex.h" #include <comphelper/types.hxx> #include <com/sun/star/sdbc/ColumnValue.hpp> #include "resource/file_res.hrc" diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index bd6cf36..9958356 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -40,7 +40,6 @@ #include <com/sun/star/util/XFlushable.hpp> #include "HTerminateListener.hxx" #include "hsqldb/HCatalog.hxx" -#include "diagnose_ex.h" #include <rtl/ustrbuf.hxx> #include <osl/file.h> #include <osl/process.h> diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 0a5b75b..0fa38b5 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/io/XStream.hpp> #include "hsqldb/HStorageMap.hxx" #include "accesslog.hxx" -#include "diagnose_ex.h" #include <osl/diagnose.h> #include <string.h> diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index 534b4a4..64cf858 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/lang/DisposedException.hpp> -#include "diagnose_ex.h" #include <osl/diagnose.h> #include <osl/thread.h> diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx index 70633e5..d360a17 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx @@ -40,7 +40,6 @@ #include <jvmaccess/virtualmachine.hxx> #include <com/sun/star/lang/XSingleComponentFactory.hpp> -#include "diagnose_ex.h" using namespace ::com::sun::star::container; using namespace ::com::sun::star::uno; diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx index 8ad8635..e24a18a 100644 --- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx @@ -27,7 +27,6 @@ #include "FDatabaseMetaDataResultSet.hxx" #include <comphelper/types.hxx> #include "TPrivilegesResultSet.hxx" -#include "diagnose_ex.h" #include "resource/jdbc_log.hrc" using namespace ::comphelper; @@ -118,7 +117,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( // execute Java-Call static jmethodID mID(NULL); obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID); - OSL_VERIFY_RES( !isExceptionOccurred(t.pEnv, true),"Exception occurred!"); + OSL_VERIFY( !isExceptionOccurred(t.pEnv, true) ); jvalue args[4]; args[3].l = 0; @@ -126,7 +125,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( if ( typeFilterCount ) { jobjectArray pObjArray = static_cast< jobjectArray >( t.pEnv->NewObjectArray( (jsize)typeFilterCount, java_lang_String::st_getMyClass(), 0 ) ); - OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); const OUString* typeFilter = _types.getConstArray(); bool bIncludeAllTypes = false; for ( sal_Int32 i=0; i<typeFilterCount; ++i, ++typeFilter ) @@ -138,7 +137,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( } jstring aT = convertwchar_tToJavaString( t.pEnv, *typeFilter ); t.pEnv->SetObjectArrayElement( pObjArray, (jsize)i, aT ); - OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); } if ( bIncludeAllTypes ) @@ -146,7 +145,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( // the SDBC API allows to pass "%" as table type filter, but in JDBC, "all table types" // is represented by the table type being <null/> t.pEnv->DeleteLocalRef( pObjArray ); - OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); } else { @@ -174,23 +173,23 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( if ( aCatalogFilter.hasValue() ) { t.pEnv->DeleteLocalRef(static_cast<jstring>(args[0].l)); - OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); } if(args[1].l) { t.pEnv->DeleteLocalRef(static_cast<jstring>(args[1].l)); - OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); } if(!tableNamePattern.isEmpty()) { t.pEnv->DeleteLocalRef(static_cast<jstring>(args[2].l)); - OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); } //for(INT16 i=0;i<len;i++) if ( args[3].l ) { t.pEnv->DeleteLocalRef( static_cast<jobjectArray>(args[3].l) ); - OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); } if ( jThrow ) diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx index d4b1fe3..5fed7490 100644 --- a/connectivity/source/drivers/jdbc/JDriver.cxx +++ b/connectivity/source/drivers/jdbc/JDriver.cxx @@ -26,7 +26,6 @@ #include "java/tools.hxx" #include <connectivity/dbexception.hxx> #include <jvmfwk/framework.h> -#include "diagnose_ex.h" #include "resource/jdbc_log.hrc" #include "resource/common_res.hrc" #include "resource/sharedresources.hxx" diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index ee71aad..cba9579 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -7,7 +7,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "diagnose_ex.h" #include "MNSProfileDiscover.hxx" #include "MConnection.hxx" #include "MDriver.hxx" diff --git a/connectivity/source/drivers/mork/MPreparedStatement.cxx b/connectivity/source/drivers/mork/MPreparedStatement.cxx index 1348963..f78197f 100644 --- a/connectivity/source/drivers/mork/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mork/MPreparedStatement.cxx @@ -19,7 +19,6 @@ #include <connectivity/dbtools.hxx> #include <comphelper/types.hxx> #include <com/sun/star/sdbc/ColumnValue.hpp> -#include "diagnose_ex.h" #if OSL_DEBUG_LEVEL > 0 # define OUtoCStr( x ) ( OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr()) diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index fbfd54d..bdb6ede 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -38,7 +38,6 @@ #include <algorithm> -#include "diagnose_ex.h" #include "MDriver.hxx" #include "MStatement.hxx" #include "sqlbison.hxx" diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx index 9b609a0..0f55b0e 100644 --- a/connectivity/source/drivers/mozab/MConnection.cxx +++ b/connectivity/source/drivers/mozab/MConnection.cxx @@ -17,8 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - -#include "diagnose_ex.h" #include "MConnection.hxx" #include "MDatabaseMetaData.hxx" #include "MDriver.hxx" diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx index ce434a1..c4a8abf 100644 --- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx @@ -29,7 +29,6 @@ #include <connectivity/dbtools.hxx> #include <comphelper/types.hxx> #include <com/sun/star/sdbc/ColumnValue.hpp> -#include "diagnose_ex.h" #if OSL_DEBUG_LEVEL > 0 # define OUtoCStr( x ) ( OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr()) diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx index 5a258b5..251ec0a 100644 --- a/connectivity/source/drivers/mozab/MStatement.cxx +++ b/connectivity/source/drivers/mozab/MStatement.cxx @@ -38,7 +38,6 @@ #include <algorithm> -#include "diagnose_ex.h" #include "MDriver.hxx" #include "MStatement.hxx" #include "MConnection.hxx" diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index c06559b..c2c2c79 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -30,7 +30,6 @@ #include <connectivity/dbcharset.hxx> #include <connectivity/FValue.hxx> #include <comphelper/extract.hxx> -#include "diagnose_ex.h" #include <connectivity/dbexception.hxx> #include <string.h> diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx index f8a0dbe..9345b7f 100644 --- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx @@ -20,7 +20,6 @@ #include <string.h> #include <osl/diagnose.h> -#include "diagnose_ex.h" #include "odbc/OPreparedStatement.hxx" #include "odbc/OBoundParam.hxx" #include <com/sun/star/sdbc/DataType.hpp> diff --git a/connectivity/source/drivers/odbc/ORealDriver.cxx b/connectivity/source/drivers/odbc/ORealDriver.cxx index f464c81..e4cdaf2 100644 --- a/connectivity/source/drivers/odbc/ORealDriver.cxx +++ b/connectivity/source/drivers/odbc/ORealDriver.cxx @@ -21,7 +21,6 @@ #include "odbc/ODriver.hxx" #include "odbc/OTools.hxx" #include "odbc/OFunctions.hxx" -#include "diagnose_ex.h" namespace connectivity { diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index 0a98a62..e30c56d 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -35,7 +35,6 @@ #include <comphelper/types.hxx> #include <connectivity/dbtools.hxx> #include <connectivity/dbexception.hxx> -#include "diagnose_ex.h" using namespace ::comphelper; using namespace connectivity; @@ -991,7 +990,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeExcepti invalidateCache(); // first unbound all columns - OSL_VERIFY_EQUALS( unbind(), SQL_SUCCESS, "Could not unbind columns!" ); + OSL_VERIFY( unbind() == SQL_SUCCESS ); // SQLRETURN nRet = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE ,(SQLPOINTER)1,SQL_IS_INTEGER); m_bInserting = true; } diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx index 0a81286..ddf954d 100644 --- a/connectivity/source/drivers/odbc/OStatement.cxx +++ b/connectivity/source/drivers/odbc/OStatement.cxx @@ -34,7 +34,6 @@ #include <cppuhelper/queryinterface.hxx> #include <comphelper/extract.hxx> #include <comphelper/types.hxx> -#include "diagnose_ex.h" #include <algorithm> #include "resource/common_res.hrc" #include <connectivity/dbexception.hxx> diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx index f27bc97..695d162 100644 --- a/connectivity/source/drivers/odbc/OTools.cxx +++ b/connectivity/source/drivers/odbc/OTools.cxx @@ -22,7 +22,6 @@ #include <com/sun/star/sdbc/DataType.hpp> #include <osl/diagnose.h> #include "odbc/OConnection.hxx" -#include "diagnose_ex.h" #include <rtl/ustrbuf.hxx> #include <appendsqlwchars.hxx> diff --git a/connectivity/source/inc/diagnose_ex.h b/connectivity/source/inc/diagnose_ex.h deleted file mode 100644 index 4366832..0000000 --- a/connectivity/source/inc/diagnose_ex.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_DIAGNOSE_EX_H -#define INCLUDED_CONNECTIVITY_SOURCE_INC_DIAGNOSE_EX_H - -#if OSL_DEBUG_LEVEL > 0 - #define OSL_VERIFY_RES( expression, fail_message ) \ - OSL_ENSURE( expression, fail_message ) - #define OSL_VERIFY_EQUALS( expression, compare, fail_message ) \ - OSL_ENSURE( expression == compare, fail_message ) -#else - #define OSL_VERIFY_RES( expression, fail_message ) \ - (void)(expression) - #define OSL_VERIFY_EQUALS( expression, compare, fail_message ) \ - (void)(expression) -#endif - -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_DIAGNOSE_EX_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 0a2c525..36a96d2d 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -37,8 +37,6 @@ #include <comphelper/types.hxx> #include <connectivity/dbmetadata.hxx> #include <com/sun/star/sdb/SQLFilterOperator.hpp> -#include "diagnose_ex.h" - #include <iterator> #include <memory> commit 2beeeea4ea3a5799921674310712aa3ead9acd7a Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Sep 8 18:26:13 2015 +0200 Get rid of OSL_UNUSED In many cases it was originally used to silence warnings about variables used only in OSL_ENSURE etc., but that's no longer necessary since OSL_ENSURE is based on SAL_WARN etc. In some other cases it was apparently used as a speculative debugging aid, to have a value assigned to a variable to be easily able to view the value in a debugger. And in some cases it was used with (otherwise ignored) return values of (typically SQL-related) function calls, but it is probably better to eventually find and fix all the problematic ones among such calls via function declarations annotated SAL_WARN_UNUSED_RESULT. Change-Id: Ib925b38da70073b546fdcd00fa8524dc302accbf diff --git a/connectivity/source/commontools/dbcharset.cxx b/connectivity/source/commontools/dbcharset.cxx index f8267bf..c9d41d8 100644 --- a/connectivity/source/commontools/dbcharset.cxx +++ b/connectivity/source/commontools/dbcharset.cxx @@ -70,7 +70,6 @@ namespace dbtools bool bIsMimeEncoding = 0 != ( _rInfo.Flags & RTL_TEXTENCODING_INFO_MIME ); OSL_ENSURE( !bIsMimeEncoding || rtl_getMimeCharsetFromTextEncoding( _eEncoding ), "OCharsetMap::OCharsetMap: inconsistence in rtl!" ); - OSL_UNUSED( _eEncoding ); return bIsMimeEncoding; } diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 43e5244..593f701 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -983,9 +983,8 @@ try { xNewProps->setPropertyValue(pResult->Name, xOldProps->getPropertyValue(pResult->Name)); } - catch(IllegalArgumentException& e) + catch(IllegalArgumentException&) { - OSL_UNUSED( e ); #ifdef DBG_UTIL OUString sMessage = "TransferFormComponentProperties : could not transfer the value for property \"" + pResult->Name + diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx index 1ec825b..cd89425 100644 --- a/connectivity/source/drivers/ado/Aolevariant.cxx +++ b/connectivity/source/drivers/ado/Aolevariant.cxx @@ -104,14 +104,12 @@ OLEVariant::OLEVariant(const VARIANT& varSrc) ::VariantInit(this); HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(&varSrc)); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); } OLEVariant::OLEVariant(const OLEVariant& varSrc) { ::VariantInit(this); HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(static_cast<const VARIANT*>(&varSrc))); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); } OLEVariant::OLEVariant(bool x) { VariantInit(this); vt = VT_BOOL; boolVal = (x ? VARIANT_TRUE : VARIANT_FALSE);} @@ -130,7 +128,6 @@ OLEVariant::~OLEVariant() { HRESULT eRet = ::VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); } // clears all the memory that was allocated before OLEVariant::OLEVariant(const ::com::sun::star::util::Date& x ) @@ -186,7 +183,6 @@ OLEVariant::OLEVariant(const ::com::sun::star::uno::Sequence< sal_Int8 >& x) sal_Int32 nData = *pBegin; HRESULT rs = SafeArrayPutElement(parray,&i,&nData); OSL_ENSURE(S_OK == rs,"Error while copy byte data"); - OSL_UNUSED(rs); } } @@ -194,7 +190,6 @@ OLEVariant& OLEVariant::operator=(const OLEVariant& varSrc) { HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(static_cast<const VARIANT*>(&varSrc))); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); return *this; } // Assign a const VARIANT& (::VariantCopy handles everything) @@ -203,7 +198,6 @@ OLEVariant& OLEVariant::operator=(const tagVARIANT& varSrc) { HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(&varSrc)); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); return *this; } @@ -214,7 +208,6 @@ OLEVariant& OLEVariant::operator=(const VARIANT* pSrc) { HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(pSrc)); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); return *this; } @@ -223,7 +216,6 @@ void OLEVariant::setByte(sal_uInt8 n) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_UI1; bVal = n; } @@ -231,7 +223,6 @@ void OLEVariant::setInt16(sal_Int16 n) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_I2; iVal = n; } @@ -239,14 +230,12 @@ void OLEVariant::setInt32(sal_Int32 n) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_I4; lVal = n; } void OLEVariant::setFloat(float f) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_R4; fltVal = f; } @@ -254,14 +243,12 @@ void OLEVariant::setDouble(double d) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_R8; dblVal = d; } void OLEVariant::setDate(DATE d) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_DATE; date = d; } @@ -269,7 +256,6 @@ void OLEVariant::setChar(unsigned char a) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_UI1; bVal = a; } @@ -277,7 +263,6 @@ void OLEVariant::setCurrency(double aCur) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_CY; set(aCur*10000); } @@ -285,7 +270,6 @@ void OLEVariant::setBool(sal_Bool b) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_BOOL; boolVal = b ? VARIANT_TRUE : VARIANT_FALSE; } @@ -293,7 +277,6 @@ void OLEVariant::setString(const OUString& us) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_BSTR; bstrVal = ::SysAllocString(reinterpret_cast<LPCOLESTR>(us.getStr())); } @@ -301,7 +284,6 @@ void OLEVariant::setNoArg() { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_ERROR; scode = DISP_E_PARAMNOTFOUND; } @@ -310,14 +292,12 @@ void OLEVariant::setNull() { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_NULL; } void OLEVariant::setEmpty() { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_EMPTY; } @@ -325,7 +305,6 @@ void OLEVariant::setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_ARRAY|VT_UI1; parray = pSafeAr; } @@ -333,7 +312,6 @@ void OLEVariant::setArray(SAFEARRAY* pSafeArray, VARTYPE vtType) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = (VARTYPE)(VT_ARRAY|vtType); parray = pSafeArray; } @@ -342,7 +320,6 @@ void OLEVariant::setIDispatch(IDispatch* pDispInterface) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_DISPATCH; pdispVal = pDispInterface; diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index 026390a..1c2ddd4 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -2146,7 +2146,6 @@ void WpADOColumn::put_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject) OSL_ENSURE(pInterface,"Interface is null!"); sal_Bool bRet = SUCCEEDED(pInterface->put_ParentCatalog(ppvObject)); OSL_ENSURE(bRet,"Could not set ParentCatalog!"); - OSL_UNUSED(bRet); } void WpADOTable::putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject) @@ -2154,7 +2153,6 @@ void WpADOTable::putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObjec OSL_ENSURE(pInterface,"Interface is null!"); sal_Bool bRet = SUCCEEDED(pInterface->putref_ParentCatalog(ppvObject)); OSL_ENSURE(bRet,"Could not set ParentCatalog!"); - OSL_UNUSED(bRet); } void WpBase::setIDispatch(IDispatch* _pIUnknown) @@ -2170,7 +2168,6 @@ void OTools::putValue(const WpADOProperties& _rProps,const OLEVariant &_aPositio { sal_Bool bRet = aProp.PutValue(_aValVar); OSL_ENSURE(bRet,"Could not put value!"); - OSL_UNUSED(bRet); } } diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 9f4f842..0eadcc3 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -877,8 +877,7 @@ SvStream& connectivity::dbase::WriteONDXPage(SvStream &rStream, const ONDXPage& memset(aEmptyData,0x00,DINDEX_PAGE_SIZE); rStream.Write(aEmptyData, DINDEX_PAGE_SIZE); } - sal_Size nCurrentPos = rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE); - OSL_UNUSED( nCurrentPos ); + rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE); nValue = rPage.nCount; rStream.WriteUInt32( nValue ); diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index 32290b7..ca465c9 100644 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -424,13 +424,8 @@ void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const ORowSetVal sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol) { - OSL_UNUSED( pParameter ); OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument ist kein Parameter"); OSL_ENSURE(pParameter->count() > 0,"OResultSet: Fehler im Parse Tree"); -#if OSL_DEBUG_LEVEL > 0 - OSQLParseNode * pMark = pParameter->getChild(0); - OSL_UNUSED( pMark ); -#endif OUString sParameterName; // set up Parameter-Column: diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 7d3b10e..0a5b75b 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -147,7 +147,6 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nati jint read_from_storage_stream( JNIEnv * env, jobject /*obj_this*/, jstring name, jstring key, DataLogFile* logger ) { - OSL_UNUSED( logger ); ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>(); OSL_ENSURE(xIn.is(),"Input stream is NULL!"); @@ -175,10 +174,12 @@ jint read_from_storage_stream( JNIEnv * env, jobject /*obj_this*/, jstring name, if (tmpInt < 0 ) tmpInt = 256 +tmpInt; -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( tmpInt ); #endif + } return tmpInt; } } @@ -210,7 +211,6 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key, jbyteArray buffer, jint off, jint len, DataLogFile* logger ) { - OSL_UNUSED( logger ); #ifdef HSQLDB_DBG { OUString sKey = StorageContainer::jstring2ustring(env,key); @@ -247,10 +247,12 @@ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,js return -1; env->SetByteArrayRegion(buffer,off,nBytesRead,reinterpret_cast<jbyte*>(&aData[0])); -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( aData.getConstArray(), nBytesRead ); #endif + } return nBytesRead; } ThrowException( env, @@ -418,7 +420,6 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key, jbyteArray buffer, jint off, jint len, DataLogFile* logger ) { - OSL_UNUSED( logger ); ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); OSL_ENSURE(xOut.is(),"Stream is NULL"); @@ -439,10 +440,12 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst Sequence< ::sal_Int8 > aData(reinterpret_cast<sal_Int8 *>(buf + off),len); env->ReleaseByteArrayElements(buffer, buf, JNI_ABORT); xOut->writeBytes(aData); -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( aData.getConstArray(), len ); #endif + } } } else @@ -483,8 +486,6 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key, jint v, DataLogFile* logger ) { - OSL_UNUSED( logger ); - ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); OSL_ENSURE(xOut.is(),"Stream is NULL"); @@ -499,10 +500,12 @@ void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, j oneByte[3] = (sal_Int8) ((v >> 0) & 0xFF); xOut->writeBytes(oneByte); -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( oneByte.getConstArray(), 4 ); #endif + } } else { diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx index ce19462..70633e5 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx @@ -161,14 +161,15 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_flush (JNIEnv * env, jobject /*obj_this*/, jstring key, jstring name) { - OSL_UNUSED( env ); - OSL_UNUSED( key ); - OSL_UNUSED( name ); #ifdef HSQLDB_DBG OperationLogFile( env, name, "output" ).logOperation( "flush" ); OUString sKey = StorageContainer::jstring2ustring(env,key); OUString sName = StorageContainer::jstring2ustring(env,name); +#else + (void) env; + (void) key; + (void) name; #endif } diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 5efb9d0..ee71aad 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -206,7 +206,6 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const OU SAL_INFO("connectivity.mork", "=> OConnection::prepareStatement()" ); SAL_INFO("connectivity.mork", "OConnection::prepareStatement( " << _sSql << " )"); - OSL_UNUSED( _sSql ); ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); @@ -225,7 +224,6 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const OUStrin { SAL_INFO("connectivity.mork", "=> OConnection::prepareCall()" ); SAL_INFO("connectivity.mork", "sql: " << _sSql); - OSL_UNUSED( _sSql ); ::dbtools::throwFeatureNotImplementedSQLException( "XConnection::prepareCall", *this ); SAL_INFO("connectivity.mork", "OConnection::prepareCall( " << _sSql << " )"); return NULL; diff --git a/connectivity/source/drivers/mork/MPreparedStatement.cxx b/connectivity/source/drivers/mork/MPreparedStatement.cxx index ead3e77..1348963 100644 --- a/connectivity/source/drivers/mork/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mork/MPreparedStatement.cxx @@ -392,16 +392,11 @@ ORowSetValue& x) size_t OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol) { - OSL_UNUSED( pParameter ); // Count of the newly added Parameters size_t nParameter = m_xParamColumns->get().size()+1; OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument is not a Parameter"); OSL_ENSURE(pParameter->count() > 0,"OResultSet: error in parse tree"); -#if OSL_DEBUG_LEVEL > 0 - OSQLParseNode * pMark = pParameter->getChild(0); - OSL_UNUSED( pMark ); -#endif OUString sParameterName; diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx index bf1fb63..9b609a0 100644 --- a/connectivity/source/drivers/mozab/MConnection.cxx +++ b/connectivity/source/drivers/mozab/MConnection.cxx @@ -375,7 +375,6 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const OU Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const OUString& _sSql ) throw(SQLException, RuntimeException) { - OSL_UNUSED( _sSql ); ::dbtools::throwFeatureNotImplementedSQLException( "XConnection::prepareCall", *this ); OSL_TRACE("OConnection::prepareCall( %s )", OUtoCStr( _sSql ) ); return NULL; diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx index 8b52129..ce434a1 100644 --- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx @@ -400,16 +400,11 @@ ORowSetValue& x) size_t OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol) { - OSL_UNUSED( pParameter ); // Count of the newly added Parameters size_t nParameter = m_xParamColumns->get().size()+1; OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument is not a Parameter"); OSL_ENSURE(pParameter->count() > 0,"OResultSet: error in parse tree"); -#if OSL_DEBUG_LEVEL > 0 - OSQLParseNode * pMark = pParameter->getChild(0); - OSL_UNUSED( pMark ); -#endif OUString sParameterName; diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx index 637a2e2..5a258b5 100644 --- a/connectivity/source/drivers/mozab/MStatement.cxx +++ b/connectivity/source/drivers/mozab/MStatement.cxx @@ -190,8 +190,6 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql #if OSL_DEBUG_LEVEL > 0 { - const char* str = OUtoCStr(sql); - OSL_UNUSED( str ); OSL_TRACE("ParseSQL: %s", OUtoCStr( sql ) ); } #endif // OSL_DEBUG_LEVEL diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index 2b2589e..c06559b 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -119,7 +119,7 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi #endif #ifdef LINUX - OSL_UNUSED( bSilent ); + (void) bSilent; nSQLRETURN = N3SQLDriverConnect(m_aConnectionHandle, NULL, szConnStrIn, @@ -532,8 +532,7 @@ SQLHANDLE OConnection::createStatementHandle() } SQLHANDLE aStatementHandle = SQL_NULL_HANDLE; - SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,pConnectionTemp->getConnection(),&aStatementHandle); - OSL_UNUSED( nRetcode ); + N3SQLAllocHandle(SQL_HANDLE_STMT,pConnectionTemp->getConnection(),&aStatementHandle); ++m_nStatementCount; if(bNew) m_aConnections.insert(::std::map< SQLHANDLE,OConnection*>::value_type(aStatementHandle,pConnectionTemp)); diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx index a611ebe..f8a0dbe 100644 --- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx @@ -660,9 +660,8 @@ void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, Runtim ::osl::MutexGuard aGuard( m_aMutex ); prepareStatement(); OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - SQLRETURN nRet = N3SQLFreeStmt (m_aStatementHandle, SQL_RESET_PARAMS); - nRet = N3SQLFreeStmt (m_aStatementHandle, SQL_UNBIND); - OSL_UNUSED(nRet); + N3SQLFreeStmt (m_aStatementHandle, SQL_RESET_PARAMS); + N3SQLFreeStmt (m_aStatementHandle, SQL_UNBIND); } void SAL_CALL OPreparedStatement::clearBatch( ) throw(SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/odbc/ORealDriver.cxx b/connectivity/source/drivers/odbc/ORealDriver.cxx index f5f4f2e..f464c81 100644 --- a/connectivity/source/drivers/odbc/ORealDriver.cxx +++ b/connectivity/source/drivers/odbc/ORealDriver.cxx @@ -343,8 +343,7 @@ SQLHANDLE ORealObdcDriver::EnvironmentHandle(OUString &_rPath) // Save in global Structure m_pDriverHandle = h; - SQLRETURN nError = N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3), SQL_IS_UINTEGER); - OSL_UNUSED( nError ); + N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3), SQL_IS_UINTEGER); //N3SQLSetEnvAttr(h, SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER); } diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index b6feb2f..0a98a62 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -181,8 +181,7 @@ void OResultSet::construct() void OResultSet::disposing() { - SQLRETURN nRet = N3SQLCloseCursor(m_aStatementHandle); - OSL_UNUSED( nRet ); + N3SQLCloseCursor(m_aStatementHandle); OPropertySetHelper::disposing(); ::osl::MutexGuard aGuard(m_aMutex); @@ -1226,8 +1225,7 @@ sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_ invalidateCache(); Sequence<sal_Int8> aBookmark; bookmark >>= aBookmark; - SQLRETURN nReturn = setStmtOption<SQLLEN*, SQL_IS_POINTER>(SQL_ATTR_FETCH_BOOKMARK_PTR, reinterpret_cast<SQLLEN*>(aBookmark.getArray())); - OSL_UNUSED( nReturn ); + setStmtOption<SQLLEN*, SQL_IS_POINTER>(SQL_ATTR_FETCH_BOOKMARK_PTR, reinterpret_cast<SQLLEN*>(aBookmark.getArray())); m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_BOOKMARK,rows); OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this); diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx index 5774a57..0a81286 100644 --- a/connectivity/source/drivers/odbc/OStatement.cxx +++ b/connectivity/source/drivers/odbc/OStatement.cxx @@ -729,8 +729,7 @@ OUString OStatement_Base::getCursorName() const OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); SQLCHAR pName[258]; SQLSMALLINT nRealLen = 0; - SQLRETURN nRetCode = N3SQLGetCursorName(m_aStatementHandle,pName,256,&nRealLen); - OSL_UNUSED( nRetCode ); + N3SQLGetCursorName(m_aStatementHandle,pName,256,&nRealLen); return OUString::createFromAscii(reinterpret_cast<char*>(pName)); } diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx index 8777b3d..f27bc97 100644 --- a/connectivity/source/drivers/odbc/OTools.cxx +++ b/connectivity/source/drivers/odbc/OTools.cxx @@ -330,7 +330,6 @@ void OTools::ThrowException(const OConnection* _pConnection, szSqlState, &pfNativeError, szErrorMessage,sizeof szErrorMessage - 1,&pcbErrorMsg); - OSL_UNUSED( n ); OSL_ENSURE(n != SQL_INVALID_HANDLE,"SdbODBC3_SetStatus: SQLError returned SQL_INVALID_HANDLE"); OSL_ENSURE(n == SQL_SUCCESS || n == SQL_SUCCESS_WITH_INFO || n == SQL_NO_DATA_FOUND || n == SQL_ERROR,"SdbODBC3_SetStatus: SQLError failed"); diff --git a/connectivity/source/inc/diagnose_ex.h b/connectivity/source/inc/diagnose_ex.h index 10671a4..4366832 100644 --- a/connectivity/source/inc/diagnose_ex.h +++ b/connectivity/source/inc/diagnose_ex.h @@ -32,9 +32,6 @@ (void)(expression) #endif -#define OSL_UNUSED( expression ) \ - (void)(expression) - #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_DIAGNOSE_EX_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h index 7efffc6..b162f94 100644 --- a/include/tools/diagnose_ex.h +++ b/include/tools/diagnose_ex.h @@ -29,9 +29,6 @@ #include <tools/toolsdllapi.h> -#define OSL_UNUSED( expression ) \ - (void)(expression) - TOOLS_DLLPUBLIC void DbgUnhandledException(const ::com::sun::star::uno::Any& caughtException, const char* currentFunction, const char* fileAndLineNo); #if OSL_DEBUG_LEVEL > 0 diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index de5ac27..aa8908b 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -631,10 +631,9 @@ void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event ) throw } -void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException, std::exception) +void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& ) throw (RuntimeException, std::exception) { SolarMutexGuard aGuard; - OSL_UNUSED( i_event ); VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" ); @@ -666,11 +665,10 @@ void SAL_CALL SVTXGridControl::elementRemoved( const ContainerEvent& i_event ) t } -void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException, std::exception) +void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& ) throw (RuntimeException, std::exception) { OSL_ENSURE( false, "SVTXGridControl::elementReplaced: not implemented!" ); // at the moment, the XGridColumnModel API does not allow replacing columns - OSL_UNUSED( i_event ); // TODO: replace the respective column in our table model } diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx index 7e19c7b..d3b56d8 100644 --- a/svtools/source/uno/unogridcolumnfacade.cxx +++ b/svtools/source/uno/unogridcolumnfacade.cxx @@ -166,9 +166,8 @@ namespace svt { namespace table } - void SAL_CALL ColumnChangeMultiplexer::disposing( const EventObject& i_event ) throw (RuntimeException, std::exception) + void SAL_CALL ColumnChangeMultiplexer::disposing( const EventObject& ) throw (RuntimeException, std::exception) { - OSL_UNUSED( i_event ); } diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 35450bb0..1edc113 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -490,10 +490,8 @@ private: } - void SAL_CALL SortableGridDataModel::disposing( const EventObject& i_event ) throw (RuntimeException, std::exception) + void SAL_CALL SortableGridDataModel::disposing( const EventObject& ) throw (RuntimeException, std::exception) { - // not interested in - OSL_UNUSED( i_event ); } commit 8083f6b7ed7ec3e72c896e3707c21457dbe173e3 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Sep 8 18:09:08 2015 +0200 Remove unused function params Change-Id: I1b72a95b7367bb555d37a9a073ca4da2b01cf53f diff --git a/include/svtools/table/tablemodel.hxx b/include/svtools/table/tablemodel.hxx index 9c07ef2..7bb3d9c 100644 --- a/include/svtools/table/tablemodel.hxx +++ b/include/svtools/table/tablemodel.hxx @@ -110,11 +110,8 @@ namespace svt { namespace table /** notifies the listener that one or more columns have been removed from the table - - @param i_colIndex - the old index of the removed column */ - virtual void columnRemoved( ColPos const i_colIndex ) = 0; + virtual void columnRemoved() = 0; /** notifies the listener that all columns have been removed form the model */ @@ -127,7 +124,7 @@ namespace svt { namespace table they have about the cells in question, in particular any possibly cached cell values. */ - virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) = 0; + virtual void cellsUpdated( RowPos const i_firstRow, RowPos const i_lastRow ) = 0; /** notifies the listener that attributes of a given column changed diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx index 2dfbdca..015f7f9 100644 --- a/svtools/source/table/mousefunction.cxx +++ b/svtools/source/table/mousefunction.cxx @@ -163,10 +163,8 @@ namespace svt { namespace table //= RowSelection - FunctionResult RowSelection::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) + FunctionResult RowSelection::handleMouseMove( ITableControl&, MouseEvent const & ) { - OSL_UNUSED( i_tableControl ); - OSL_UNUSED( i_event ); return SkipFunction; } @@ -217,10 +215,8 @@ namespace svt { namespace table //= ColumnSortHandler - FunctionResult ColumnSortHandler::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) + FunctionResult ColumnSortHandler::handleMouseMove( ITableControl&, MouseEvent const & ) { - OSL_UNUSED( i_tableControl ); - OSL_UNUSED( i_event ); return SkipFunction; } diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index d99e88e..74234c5 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -434,7 +434,7 @@ namespace svt { namespace table } - void TableControl_Impl::columnRemoved( ColPos const i_colIndex ) + void TableControl_Impl::columnRemoved() { m_nColumnCount = m_pModel->getColumnCount(); @@ -450,8 +450,6 @@ namespace svt { namespace table impl_ni_relayout(); m_rAntiImpl.Invalidate(); - - OSL_UNUSED( i_colIndex ); } @@ -464,12 +462,9 @@ namespace svt { namespace table } - void TableControl_Impl::cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) + void TableControl_Impl::cellsUpdated( RowPos const i_firstRow, RowPos const i_lastRow ) { invalidateRowRange( i_firstRow, i_lastRow ); - - OSL_UNUSED( i_firstCol ); - OSL_UNUSED( i_lastCol ); } diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index 25084ab..6a4e122 100644 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -299,9 +299,9 @@ namespace svt { namespace table virtual void rowsInserted( RowPos first, RowPos last ) SAL_OVERRIDE; virtual void rowsRemoved( RowPos first, RowPos last ) SAL_OVERRIDE; virtual void columnInserted() SAL_OVERRIDE; - virtual void columnRemoved( ColPos const i_colIndex ) SAL_OVERRIDE; + virtual void columnRemoved() SAL_OVERRIDE; virtual void allColumnsRemoved() SAL_OVERRIDE; - virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) SAL_OVERRIDE; + virtual void cellsUpdated( RowPos const i_firstRow, RowPos const i_lastRow ) SAL_OVERRIDE; virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup ) SAL_OVERRIDE; virtual void tableMetricsChanged() SAL_OVERRIDE; diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx index 7140933..59e22fb 100644 --- a/svtools/source/uno/unocontroltablemodel.cxx +++ b/svtools/source/uno/unocontroltablemodel.cxx @@ -261,7 +261,7 @@ namespace svt { namespace table ++loop ) { - (*loop)->columnRemoved( i_position ); + (*loop)->columnRemoved(); } // dispose the column @@ -896,8 +896,6 @@ namespace svt { namespace table void UnoControlTableModel::notifyDataChanged( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const { - ColPos const firstCol = i_event.FirstColumn == -1 ? 0 : i_event.FirstColumn; - ColPos const lastCol = i_event.FirstColumn == -1 ? getColumnCount() - 1 : i_event.LastColumn; RowPos const firstRow = i_event.FirstRow == -1 ? 0 : i_event.FirstRow; RowPos const lastRow = i_event.FirstRow == -1 ? getRowCount() - 1 : i_event.LastRow; @@ -907,7 +905,7 @@ namespace svt { namespace table ++loop ) { - (*loop)->cellsUpdated( firstCol, lastCol, firstRow, lastRow ); + (*loop)->cellsUpdated( firstRow, lastRow ); } } @@ -920,7 +918,7 @@ namespace svt { namespace table ++loop ) { - (*loop)->cellsUpdated( 0, getColumnCount() - 1, 0, getRowCount() - 1 ); + (*loop)->cellsUpdated( 0, getRowCount() - 1 ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits