diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-24 15:26:35 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-25 08:55:31 +0200 |
commit | c7a50d072f0f9a19e7975c09eeff7a11bdea1370 (patch) | |
tree | fa599d420f2d533ad0c0061f5108a8b425432e9e /connectivity/source/drivers/mork | |
parent | 3f6bfb4c0d6814c38035e4e1d0c4d5321dd6a5a7 (diff) |
new constantfunction loplugin
Change-Id: Ie9b7a0c41fc4dbd2560ceff6bae9ab85357f518b
Diffstat (limited to 'connectivity/source/drivers/mork')
-rw-r--r-- | connectivity/source/drivers/mork/MCatalog.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MConnection.hxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MQueryHelper.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MQueryHelper.hxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.cxx | 39 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.hxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSetMetaData.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MStatement.cxx | 48 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MStatement.hxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MTable.hxx | 2 |
10 files changed, 11 insertions, 96 deletions
diff --git a/connectivity/source/drivers/mork/MCatalog.cxx b/connectivity/source/drivers/mork/MCatalog.cxx index 65abe020b35d..a8692ba9ea86 100644 --- a/connectivity/source/drivers/mork/MCatalog.cxx +++ b/connectivity/source/drivers/mork/MCatalog.cxx @@ -92,7 +92,7 @@ Reference< XNameAccess > SAL_CALL OCatalog::getTables( ) throw(RuntimeException try { - if(!m_pTables || m_pConnection->getForceLoadTables()) + if(!m_pTables || OConnection::getForceLoadTables()) refreshTables(); } catch( const RuntimeException& ) diff --git a/connectivity/source/drivers/mork/MConnection.hxx b/connectivity/source/drivers/mork/MConnection.hxx index 1a29491f5b36..11e796759f23 100644 --- a/connectivity/source/drivers/mork/MConnection.hxx +++ b/connectivity/source/drivers/mork/MConnection.hxx @@ -102,7 +102,7 @@ namespace connectivity static OUString getDriverImplementationName(); - bool getForceLoadTables() {return true;} + static bool getForceLoadTables() {return true;} // Added to enable me to use SQLInterpreter which requires an // XNameAccess i/f to access tables. diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 08e5447d5f73..36f8a2e6b467 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -144,11 +144,6 @@ sal_Int32 MQueryHelper::getResultCount() const -bool MQueryHelper::queryComplete() const -{ - return true; -} - bool MQueryHelper::checkRowAvailable( sal_Int32 nDBRow ) { /* diff --git a/connectivity/source/drivers/mork/MQueryHelper.hxx b/connectivity/source/drivers/mork/MQueryHelper.hxx index 42a2c9375db1..cdf6043ecd8b 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.hxx +++ b/connectivity/source/drivers/mork/MQueryHelper.hxx @@ -199,7 +199,7 @@ namespace connectivity void reset(); MQueryHelperResultEntry* getByIndex( sal_uInt32 nRow ); bool isError() const; - bool queryComplete() const; + static bool queryComplete() { return true; } sal_Int32 getResultCount() const; bool checkRowAvailable( sal_Int32 nDBRow ); bool getRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const OUString& aDBColumnName, sal_Int32 nType ); diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index b33cb54c3383..36d1b00728c6 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -332,35 +332,6 @@ bool OResultSet::fetchCurrentRow( ) throw(SQLException, RuntimeException) } -bool OResultSet::pushCard(sal_uInt32 /*cardNumber*/) throw(SQLException, RuntimeException) -{ - return true; -/* - if (cardNumber == 0) - return sal_True; - // Check whether we are storing the updated row - if ( (m_aRow->get())[0].isNull() || (sal_Int32)(m_aRow->get())[0] != (sal_Int32)cardNumber ) - return sal_False; - - sal_Int32 nCount = m_aColumnNames.getLength(); - m_aQuery.setRowStates(cardNumber,m_RowStates); - for( sal_Int32 i = 1; i <= nCount; i++ ) - { - if ( (m_aRow->get())[i].isBound() ) - { - - // Everything in the addressbook is a string! - - if ( !m_aQuery.setRowValue( (m_aRow->get())[i], cardNumber, m_aColumnNames[i-1], DataType::VARCHAR )) - { - m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this ); - } - } - } - return sal_True; -*/ -} - bool OResultSet::fetchRow(sal_Int32 cardNumber,bool bForceReload) throw(SQLException, RuntimeException) { SAL_INFO("connectivity.mork", "cardNumber = " << cardNumber); @@ -466,7 +437,7 @@ sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeExcepti OSL_TRACE("In/Out: OResultSet::isAfterLast" ); // return sal_True; - return m_nRowPos > currentRowCount() && m_aQueryHelper.queryComplete(); + return m_nRowPos > currentRowCount() && MQueryHelper::queryComplete(); } sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException, std::exception) @@ -484,7 +455,7 @@ sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException, s OSL_TRACE("In/Out: OResultSet::isLast" ); // return sal_True; - return m_nRowPos == currentRowCount() && m_aQueryHelper.queryComplete(); + return m_nRowPos == currentRowCount() && MQueryHelper::queryComplete(); } void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException, std::exception) @@ -1258,7 +1229,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep OSL_TRACE("Query is to be sorted"); - OSL_ENSURE( m_aQueryHelper.queryComplete(), "Query not complete!!"); + OSL_ENSURE( MQueryHelper::queryComplete(), "Query not complete!!"); OSortIndex aSortIndex(eKeyType,m_aOrderbyAscending); @@ -1445,7 +1416,7 @@ bool OResultSet::validRow( sal_uInt32 nRow) { sal_Int32 nNumberOfRecords = m_aQueryHelper.getResultCount(); - while ( nRow > (sal_uInt32)nNumberOfRecords && !m_aQueryHelper.queryComplete() ) { + while ( nRow > (sal_uInt32)nNumberOfRecords && !MQueryHelper::queryComplete() ) { #if OSL_DEBUG_LEVEL > 0 OSL_TRACE("validRow: waiting..."); #endif @@ -1466,7 +1437,7 @@ bool OResultSet::validRow( sal_uInt32 nRow) } if (( nRow == 0 ) || - ( nRow > (sal_uInt32)nNumberOfRecords && m_aQueryHelper.queryComplete()) ){ + ( nRow > (sal_uInt32)nNumberOfRecords && MQueryHelper::queryComplete()) ){ SAL_INFO("connectivity.mork", "validRow(" << nRow << "): return False"); return false; } diff --git a/connectivity/source/drivers/mork/MResultSet.hxx b/connectivity/source/drivers/mork/MResultSet.hxx index 6422c04bb742..8e90471d9239 100644 --- a/connectivity/source/drivers/mork/MResultSet.hxx +++ b/connectivity/source/drivers/mork/MResultSet.hxx @@ -266,8 +266,7 @@ protected: ::com::sun::star::uno::RuntimeException); bool fetchCurrentRow() throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - bool pushCard(sal_uInt32 rowIndex) throw( ::com::sun::star::sdbc::SQLException, - ::com::sun::star::uno::RuntimeException); + static bool pushCard(sal_uInt32 ) { return true; } bool validRow( sal_uInt32 nRow ); bool seekRow( eRowPosition pos, sal_Int32 nOffset = 0 ); sal_Int32 deletedCount(); diff --git a/connectivity/source/drivers/mork/MResultSetMetaData.cxx b/connectivity/source/drivers/mork/MResultSetMetaData.cxx index 267465818098..b32db2fc90b9 100644 --- a/connectivity/source/drivers/mork/MResultSetMetaData.cxx +++ b/connectivity/source/drivers/mork/MResultSetMetaData.cxx @@ -176,7 +176,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLEx bool bReadOnly = (m_xColumns->get())[column-1]->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)) && ::cppu::any2bool((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION))); - return m_bReadOnly || bReadOnly || m_pTable->isReadOnly(); + return m_bReadOnly || bReadOnly || OTable::isReadOnly(); } diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index e0766cef8188..aec477e5069c 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -141,53 +141,6 @@ void SAL_CALL OCommonStatement::close( ) throw(SQLException, RuntimeException, -void OCommonStatement::createTable( ) throw ( SQLException, RuntimeException ) -{ -/* - if(m_pParseTree) - { - ::rtl::Reference<connectivity::OSQLColumns> xCreateColumn; - if (m_pSQLIterator->getStatementType() == SQL_STATEMENT_CREATE_TABLE) - { - const OSQLTables& xTabs = m_pSQLIterator->getTables(); - OSL_ENSURE( !xTabs.empty(), "Need a Table"); - OUString ouTableName=xTabs.begin()->first; - xCreateColumn = m_pSQLIterator->getCreateColumns(); - OSL_ENSURE(xCreateColumn.is(), "Need the Columns!!"); - - const OColumnAlias& aColumnAlias = m_pConnection->getColumnAlias(); - - OSQLColumns::Vector::const_iterator aIter = xCreateColumn->get().begin(); - const OUString sProprtyName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME); - OUString sName; - for (sal_Int32 i = 1; aIter != xCreateColumn->get().end();++aIter, i++) - { - (*aIter)->getPropertyValue(sProprtyName) >>= sName; - if ( !aColumnAlias.hasAlias( sName ) ) - { - - const OUString sError( getOwnConnection()->getResources().getResourceStringWithSubstitution( - STR_INVALID_COLUMNNAME, - "$columnname$", sName - ) ); - ::dbtools::throwGenericSQLException(sError,*this); - } - } - MDatabaseMetaDataHelper _aDbHelper; - if (!_aDbHelper.NewAddressBook(m_pConnection,ouTableName)) - { - getOwnConnection()->throwSQLException( _aDbHelper.getError(), *this ); - } - m_pSQLIterator.reset( new ::connectivity::OSQLParseTreeIterator( - m_pConnection, m_pConnection->createCatalog()->getTables(), m_aParser, NULL ) ); - } - - } - else - getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this ); -*/ -} - OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql , bool bAdjusted) throw ( SQLException, RuntimeException ) { @@ -242,7 +195,6 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql return eSelect; case SQL_STATEMENT_CREATE_TABLE: - createTable(); return eCreateTable; default: diff --git a/connectivity/source/drivers/mork/MStatement.hxx b/connectivity/source/drivers/mork/MStatement.hxx index 08b4c561d612..2b7a3d04abd8 100644 --- a/connectivity/source/drivers/mork/MStatement.hxx +++ b/connectivity/source/drivers/mork/MStatement.hxx @@ -144,8 +144,6 @@ namespace connectivity void analyseSQL(); void setOrderbyColumn( connectivity::OSQLParseNode* pColumnRef, connectivity::OSQLParseNode* pAscendingDescending); - void createTable( ) throw ( - ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ); public: // other methods diff --git a/connectivity/source/drivers/mork/MTable.hxx b/connectivity/source/drivers/mork/MTable.hxx index 39090517ecc4..5ac43080ef3a 100644 --- a/connectivity/source/drivers/mork/MTable.hxx +++ b/connectivity/source/drivers/mork/MTable.hxx @@ -43,7 +43,7 @@ namespace connectivity OConnection* getConnection() { return m_pConnection;} - bool isReadOnly() const { return false; } + static bool isReadOnly() { return false; } OUString getTableName() const { return m_Name; } OUString getSchema() const { return m_SchemaName; } |