summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-27 09:22:13 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-28 09:31:16 +0000
commit43b4903db3e925c652e25c34362490f8adc9c5ec (patch)
treeaf12777b72d42280467e8cc19b914b2c7f4f3816 /connectivity
parent7d6308dad9f4a079d57719a6e3a9c4cebb47d051 (diff)
teach stylepolice plugin about ref-counted-pointer naming
Change-Id: I6e91d22fc1826038c05ddb6fc065563c6a250752 Reviewed-on: https://gerrit.libreoffice.org/24459 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/dbconversion.cxx46
-rw-r--r--connectivity/source/drivers/file/FPreparedStatement.cxx6
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx8
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx8
-rw-r--r--connectivity/source/drivers/jdbc/PreparedStatement.cxx4
-rw-r--r--connectivity/source/drivers/jdbc/ResultSet.cxx4
-rw-r--r--connectivity/source/drivers/mork/MPreparedStatement.cxx6
-rw-r--r--connectivity/source/drivers/mork/MQueryHelper.cxx26
-rw-r--r--connectivity/source/drivers/mork/MResultSet.cxx10
-rw-r--r--connectivity/source/drivers/mork/MStatement.cxx10
10 files changed, 64 insertions, 64 deletions
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index b95cafac3754..1646b64ce255 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -339,33 +339,33 @@ namespace dbtools
else
nSign = 1;
- css::util::Time xRet;
+ css::util::Time aRet;
// normalize time
// we have to sal_Int32 here because otherwise we get an overflow
sal_Int64 nNanoSeconds = nNS;
sal_Int32 nSeconds = nNanoSeconds / nanoSecInSec;
sal_Int32 nMinutes = nSeconds / secInMin;
- xRet.NanoSeconds = nNanoSeconds % nanoSecInSec;
- xRet.Seconds = nSeconds % secInMin;
- xRet.Hours = nMinutes / minInHour;
- xRet.Minutes = nMinutes % minInHour;
+ aRet.NanoSeconds = nNanoSeconds % nanoSecInSec;
+ aRet.Seconds = nSeconds % secInMin;
+ aRet.Hours = nMinutes / minInHour;
+ aRet.Minutes = nMinutes % minInHour;
// assemble time
sal_Int64 nTime = nSign *
- (xRet.NanoSeconds +
- xRet.Seconds * secMask +
- xRet.Minutes * minMask +
- xRet.Hours * hourMask);
+ (aRet.NanoSeconds +
+ aRet.Seconds * secMask +
+ aRet.Minutes * minMask +
+ aRet.Hours * hourMask);
if(nTime < 0)
{
- xRet.NanoSeconds = nanoSecInSec-1;
- xRet.Seconds = secInMin-1;
- xRet.Minutes = minInHour-1;
- xRet.Hours = 23;
+ aRet.NanoSeconds = nanoSecInSec-1;
+ aRet.Seconds = secInMin-1;
+ aRet.Minutes = minInHour-1;
+ aRet.Hours = 23;
}
- return xRet;
+ return aRet;
}
css::util::DateTime DBTypeConversion::toDateTime(double dVal, const css::util::Date& _rNullDate)
@@ -377,19 +377,19 @@ namespace dbtools
// 12:59:59.999999790
css::util::Time aTime = toTime(dVal, 6);
- css::util::DateTime xRet;
+ css::util::DateTime aRet;
- xRet.Day = aDate.Day;
- xRet.Month = aDate.Month;
- xRet.Year = aDate.Year;
+ aRet.Day = aDate.Day;
+ aRet.Month = aDate.Month;
+ aRet.Year = aDate.Year;
- xRet.NanoSeconds = aTime.NanoSeconds;
- xRet.Minutes = aTime.Minutes;
- xRet.Seconds = aTime.Seconds;
- xRet.Hours = aTime.Hours;
+ aRet.NanoSeconds = aTime.NanoSeconds;
+ aRet.Minutes = aTime.Minutes;
+ aRet.Seconds = aTime.Seconds;
+ aRet.Hours = aTime.Hours;
- return xRet;
+ return aRet;
}
css::util::Date DBTypeConversion::toDate(const OUString& _sSQLString)
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
index b5d8d51d7470..65806cdb5d02 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -487,10 +487,10 @@ void OPreparedStatement::describeParameter()
if ( !aParseNodes.empty() )
{
// m_xParamColumns = new OSQLColumns();
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
- if( !xTabs.empty() )
+ const OSQLTables& rTabs = m_aSQLIterator.getTables();
+ if( !rTabs.empty() )
{
- OSQLTable xTable = xTabs.begin()->second;
+ OSQLTable xTable = rTabs.begin()->second;
::std::vector< OSQLParseNode*>::const_iterator aIter = aParseNodes.begin();
for (;aIter != aParseNodes.end();++aIter )
{
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index 257f83961bbd..1903d5895c11 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1182,14 +1182,14 @@ bool OResultSet::OpenImpl()
OSL_ENSURE(m_pSQLAnalyzer,"No analyzer set with setSqlAnalyzer!");
if(!m_pTable)
{
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
- if (xTabs.empty() || !xTabs.begin()->second.is())
+ const OSQLTables& rTabs = m_aSQLIterator.getTables();
+ if (rTabs.empty() || !rTabs.begin()->second.is())
lcl_throwError(STR_QUERY_TOO_COMPLEX,*this);
- if ( xTabs.size() > 1 || m_aSQLIterator.hasErrors() )
+ if ( rTabs.size() > 1 || m_aSQLIterator.hasErrors() )
lcl_throwError(STR_QUERY_MORE_TABLES,*this);
- OSQLTable xTable = xTabs.begin()->second;
+ OSQLTable xTable = rTabs.begin()->second;
m_xColumns = m_aSQLIterator.getSelectColumns();
m_xColNames = xTable->getColumns();
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 1a5003972186..f374b827a179 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -394,14 +394,14 @@ void OStatement_Base::construct(const OUString& sql) throw(SQLException, Runtim
{
m_aSQLIterator.setParseTree(m_pParseTree);
m_aSQLIterator.traverseAll();
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
+ const OSQLTables& rTabs = m_aSQLIterator.getTables();
// sanity checks
- if ( xTabs.empty() )
+ if ( rTabs.empty() )
// no tables -> nothing to operate on -> error
m_pConnection->throwGenericSQLException(STR_QUERY_NO_TABLE,*this);
- if ( xTabs.size() > 1 || m_aSQLIterator.hasErrors() )
+ if ( rTabs.size() > 1 || m_aSQLIterator.hasErrors() )
// more than one table -> can't operate on them -> error
m_pConnection->throwGenericSQLException(STR_QUERY_MORE_TABLES,*this);
@@ -421,7 +421,7 @@ void OStatement_Base::construct(const OUString& sql) throw(SQLException, Runtim
}
// at this moment we support only one table per select statement
- Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(xTabs.begin()->second,UNO_QUERY);
+ Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(rTabs.begin()->second,UNO_QUERY);
if(xTunnel.is())
{
if(m_pTable)
diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
index adc7aa4a7bc3..df0ee8a5fc9e 100644
--- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx
+++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
@@ -433,7 +433,7 @@ void SAL_CALL java_sql_PreparedStatement::setBytes( sal_Int32 parameterIndex, co
static jmethodID mID(nullptr);
obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID);
jbyteArray pByteArray = t.pEnv->NewByteArray(x.getLength());
- jbyte * xData = reinterpret_cast<jbyte *>(
+ jbyte * pData = reinterpret_cast<jbyte *>(
const_cast<sal_Int8 *>(x.getConstArray()));
// 4th param of Set*ArrayRegion changed from pointer to non-const to
// pointer to const between <http://docs.oracle.com/javase/6/docs/
@@ -441,7 +441,7 @@ void SAL_CALL java_sql_PreparedStatement::setBytes( sal_Int32 parameterIndex, co
// <http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/
// functions.html#wp22933>; work around that difference in a way
// that doesn't trigger loplugin:redundantcast
- t.pEnv->SetByteArrayRegion(pByteArray,0,x.getLength(),xData);
+ t.pEnv->SetByteArrayRegion(pByteArray,0,x.getLength(),pData);
t.pEnv->CallVoidMethod( object, mID, parameterIndex,pByteArray);
t.pEnv->DeleteLocalRef(pByteArray);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
index 7ce1751f6ef1..d872258c82b2 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -661,7 +661,7 @@ void SAL_CALL java_sql_ResultSet::updateBytes( sal_Int32 columnIndex, const ::co
{
jbyteArray aArray = t.pEnv->NewByteArray(x.getLength());
- jbyte * xData = reinterpret_cast<jbyte *>(
+ jbyte * pData = reinterpret_cast<jbyte *>(
const_cast<sal_Int8 *>(x.getConstArray()));
// 4th param of Set*ArrayRegion changed from pointer to non-const to
// pointer to const between <http://docs.oracle.com/javase/6/docs/
@@ -669,7 +669,7 @@ void SAL_CALL java_sql_ResultSet::updateBytes( sal_Int32 columnIndex, const ::co
// <http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/
// functions.html#wp22933>; work around that difference in a way
// that doesn't trigger loplugin:redundantcast
- t.pEnv->SetByteArrayRegion(aArray,0,x.getLength(),xData);
+ t.pEnv->SetByteArrayRegion(aArray,0,x.getLength(),pData);
// convert parameter
t.pEnv->CallVoidMethod( object, mID,columnIndex,aArray);
t.pEnv->DeleteLocalRef(aArray);
diff --git a/connectivity/source/drivers/mork/MPreparedStatement.cxx b/connectivity/source/drivers/mork/MPreparedStatement.cxx
index ff59e956ccfb..51c6bdb08664 100644
--- a/connectivity/source/drivers/mork/MPreparedStatement.cxx
+++ b/connectivity/source/drivers/mork/MPreparedStatement.cxx
@@ -443,10 +443,10 @@ void OPreparedStatement::describeParameter()
if(!aParseNodes.empty())
{
m_xParamColumns = new OSQLColumns();
- const OSQLTables& xTabs = m_pSQLIterator->getTables();
- if(xTabs.size())
+ const OSQLTables& rTabs = m_pSQLIterator->getTables();
+ if(rTabs.size())
{
- OSQLTable xTable = xTabs.begin()->second;
+ OSQLTable xTable = rTabs.begin()->second;
::std::vector< OSQLParseNode*>::const_iterator aIter =
aParseNodes.begin();
for (;aIter != aParseNodes.end();++aIter )
diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx
index 65c8fbba3a7f..a183dd3670a8 100644
--- a/connectivity/source/drivers/mork/MQueryHelper.cxx
+++ b/connectivity/source/drivers/mork/MQueryHelper.cxx
@@ -158,10 +158,10 @@ bool MQueryHelper::checkRowAvailable( sal_Int32 nDBRow )
bool MQueryHelper::getRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const OUString& aDBColumnName, sal_Int32 nType )
{
- MQueryHelperResultEntry* xResEntry = getByIndex( nDBRow );
+ MQueryHelperResultEntry* pResEntry = getByIndex( nDBRow );
- OSL_ENSURE( xResEntry != nullptr, "xResEntry == NULL");
- if (xResEntry == nullptr )
+ OSL_ENSURE( pResEntry != nullptr, "xResEntry == NULL");
+ if (pResEntry == nullptr )
{
rValue.setNull();
return false;
@@ -169,7 +169,7 @@ bool MQueryHelper::getRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const OUS
switch ( nType )
{
case DataType::VARCHAR:
- rValue = xResEntry->getValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ) );
+ rValue = pResEntry->getValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ) );
break;
default:
@@ -187,30 +187,30 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression
OString oStringTable = OUStringToOString( m_aAddressbook, RTL_TEXTENCODING_UTF8 );
std::set<int> listRecords;
bool handleListTable = false;
- MorkParser* xMork;
+ MorkParser* pMork;
// check if we are retrieving the default table
if (oStringTable == "AddressBook" || oStringTable == "CollectedAddressBook")
{
- xMork = xConnection->getMorkParser(oStringTable);
+ pMork = xConnection->getMorkParser(oStringTable);
}
else
{
// Let's try to retrieve the list in Collected Addresses book
- xMork = xConnection->getMorkParser(OString("CollectedAddressBook"));
- if (std::find(xMork->lists_.begin(), xMork->lists_.end(), m_aAddressbook) == xMork->lists_.end())
+ pMork = xConnection->getMorkParser(OString("CollectedAddressBook"));
+ if (std::find(pMork->lists_.begin(), pMork->lists_.end(), m_aAddressbook) == pMork->lists_.end())
{
// so the list is in Address book
// TODO : manage case where an address book has been created
- xMork = xConnection->getMorkParser(OString("AddressBook"));
+ pMork = xConnection->getMorkParser(OString("AddressBook"));
}
handleListTable = true;
// retrieve row ids for that list table
std::string listTable = oStringTable.getStr();
- xMork->getRecordKeysForListTable(listTable, listRecords);
+ pMork->getRecordKeysForListTable(listTable, listRecords);
}
MorkTableMap::Map::iterator tableIter;
- MorkTableMap *Tables = xMork->getTables( 0x80 );
+ MorkTableMap *Tables = pMork->getTables( 0x80 );
if (!Tables)
return -1;
MorkRowMap *Rows = nullptr;
@@ -243,8 +243,8 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression
for (MorkCells::const_iterator CellsIter = rowIter->second.begin();
CellsIter != rowIter->second.end(); ++CellsIter )
{
- std::string column = xMork->getColumn(CellsIter->first);
- std::string value = xMork->getValue(CellsIter->second);
+ std::string column = pMork->getColumn(CellsIter->first);
+ std::string value = pMork->getValue(CellsIter->second);
OString key(column.c_str(), static_cast<sal_Int32>(column.size()));
OString valueOString(value.c_str(), static_cast<sal_Int32>(value.size()));
OUString valueOUString = OStringToOUString( valueOString, RTL_TEXTENCODING_UTF8 );
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index 10b2be9c1e98..ca0e94420fdf 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -1005,7 +1005,7 @@ void OResultSet::fillRowData()
MQueryExpression queryExpression;
- OConnection* xConnection = static_cast<OConnection*>(m_pStatement->getConnection().get());
+ OConnection* pConnection = static_cast<OConnection*>(m_pStatement->getConnection().get());
m_xColumns = m_pSQLIterator->getSelectColumns();
OSL_ENSURE(m_xColumns.is(), "Need the Columns!!");
@@ -1045,7 +1045,7 @@ void OResultSet::fillRowData()
OUString aStr( m_pTable->getName() );
m_aQueryHelper.setAddressbook( aStr );
- sal_Int32 rv = m_aQueryHelper.executeQuery(xConnection, queryExpression);
+ sal_Int32 rv = m_aQueryHelper.executeQuery(pConnection, queryExpression);
if ( rv == -1 ) {
m_pStatement->getOwnConnection()->throwSQLException( STR_ERR_EXECUTING_QUERY, *this );
}
@@ -1114,11 +1114,11 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
OSL_ENSURE( m_pTable, "Need a Table object");
if(!m_pTable)
{
- const OSQLTables& xTabs = m_pSQLIterator->getTables();
- if (xTabs.empty() || !xTabs.begin()->second.is())
+ const OSQLTables& rTabs = m_pSQLIterator->getTables();
+ if (rTabs.empty() || !rTabs.begin()->second.is())
m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
- m_pTable = static_cast< OTable* > ((xTabs.begin()->second).get());
+ m_pTable = static_cast< OTable* > ((rTabs.begin()->second).get());
}
diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx
index 272f49b1f65a..f8b04da0eea6 100644
--- a/connectivity/source/drivers/mork/MStatement.cxx
+++ b/connectivity/source/drivers/mork/MStatement.cxx
@@ -140,16 +140,16 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql
{
m_pSQLIterator->setParseTree(m_pParseTree);
m_pSQLIterator->traverseAll();
- const OSQLTables& xTabs = m_pSQLIterator->getTables();
+ const OSQLTables& rTabs = m_pSQLIterator->getTables();
- if (xTabs.empty())
+ if (rTabs.empty())
{
getOwnConnection()->throwSQLException( STR_QUERY_AT_LEAST_ONE_TABLES, *this );
}
#if OSL_DEBUG_LEVEL > 0
OSQLTables::const_iterator citer;
- for( citer = xTabs.begin(); citer != xTabs.end(); ++citer ) {
+ for( citer = rTabs.begin(); citer != rTabs.end(); ++citer ) {
OSL_TRACE("SELECT Table : %s", OUtoCStr(citer->first) );
}
#endif
@@ -161,9 +161,9 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql
// at this moment we support only one table per select statement
- OSL_ENSURE( xTabs.begin() != xTabs.end(), "Need a Table");
+ OSL_ENSURE( rTabs.begin() != rTabs.end(), "Need a Table");
- m_pTable = static_cast< OTable* > (xTabs.begin()->second.get());
+ m_pTable = static_cast< OTable* > (rTabs.begin()->second.get());
m_xColNames = m_pTable->getColumns();
xNames.set(m_xColNames,UNO_QUERY);
// set the binding of the resultrow