diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-06 07:44:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-06 07:45:25 +0200 |
commit | 794f09f195a449e387ebfbd53eb1b693803c95e7 (patch) | |
tree | 4c82e01015ccac094261060021b49757dab12f19 /dbaccess | |
parent | 3f569908ac72c20826a45ebed59af9b1e5449207 (diff) |
simplify ternary conditions "xxx ? true : yyy"
Look for code like:
xxx ? true : yyy;
Which can be simplified to:
xxx || yyy
Change-Id: Ib7ca86580bfd0cf04674328a3c0cf3747de4758d
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/OptimisticSet.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 59a97552a25f..d32b973e3150 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -146,7 +146,7 @@ OKeySet::~OKeySet() void OKeySet::initColumns() { Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); - bool bCase = (xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()) ? true : false; + bool bCase = xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(); m_pKeyColumnNames.reset( new SelectColumnsMetaData(bCase) ); m_pColumnNames.reset( new SelectColumnsMetaData(bCase) ); m_pParameterNames.reset( new SelectColumnsMetaData(bCase) ); diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index 2a60e228e6fc..84cbc7a0fad3 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -111,7 +111,7 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const OU m_sRowSetFilter = i_sRowSetFilter; Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); - bool bCase = (xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()) ? true : false; + bool bCase = xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(); Reference<XColumnsSupplier> xQueryColSup(m_xComposer,UNO_QUERY); const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns(); const Reference<XTablesSupplier> xTabSup(m_xComposer,UNO_QUERY); diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 6897395f7b2e..8abdbe524b14 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -218,7 +218,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, { Reference<XNameAccess> xSelColumns = xColSup->getColumns(); Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); - SelectColumnsMetaData aColumnNames(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers() ? true : false); + SelectColumnsMetaData aColumnNames(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()); ::dbaccess::getColumnPositions(xSelColumns,xPrimaryKeyColumns->getElementNames(),aUpdateTableName,aColumnNames); bAllKeysFound = !aColumnNames.empty() && sal_Int32(aColumnNames.size()) == xPrimaryKeyColumns->getElementNames().getLength(); } @@ -285,7 +285,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, else { Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); - SelectColumnsMetaData aColumnNames(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers() ? true : false); + SelectColumnsMetaData aColumnNames(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()); Reference<XColumnsSupplier> xColSup(_xAnalyzer,UNO_QUERY); Reference<XNameAccess> xSelColumns = xColSup->getColumns(); Reference<XNameAccess> xColumns = m_aUpdateTable->getColumns(); diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index a19fcf465776..e27c91aa36d4 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -1009,7 +1009,7 @@ void OTableController::alterColumns() // contains all columns names which are already handled those which are not in the list will be deleted Reference< XDatabaseMetaData> xMetaData = getMetaData( ); - ::std::map< OUString,sal_Bool,::comphelper::UStringMixLess> aColumns(xMetaData.is() ? (xMetaData->supportsMixedCaseQuotedIdentifiers() ? true : false): sal_True); + ::std::map< OUString,sal_Bool,::comphelper::UStringMixLess> aColumns(xMetaData.is() ? xMetaData->supportsMixedCaseQuotedIdentifiers() : sal_True); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_vRowList.begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_vRowList.end(); // first look for columns where something other than the name changed |