diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-04 12:01:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 08:33:54 +0200 |
commit | 2b487c2a1372501f695b9dd4bcb81a1f6682d9bb (patch) | |
tree | 419a4ba02cda9c964b8731f34d7cc18b4ef4b68f /connectivity | |
parent | 054dab1b9d4985c473e07c2618e5d6bf6ebc5466 (diff) |
loplugin:unusedfields connectivity
Change-Id: I056b36249803982e451b887cc73b49a851144b7e
Reviewed-on: https://gerrit.libreoffice.org/39498
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
17 files changed, 30 insertions, 78 deletions
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index cd42068305c4..8c1431cf6c01 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -440,24 +440,23 @@ void OConnection::buildTypeInfo() aInfo->eType = adVarWChar; aInfo->aSimpleType.nType = (sal_Int16)ADOS::MapADOType2Jdbc(aInfo->eType); aInfo->aSimpleType.nPrecision = ADOS::getField(pRecordset,nPos++).get_Value().getInt32(); - aInfo->aSimpleType.aLiteralPrefix = ADOS::getField(pRecordset,nPos++).get_Value().getString(); - aInfo->aSimpleType.aLiteralSuffix = ADOS::getField(pRecordset,nPos++).get_Value().getString(); - aInfo->aSimpleType.aCreateParams = ADOS::getField(pRecordset,nPos++).get_Value().getString(); - aInfo->aSimpleType.bNullable = ADOS::getField(pRecordset,nPos++).get_Value().getBool(); - aInfo->aSimpleType.bCaseSensitive = ADOS::getField(pRecordset,nPos++).get_Value().getBool(); - aInfo->aSimpleType.nSearchType = ADOS::getField(pRecordset,nPos++).get_Value().getInt16(); - aInfo->aSimpleType.bUnsigned = ADOS::getField(pRecordset,nPos++).get_Value().getBool(); - aInfo->aSimpleType.bCurrency = ADOS::getField(pRecordset,nPos++).get_Value().getBool(); - aInfo->aSimpleType.bAutoIncrement = ADOS::getField(pRecordset,nPos++).get_Value().getBool(); + nPos++; // aLiteralPrefix + nPos++; // aLiteralSuffix + nPos++; // aCreateParams + nPos++; // bNullable + nPos++; // bCaseSensitive + nPos++; // nSearchType + nPos++; // bUnsigned + nPos++; // bCurrency + nPos++; // bAutoIncrement aInfo->aSimpleType.aLocalTypeName = ADOS::getField(pRecordset,nPos++).get_Value().getString(); - aInfo->aSimpleType.nMinimumScale = ADOS::getField(pRecordset,nPos++).get_Value().getInt16(); + nPos++; // nMinimumScale aInfo->aSimpleType.nMaximumScale = ADOS::getField(pRecordset,nPos++).get_Value().getInt16(); if ( adCurrency == aInfo->eType && !aInfo->aSimpleType.nMaximumScale) { - aInfo->aSimpleType.nMinimumScale = 4; aInfo->aSimpleType.nMaximumScale = 4; } - aInfo->aSimpleType.nNumPrecRadix = ADOS::getField(pRecordset,nPos++).get_Value().getInt16(); + nPos++; // nNumPrecRadix // Now that we have the type info, save it // in the Hashtable if we don't already have an // entry for this SQL type. diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index b1745adb8420..dfcfada4cbe8 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -58,7 +58,6 @@ typedef connectivity::OMetaConnection OConnection_BASE; OConnection::OConnection(OFileDriver* _pDriver) : OSubComponent<OConnection, OConnection_BASE>(static_cast<cppu::OWeakObject*>(_pDriver), this) , m_pDriver(_pDriver) - , m_bClosed(false) , m_bAutoCommit(false) , m_bReadOnly(false) , m_bShowDeleted(false) @@ -369,9 +368,8 @@ void OConnection::disposing() ::osl::MutexGuard aGuard(m_aMutex); OConnection_BASE::disposing(); - m_bClosed = true; -m_xDir.clear(); -m_xContent.clear(); + m_xDir.clear(); + m_xContent.clear(); m_xCatalog = WeakReference< XTablesSupplier>(); dispose_ChildImpl(); diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 3388c905cd3e..95d06a06fb3c 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -95,7 +95,6 @@ OResultSet::OResultSet(OStatement_Base* pStmt,OSQLParseTreeIterator& _aSQLIte ,m_nRowCountResult(-1) ,m_nColumnCount(0) ,m_bWasNull(false) - ,m_bEOF(false) ,m_bInserted(false) ,m_bRowUpdated(false) ,m_bRowInserted(false) @@ -394,7 +393,6 @@ void SAL_CALL OResultSet::afterLast( ) if(last()) next(); - m_bEOF = true; } @@ -1039,7 +1037,6 @@ bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOff } else { - m_bEOF = true; m_nRowPos = 1; return false; } diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index ed41ce9343db..3682f4d9d528 100644 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -47,7 +47,6 @@ using namespace com::sun::star; OPredicateCompiler::OPredicateCompiler(OSQLAnalyzer* pAnalyzer)//,OCursor& rCurs) : m_pAnalyzer(pAnalyzer) , m_nParamCounter(0) - , m_bORCondition(false) { } @@ -154,7 +153,6 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode) if (SQL_ISTOKEN(pPredicateNode->getChild(1),OR)) // OR-Operator { m_aCodeList.push_back(new OOp_OR); - m_bORCondition = true; } else if (SQL_ISTOKEN(pPredicateNode->getChild(1),AND)) // AND-Operator m_aCodeList.push_back(new OOp_AND); diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 0511391ebc32..9ab99a1b530e 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -898,19 +898,19 @@ void Connection::buildTypeInfo() aInfo.aTypeName = xRow->getString (1); aInfo.nType = xRow->getShort (2); aInfo.nPrecision = xRow->getInt (3); - aInfo.aLiteralPrefix = xRow->getString (4); - aInfo.aLiteralSuffix = xRow->getString (5); - aInfo.aCreateParams = xRow->getString (6); - aInfo.bNullable = xRow->getBoolean (7); - aInfo.bCaseSensitive = xRow->getBoolean (8); - aInfo.nSearchType = xRow->getShort (9); - aInfo.bUnsigned = xRow->getBoolean (10); - aInfo.bCurrency = xRow->getBoolean (11); - aInfo.bAutoIncrement = xRow->getBoolean (12); + // aLiteralPrefix = xRow->getString (4); + // aLiteralSuffix = xRow->getString (5); + // aCreateParams = xRow->getString (6); + // bNullable = xRow->getBoolean (7); + // bCaseSensitive = xRow->getBoolean (8); + // nSearchType = xRow->getShort (9); + // bUnsigned = xRow->getBoolean (10); + // bCurrency = xRow->getBoolean (11); + // bAutoIncrement = xRow->getBoolean (12); aInfo.aLocalTypeName = xRow->getString (13); - aInfo.nMinimumScale = xRow->getShort (14); + // nMinimumScale = xRow->getShort (14); aInfo.nMaximumScale = xRow->getShort (15); - aInfo.nNumPrecRadix = (sal_Int16)xRow->getInt(18); + // nNumPrecRadix = (sal_Int16)xRow->getInt(18); // Now that we have the type info, save it diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 56ded2df8fd3..5a0ae000bee7 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -82,7 +82,6 @@ OResultSet::OResultSet(OCommonStatement* pStmt, const std::shared_ptr< connectiv ,m_nParamIndex(0) ,m_bIsAlwaysFalseQuery(false) ,m_pKeySet(nullptr) - ,m_nUpdatedRow(0) ,m_bIsReadOnly(TRISTATE_INDET) { //m_aQuery.setMaxNrOfReturns(pStmt->getOwnConnection()->getMaxResultRecords()); @@ -1538,8 +1537,6 @@ void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) (m_aRow->get())[columnIndex].setBound(true); (m_aRow->get())[columnIndex] = x; - m_nUpdatedRow = getCurrentCardNumber(); -// m_RowStates = m_RowStates | RowStates_Updated; } @@ -1556,8 +1553,6 @@ void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) (m_aRow->get())[columnIndex].setBound(true); (m_aRow->get())[columnIndex].setNull(); - m_nUpdatedRow = getCurrentCardNumber(); -// m_RowStates = m_RowStates | RowStates_Updated; } diff --git a/connectivity/source/drivers/mork/MResultSet.hxx b/connectivity/source/drivers/mork/MResultSet.hxx index 0633ada71638..febe6a0a4bf7 100644 --- a/connectivity/source/drivers/mork/MResultSet.hxx +++ b/connectivity/source/drivers/mork/MResultSet.hxx @@ -229,7 +229,6 @@ protected: sal_Int32 m_nParamIndex; bool m_bIsAlwaysFalseQuery; ::rtl::Reference<OKeySet> m_pKeySet; - sal_Int32 m_nUpdatedRow; //updated row TriState m_bIsReadOnly; void resetParameters() { m_nParamIndex = 0; } diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx index 4a0870e3bf9e..97e61013786c 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx @@ -27,15 +27,12 @@ namespace connectivity namespace mozab { ProfileStruct::ProfileStruct() - : product(css::mozilla::MozillaProductType_Default) { } - ProfileStruct::ProfileStruct(MozillaProductType aProduct, - const OUString& aProfileName, + ProfileStruct::ProfileStruct(const OUString& aProfileName, const OUString& aProfilePath) - : product(aProduct) - , profileName(aProfileName) + : profileName(aProfileName) , profilePath(aProfilePath) { } @@ -128,7 +125,7 @@ namespace connectivity fullProfilePath = profilePath; } - rProduct.mProfileList[profileName] = ProfileStruct(product,profileName,fullProfilePath); + rProduct.mProfileList[profileName] = ProfileStruct(profileName,fullProfilePath); sal_Int32 isDefault = 0; if (!sIsDefault.isEmpty()) diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx index 395724ff0790..8424fb6fdcd1 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx @@ -48,11 +48,10 @@ namespace connectivity { public: ProfileStruct(); - ProfileStruct(MozillaProductType aProduct, const OUString& aProfileName, const OUString &aProfilePath); + ProfileStruct(const OUString& aProfileName, const OUString &aProfilePath); const OUString& getProfileName() const { return profileName;} const OUString& getProfilePath() const; private: - MozillaProductType product; OUString profileName; OUString profilePath; }; diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx index 2fe1f8bfeedc..9ff961f09e19 100644 --- a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx +++ b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx @@ -41,7 +41,6 @@ ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon ,m_aConnectionHandle(_pHandle) ,m_pConnection(_pCon) ,m_bUseCatalog(true) - ,m_bOdbc3(true) { OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!"); if(!m_pConnection->isCatalogUsed()) @@ -50,8 +49,6 @@ ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon try { m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable()); - OUString sVersion = getDriverVersion(); - m_bOdbc3 = sVersion != "02.50" && sVersion != "02.00"; } catch(SQLException& ) { // doesn't matter here diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index f7e2b978114a..475d2fe286b4 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -97,7 +97,6 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) : ,m_nCurrentFetchState(0) ,m_bWasNull(true) ,m_bEOF(true) - ,m_bInserting(false) ,m_bRowInserted(false) ,m_bRowDeleted(false) ,m_bUseFetchScroll(false) @@ -987,7 +986,6 @@ void SAL_CALL OResultSet::moveToInsertRow( ) // first unbound all 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/inc/OTypeInfo.hxx b/connectivity/source/inc/OTypeInfo.hxx index 1b7f24b046e1..69cb31bbc90d 100644 --- a/connectivity/source/inc/OTypeInfo.hxx +++ b/connectivity/source/inc/OTypeInfo.hxx @@ -29,38 +29,18 @@ namespace connectivity struct OTypeInfo { OUString aTypeName; // Name of the type in the database - OUString aLiteralPrefix; // Prefix for quoting - OUString aLiteralSuffix; // Suffix for quoting - OUString aCreateParams; // Parameter for creating OUString aLocalTypeName; sal_Int32 nPrecision; // Length of the type sal_Int16 nMaximumScale; // Decimal places - sal_Int16 nMinimumScale; // Minimum decimal places sal_Int16 nType; // Database type - sal_Int16 nSearchType; // Can we search for the type? - sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10 - - bool bCurrency : 1; // Currency - bool bAutoIncrement : 1; // Is it an autoincrementing field? - bool bNullable : 1; // Can the field be NULL? - bool bCaseSensitive : 1; // Is the type case sensitive? - bool bUnsigned : 1; // Is the type unsigned? OTypeInfo() :nPrecision(0) ,nMaximumScale(0) - ,nMinimumScale(0) ,nType( css::sdbc::DataType::OTHER) - ,nSearchType( css::sdbc::ColumnSearch::FULL) - ,nNumPrecRadix(0) - ,bCurrency(false) - ,bAutoIncrement(false) - ,bNullable(true) - ,bCaseSensitive(false) - ,bUnsigned(false) {} static void * SAL_CALL operator new( size_t nSize ) diff --git a/connectivity/source/inc/file/FConnection.hxx b/connectivity/source/inc/file/FConnection.hxx index 9521c948f543..fcf73bda082f 100644 --- a/connectivity/source/inc/file/FConnection.hxx +++ b/connectivity/source/inc/file/FConnection.hxx @@ -60,13 +60,12 @@ namespace connectivity css::uno::Reference< css::ucb::XDynamicResultSet > m_xDir; // directory css::uno::Reference< css::ucb::XContent> m_xContent; - bool m_bClosed; bool m_bAutoCommit; bool m_bReadOnly; bool m_bShowDeleted; bool m_bCaseSensitiveExtension; bool m_bCheckSQL92; - bool m_bDefaultTextEncoding; + bool m_bDefaultTextEncoding; void throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage); diff --git a/connectivity/source/inc/file/FResultSet.hxx b/connectivity/source/inc/file/FResultSet.hxx index 912bcc21b334..c1554100c626 100644 --- a/connectivity/source/inc/file/FResultSet.hxx +++ b/connectivity/source/inc/file/FResultSet.hxx @@ -113,7 +113,6 @@ namespace connectivity sal_Int32 m_nRowCountResult; sal_Int32 m_nColumnCount; bool m_bWasNull; - bool m_bEOF; // after last record bool m_bInserted; // true when moveToInsertRow was called // set to false when cursor moved or cancel bool m_bRowUpdated; diff --git a/connectivity/source/inc/file/fcomp.hxx b/connectivity/source/inc/file/fcomp.hxx index 97c58a1184be..153e59d32806 100644 --- a/connectivity/source/inc/file/fcomp.hxx +++ b/connectivity/source/inc/file/fcomp.hxx @@ -43,7 +43,6 @@ namespace connectivity OSQLAnalyzer* m_pAnalyzer; css::uno::Reference< css::container::XNameAccess> m_xIndexes; sal_Int32 m_nParamCounter; - bool m_bORCondition; public: OPredicateCompiler(OSQLAnalyzer* pAnalyzer); diff --git a/connectivity/source/inc/odbc/ODatabaseMetaData.hxx b/connectivity/source/inc/odbc/ODatabaseMetaData.hxx index abd30c2636c5..0abd72e880f3 100644 --- a/connectivity/source/inc/odbc/ODatabaseMetaData.hxx +++ b/connectivity/source/inc/odbc/ODatabaseMetaData.hxx @@ -37,8 +37,7 @@ namespace connectivity { SQLHANDLE m_aConnectionHandle; OConnection* m_pConnection; - bool m_bUseCatalog; - bool m_bOdbc3; + bool m_bUseCatalog; // cached database information virtual OUString impl_getIdentifierQuoteString_throw( ) override; diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx index 7bdbfa0caf88..b09310519698 100644 --- a/connectivity/source/inc/odbc/OResultSet.hxx +++ b/connectivity/source/inc/odbc/OResultSet.hxx @@ -144,7 +144,6 @@ namespace connectivity SQLRETURN m_nCurrentFetchState; bool m_bWasNull; bool m_bEOF; // after last record - bool m_bInserting; bool m_bRowInserted; bool m_bRowDeleted; bool m_bUseFetchScroll; |