From e2462a3897bc5122bada288efa53daae7a4ede81 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 16 Jul 2015 13:52:11 +0200 Subject: loplugin:simplifybool Change-Id: I2520ff8ca5f9c0dd68cc4c5cdc377d455c87898d --- mysqlc/source/mysqlc_connection.cxx | 2 +- mysqlc/source/mysqlc_databasemetadata.cxx | 4 ++-- mysqlc/source/mysqlc_resultset.cxx | 22 +++++++++++----------- mysqlc/source/mysqlc_resultsetmetadata.cxx | 14 +++++++------- 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'mysqlc') diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx index 836d67405ed0..fa975f7b9577 100644 --- a/mysqlc/source/mysqlc_connection.cxx +++ b/mysqlc/source/mysqlc_connection.cxx @@ -306,7 +306,7 @@ void SAL_CALL OConnection::setAutoCommit(sal_Bool autoCommit) MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); try { - m_settings.cppConnection->setAutoCommit(autoCommit == sal_True); + m_settings.cppConnection->setAutoCommit(autoCommit); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } diff --git a/mysqlc/source/mysqlc_databasemetadata.cxx b/mysqlc/source/mysqlc_databasemetadata.cxx index b35023ea9852..1f3986b49179 100644 --- a/mysqlc/source/mysqlc_databasemetadata.cxx +++ b/mysqlc/source/mysqlc_databasemetadata.cxx @@ -620,7 +620,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert(sal_Int32 /* fromType */, s OSL_TRACE("ODatabaseMetaData::supportsConvert"); try { /* ToDo -> use supportsConvert( fromType, toType) */ - return meta->supportsConvert()? sal_True:sal_False; + return meta->supportsConvert(); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::supportsConvert", *this); } catch (const sql::InvalidArgumentException &) { @@ -979,7 +979,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency(sal_Int32 setT return meta->supportsResultSetConcurrency(setType, concurrency==com::sun::star::sdbc::TransactionIsolation::READ_COMMITTED? sql::TRANSACTION_READ_COMMITTED: (concurrency == com::sun::star::sdbc::TransactionIsolation::SERIALIZABLE? - sql::TRANSACTION_SERIALIZABLE:sql::TRANSACTION_SERIALIZABLE))? sal_True:sal_False; + sql::TRANSACTION_SERIALIZABLE:sql::TRANSACTION_SERIALIZABLE)); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::supportsResultSetConcurrency", *this); } catch (const sql::InvalidArgumentException &) { diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx index 65e498766950..92943380f79e 100644 --- a/mysqlc/source/mysqlc_resultset.cxx +++ b/mysqlc/source/mysqlc_resultset.cxx @@ -189,7 +189,7 @@ sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 column) checkColumnIndex(column); try { - return m_result->getBoolean(column)? sal_True:sal_False; + return m_result->getBoolean(column); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -523,7 +523,7 @@ sal_Bool SAL_CALL OResultSet::isBeforeFirst() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->isBeforeFirst()? sal_True:sal_False; + return m_result->isBeforeFirst(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -538,7 +538,7 @@ sal_Bool SAL_CALL OResultSet::isAfterLast() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->isAfterLast()? sal_True:sal_False; + return m_result->isAfterLast(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -568,7 +568,7 @@ sal_Bool SAL_CALL OResultSet::isLast() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->isLast()? sal_True:sal_False; + return m_result->isLast(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -625,7 +625,7 @@ sal_Bool SAL_CALL OResultSet::first() throw(SQLException, RuntimeException, std: checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->first()? sal_True:sal_False; + return m_result->first(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -640,7 +640,7 @@ sal_Bool SAL_CALL OResultSet::last() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->last()? sal_True:sal_False; + return m_result->last(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -655,7 +655,7 @@ sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 row) checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->absolute(row)? sal_True:sal_False; + return m_result->absolute(row); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -670,7 +670,7 @@ sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row) checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->relative(row)? sal_True:sal_False; + return m_result->relative(row); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -685,7 +685,7 @@ sal_Bool SAL_CALL OResultSet::previous() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->previous()? sal_True:sal_False; + return m_result->previous(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -740,7 +740,7 @@ sal_Bool SAL_CALL OResultSet::next() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->next()? sal_True:sal_False; + return m_result->next(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -755,7 +755,7 @@ sal_Bool SAL_CALL OResultSet::wasNull() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return m_result->wasNull()? sal_True:sal_False; + return m_result->wasNull(); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } diff --git a/mysqlc/source/mysqlc_resultsetmetadata.cxx b/mysqlc/source/mysqlc_resultsetmetadata.cxx index 2f6b83ff3007..464eab07801d 100644 --- a/mysqlc/source/mysqlc_resultsetmetadata.cxx +++ b/mysqlc/source/mysqlc_resultsetmetadata.cxx @@ -212,7 +212,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isCurrency(sal_Int32 column) checkColumnIndex(column); try { - return meta->isCurrency(column)? sal_True:sal_False; + return meta->isCurrency(column); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSetMetaData::getMetaData", *this); } catch (const sql::SQLException &e) { @@ -228,7 +228,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement(sal_Int32 column) checkColumnIndex(column); try { - return meta->isAutoIncrement(column)? sal_True:sal_False; + return meta->isAutoIncrement(column); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSetMetaData::getMetaData", *this); } catch (const sql::SQLException &e) { @@ -244,7 +244,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isSigned(sal_Int32 column) checkColumnIndex(column); try { - return meta->isSigned(column)? sal_True:sal_False; + return meta->isSigned(column); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSetMetaData::getMetaData", *this); } catch (const sql::SQLException &e) { @@ -307,7 +307,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isSearchable(sal_Int32 column) checkColumnIndex(column); try { - return meta->isSearchable(column)? sal_True:sal_False; + return meta->isSearchable(column); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSetMetaData::getMetaData", *this); } catch (const sql::SQLException &e) { @@ -323,7 +323,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isReadOnly(sal_Int32 column) checkColumnIndex(column); try { - return meta->isReadOnly(column)? sal_True:sal_False; + return meta->isReadOnly(column); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSetMetaData::getMetaData", *this); } catch (const sql::SQLException &e) { @@ -339,7 +339,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isDefinitelyWritable(sal_Int32 column) checkColumnIndex(column); try { - return meta->isDefinitelyWritable(column)? sal_True:sal_False; + return meta->isDefinitelyWritable(column); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSetMetaData::getMetaData", *this); } catch (const sql::SQLException &e) { @@ -355,7 +355,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isWritable(sal_Int32 column) checkColumnIndex(column); try { - return meta->isWritable(column)? sal_True:sal_False; + return meta->isWritable(column); } catch (const sql::MethodNotImplementedException &) { mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSetMetaData::getMetaData", *this); } catch (const sql::SQLException &e) { -- cgit