summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-24 12:25:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-24 12:36:19 +0200
commitcf7f31c1d631eaec22ea89466f7639adf9ed620f (patch)
treeccad396eff00c3601f1c6057b630990044d8f3b7 /connectivity
parent820fca753b0bfed6078b9cde09430177d6a193ca (diff)
loplugin:simplifybool
Change-Id: Ib0290487a963d665a628bd75f4140a9e2b89faa7
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/TSortIndex.cxx2
-rw-r--r--connectivity/source/drivers/kab/KStatement.cxx4
-rw-r--r--connectivity/source/drivers/mork/MQueryHelper.cxx16
3 files changed, 10 insertions, 12 deletions
diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx
index 0d0e97a40d10..454cf06e5630 100644
--- a/connectivity/source/commontools/TSortIndex.cxx
+++ b/connectivity/source/commontools/TSortIndex.cxx
@@ -40,7 +40,7 @@ struct TKeyValueFunc : ::std::binary_function<OSortIndex::TIntValuePairVector::v
::std::vector<OKeyType>::const_iterator aIter = aKeyType.begin();
for (::std::vector<sal_Int16>::size_type i=0;aIter != aKeyType.end(); ++aIter,++i)
{
- const bool nGreater = (pIndex->getAscending(i) == SQL_ASC) ? false : true;
+ const bool nGreater = pIndex->getAscending(i) != SQL_ASC;
const bool nLess = !nGreater;
// compare depending for type
diff --git a/connectivity/source/drivers/kab/KStatement.cxx b/connectivity/source/drivers/kab/KStatement.cxx
index ec619ee7db5d..5eab3b7a28a5 100644
--- a/connectivity/source/drivers/kab/KStatement.cxx
+++ b/connectivity/source/drivers/kab/KStatement.cxx
@@ -271,9 +271,7 @@ KabOrder *KabCommonStatement::analyseOrderByClause(const OSQLParseNode *pParseNo
OUString sColumnName =
pColumnRef->getChild(0)->getTokenValue();
bool bAscending =
- SQL_ISTOKEN(pAscendingDescending, DESC)?
- false:
- true;
+ !SQL_ISTOKEN(pAscendingDescending, DESC);
return new KabSimpleOrder(sColumnName, bAscending);
}
diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx
index 5cfb9b76c908..b4394c7fbbf4 100644
--- a/connectivity/source/drivers/mork/MQueryHelper.cxx
+++ b/connectivity/source/drivers/mork/MQueryHelper.cxx
@@ -298,22 +298,22 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression
OUString searchedValue = evStr->getValue();
if (evStr->getCond() == MQueryOp::Is) {
SAL_INFO("connectivity.mork", "MQueryOp::Is; done");
- resultVector.push_back((currentValue == searchedValue) ? true : false);
+ resultVector.push_back(currentValue == searchedValue);
} else if (evStr->getCond() == MQueryOp::IsNot) {
SAL_INFO("connectivity.mork", "MQueryOp::IsNot; done");
- resultVector.push_back((currentValue == searchedValue) ? false : true);
+ resultVector.push_back(currentValue != searchedValue);
} else if (evStr->getCond() == MQueryOp::EndsWith) {
SAL_INFO("connectivity.mork", "MQueryOp::EndsWith; done");
- resultVector.push_back((currentValue.endsWith(searchedValue)) ? true : false);
+ resultVector.push_back(currentValue.endsWith(searchedValue));
} else if (evStr->getCond() == MQueryOp::BeginsWith) {
SAL_INFO("connectivity.mork", "MQueryOp::BeginsWith; done");
- resultVector.push_back((currentValue.startsWith(searchedValue)) ? true : false);
+ resultVector.push_back(currentValue.startsWith(searchedValue));
} else if (evStr->getCond() == MQueryOp::Contains) {
SAL_INFO("connectivity.mork", "MQueryOp::Contains; done");
- resultVector.push_back((currentValue.indexOf(searchedValue) == -1) ? false : true);
+ resultVector.push_back(currentValue.indexOf(searchedValue) != -1);
} else if (evStr->getCond() == MQueryOp::DoesNotContain) {
SAL_INFO("connectivity.mork", "MQueryOp::DoesNotContain; done");
- resultVector.push_back((currentValue.indexOf(searchedValue) == -1) ? true : false);
+ resultVector.push_back(currentValue.indexOf(searchedValue) == -1);
} else if (evStr->getCond() == MQueryOp::RegExp) {
SAL_INFO("connectivity.mork", "MQueryOp::RegExp; done");
utl::SearchParam param(
@@ -326,10 +326,10 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression
}
} else if (evStr->getCond() == MQueryOp::Exists) {
SAL_INFO("connectivity.mork", "MQueryOp::Exists; done");
- resultVector.push_back((currentValue.isEmpty()) ? false : true);
+ resultVector.push_back(!currentValue.isEmpty());
} else if (evStr->getCond() == MQueryOp::DoesNotExist) {
SAL_INFO("connectivity.mork", "MQueryOp::DoesNotExist; done");
- resultVector.push_back((currentValue.isEmpty()) ? true : false);
+ resultVector.push_back(currentValue.isEmpty());
}
}
else if ( (*evIter)->isExpr() ) {