summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-08 16:46:00 +0200
committerNoel Grandin <noel@peralex.com>2016-03-09 10:07:47 +0200
commit1dc23829b9a38d4c6be4a0649dee28a5693ac87a (patch)
tree2df8f61e308bd2b1507745ed61a151ae8f30cb65 /connectivity
parent978cfb856b013580921dc2c262565438692d4221 (diff)
loplugin:constantparam in connectivity
Change-Id: I5e71b3de15e043066cd4177dd42b231527eb71e4
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DResultSet.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/ContextClassLoader.cxx7
-rw-r--r--connectivity/source/drivers/postgresql/pq_baseresultset.cxx48
-rw-r--r--connectivity/source/drivers/postgresql/pq_baseresultset.hxx2
-rw-r--r--connectivity/source/inc/dbase/DIndex.hxx2
-rw-r--r--connectivity/source/inc/java/ContextClassLoader.hxx4
7 files changed, 26 insertions, 43 deletions
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 78a162ec6dd2..a2e8e3e962b0 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -172,10 +172,10 @@ bool ODbaseIndex::openIndexFile()
return m_pFileStream != nullptr;
}
-OIndexIterator* ODbaseIndex::createIterator(OBoolOperator* pOp)
+OIndexIterator* ODbaseIndex::createIterator()
{
openIndexFile();
- return new OIndexIterator(this, pOp, nullptr);
+ return new OIndexIterator(this, nullptr, nullptr);
}
bool ODbaseIndex::ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSetValue& rValue)
diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx
index 3e31902969a6..17b6e9cd05f5 100644
--- a/connectivity/source/drivers/dbase/DResultSet.cxx
+++ b/connectivity/source/drivers/dbase/DResultSet.cxx
@@ -163,7 +163,7 @@ bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xInde
dbase::ODbaseIndex* pIndex = reinterpret_cast< dbase::ODbaseIndex* >( xTunnel->getSomething(dbase::ODbaseIndex::getUnoTunnelImplementationId()) );
if(pIndex)
{
- dbase::OIndexIterator* pIter = pIndex->createIterator(nullptr);
+ dbase::OIndexIterator* pIter = pIndex->createIterator();
if (pIter)
{
diff --git a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
index 39cdafc2d328..c45b5aeb87e4 100644
--- a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
+++ b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
@@ -92,7 +92,7 @@ namespace connectivity { namespace jdbc
}
- void ContextClassLoaderScope::pop( bool clearExceptions )
+ void ContextClassLoaderScope::pop()
{
if ( isActive() )
{
@@ -101,10 +101,7 @@ namespace connectivity { namespace jdbc
m_setContextClassLoaderMethod = nullptr;
m_environment.CallObjectMethod( currentThread.get(), setContextClassLoaderMethod, m_oldContextClassLoader.get() );
- if ( clearExceptions )
- {
- m_environment.ExceptionClear();
- }
+ m_environment.ExceptionClear();
}
}
diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index f8ce6ce78694..acb92e15c4b5 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -386,7 +386,7 @@ sal_Bool BaseResultSet::getBoolean( sal_Int32 columnIndex ) throw (SQLException,
MutexGuard guard( m_refMutex->mutex );
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
OUString str = getString( columnIndex );
@@ -412,7 +412,7 @@ sal_Int8 BaseResultSet::getByte( sal_Int32 columnIndex )
MutexGuard guard( m_refMutex->mutex );
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
sal_Int8 b = 0;
convertTo( getValue( columnIndex ), cppu::UnoType<decltype(b)>::get()) >>= b;
return b;
@@ -424,7 +424,7 @@ sal_Int16 BaseResultSet::getShort( sal_Int32 columnIndex )
MutexGuard guard( m_refMutex->mutex );
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
sal_Int16 i = 0;
convertTo( getValue( columnIndex ), cppu::UnoType<decltype(i)>::get()) >>= i;
return i;
@@ -435,7 +435,7 @@ OUString BaseResultSet::getString( sal_Int32 columnIndex ) throw (SQLException,
MutexGuard guard(m_refMutex->mutex);
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
OUString ret;
convertTo( getValue( columnIndex ), cppu::UnoType<decltype(ret)>::get() ) >>= ret;
// printf( "BaseResultSet::getString() %s\n" , OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ).getStr() );
@@ -448,7 +448,7 @@ sal_Int32 BaseResultSet::getInt( sal_Int32 columnIndex )
MutexGuard guard( m_refMutex->mutex );
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
sal_Int32 i = 0;
convertTo( getValue( columnIndex ), cppu::UnoType<decltype(i)>::get()) >>= i;
return i;
@@ -460,7 +460,7 @@ sal_Int64 BaseResultSet::getLong( sal_Int32 columnIndex )
MutexGuard guard( m_refMutex->mutex );
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
sal_Int64 i = 0;
convertTo( getValue( columnIndex ), cppu::UnoType<decltype(i)>::get()) >>= i;
return i;
@@ -472,7 +472,7 @@ float BaseResultSet::getFloat( sal_Int32 columnIndex )
MutexGuard guard( m_refMutex->mutex );
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
float f = 0.;
convertTo( getValue( columnIndex ), cppu::UnoType<decltype(f)>::get()) >>= f;
return f;
@@ -495,7 +495,7 @@ Sequence< sal_Int8 > BaseResultSet::getBytes( sal_Int32 columnIndex )
MutexGuard guard( m_refMutex->mutex );
checkClosed();
checkColumnIndex( columnIndex );
- checkRowIndex( true /* must be on row */ );
+ checkRowIndex();
Sequence< sal_Int8 > ret;
OUString ustr;
@@ -666,31 +666,17 @@ void BaseResultSet::checkColumnIndex(sal_Int32 index ) throw ( SQLException, Run
}
-void BaseResultSet::checkRowIndex( bool mustBeOnValidRow )
+void BaseResultSet::checkRowIndex()
{
- OUStringBuffer buf( 128 );
- buf.append( "pq_baseresultset: row index out of range, allowed is " );
- if( mustBeOnValidRow )
+ if( m_row < 0 || m_row >= m_rowCount )
{
- if( m_row < 0 || m_row >= m_rowCount )
- {
- buf.append( "0 to " );
- buf.append( ((sal_Int32)(m_rowCount -1)) );
- buf.append( ", got " );
- buf.append( m_row );
- throw SQLException( buf.makeStringAndClear(), *this, OUString(),1, Any() );
- }
- }
- else
- {
- if( m_row < -1 || m_row > m_rowCount )
- {
- buf.append( "-1 to " );
- buf.append( m_rowCount );
- buf.append( ", got " );
- buf.append( m_row );
- throw SQLException( buf.makeStringAndClear(), *this, OUString(),1, Any() );
- }
+ OUStringBuffer buf( 128 );
+ buf.append( "pq_baseresultset: row index out of range, allowed is " );
+ buf.append( "0 to " );
+ buf.append( ((sal_Int32)(m_rowCount -1)) );
+ buf.append( ", got " );
+ buf.append( m_row );
+ throw SQLException( buf.makeStringAndClear(), *this, OUString(),1, Any() );
}
}
diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx
index 340126b009f6..ad3a6e6a7b0e 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx
@@ -85,7 +85,7 @@ protected:
throw ( com::sun::star::sdbc::SQLException, com::sun::star::uno::RuntimeException ) = 0;
void checkColumnIndex( sal_Int32 index )
throw ( com::sun::star::sdbc::SQLException, com::sun::star::uno::RuntimeException );
- void checkRowIndex( bool mustBeOnValidRow );
+ void checkRowIndex();
virtual ::com::sun::star::uno::Any getValue( sal_Int32 columnIndex ) = 0;
com::sun::star::uno::Any convertTo(
diff --git a/connectivity/source/inc/dbase/DIndex.hxx b/connectivity/source/inc/dbase/DIndex.hxx
index 7c20b1d660fe..8dd3c0a9d646 100644
--- a/connectivity/source/inc/dbase/DIndex.hxx
+++ b/connectivity/source/inc/dbase/DIndex.hxx
@@ -105,7 +105,7 @@ namespace connectivity
const ODbaseTable* getTable() const { return m_pTable; }
const NDXHeader& getHeader() const { return m_aHeader; }
- OIndexIterator* createIterator(OBoolOperator_BASE* pOp);
+ OIndexIterator* createIterator();
void SetRootPos(sal_uInt32 nPos) {m_nRootPage = nPos;}
void SetPageCount(sal_uInt32 nCount) {m_nPageCount = nCount;}
diff --git a/connectivity/source/inc/java/ContextClassLoader.hxx b/connectivity/source/inc/java/ContextClassLoader.hxx
index 7134fb1c8d59..3e80e3bc451d 100644
--- a/connectivity/source/inc/java/ContextClassLoader.hxx
+++ b/connectivity/source/inc/java/ContextClassLoader.hxx
@@ -55,7 +55,7 @@ namespace connectivity { namespace jdbc
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxErrorContext
);
- ~ContextClassLoaderScope() { pop(true); }
+ ~ContextClassLoaderScope() { pop(); }
bool isActive() const
{
@@ -67,7 +67,7 @@ namespace connectivity { namespace jdbc
ContextClassLoaderScope(ContextClassLoaderScope &) = delete;
void operator =(ContextClassLoaderScope &) = delete;
- void pop( bool clearExceptions );
+ void pop();
JNIEnv& m_environment;
LocalRef< jobject > m_currentThread;