summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-05 08:32:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-05 11:08:48 +0200
commit4b2262ab5b10f334f1984fec84d2978db81c58f1 (patch)
treede56663eba6ed2edf7a26127339dd8563fdf47be /connectivity
parentec1de6895d84fbe4f2d5fb7135a59a918138d970 (diff)
new loplugin unnecessaryparen
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/dbconversion.cxx6
-rw-r--r--connectivity/source/commontools/dbtools.cxx6
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx8
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx2
-rw-r--r--connectivity/source/drivers/file/fanalyzer.cxx2
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageMap.cxx2
-rw-r--r--connectivity/source/drivers/mork/MResultSet.cxx4
-rw-r--r--connectivity/source/drivers/mork/MStatement.cxx2
-rw-r--r--connectivity/source/parse/sqlnode.cxx2
10 files changed, 18 insertions, 18 deletions
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 5be258a7e698..61abe27d84b8 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -151,10 +151,10 @@ namespace dbtools
static bool implIsLeapYear(sal_Int32 _nYear)
{
- return ( ( ((_nYear % 4) == 0)
- && ((_nYear % 100) != 0)
- )
+ return ( ((_nYear % 4) == 0)
+ && ((_nYear % 100) != 0)
)
+
|| ((_nYear % 400) == 0)
;
}
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index fa34331d85f9..24eee42a4cf2 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1175,17 +1175,17 @@ catch(const Exception&)
bool canInsert(const Reference< XPropertySet>& _rxCursorSet)
{
- return ((_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue("Privileges")) & Privilege::INSERT) != 0));
+ return (_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue("Privileges")) & Privilege::INSERT) != 0);
}
bool canUpdate(const Reference< XPropertySet>& _rxCursorSet)
{
- return ((_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue("Privileges")) & Privilege::UPDATE) != 0));
+ return (_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue("Privileges")) & Privilege::UPDATE) != 0);
}
bool canDelete(const Reference< XPropertySet>& _rxCursorSet)
{
- return ((_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue("Privileges")) & Privilege::DELETE) != 0));
+ return (_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue("Privileges")) & Privilege::DELETE) != 0);
}
Reference< XDataSource> findDataSource(const Reference< XInterface >& _xParent)
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index e931026400ec..361eafcfc1bf 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -288,14 +288,14 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
OSQLParseNode* pLHS = parseTree->getChild( 0 );
OSQLParseNode* pRHS = parseTree->getChild( 2 );
- if ( ( !( SQL_ISRULE( pLHS, column_ref ) ) // on the LHS, we accept a column or a constant int value
+ if ( ( ! SQL_ISRULE( pLHS, column_ref ) // on the LHS, we accept a column or a constant int value
&& ( pLHS->getNodeType() != SQLNodeType::IntNum )
)
|| ( ( pRHS->getNodeType() != SQLNodeType::String ) // on the RHS, certain literals are acceptable
&& ( pRHS->getNodeType() != SQLNodeType::IntNum )
&& ( pRHS->getNodeType() != SQLNodeType::ApproxNum )
- && !( SQL_ISTOKEN( pRHS, TRUE ) )
- && !( SQL_ISTOKEN( pRHS, FALSE ) )
+ && ! SQL_ISTOKEN( pRHS, TRUE )
+ && ! SQL_ISTOKEN( pRHS, FALSE )
)
|| ( ( pLHS->getNodeType() == SQLNodeType::IntNum ) // an int on LHS requires an int on RHS
&& ( pRHS->getNodeType() != SQLNodeType::IntNum )
@@ -386,7 +386,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
// We currently can't handle a 'NOT LIKE' when there are '%'
m_pConnection->throwGenericSQLException(STR_QUERY_NOT_LIKE_TOO_COMPLEX,*this);
}
- else if( (aMatchString.indexOf ( WILDCARD ) == aMatchString.lastIndexOf ( WILDCARD ) ) )
+ else if( aMatchString.indexOf ( WILDCARD ) == aMatchString.lastIndexOf ( WILDCARD ) )
{ // One occurrence of '%' matches...
if ( aMatchString.startsWith(OUStringLiteral1(WILDCARD)) )
pResult = createTest( aColumnName, E_BOOK_QUERY_ENDS_WITH, aMatchString.copy( 1 ) );
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 6fccaeb6d6ad..756a370f57b3 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -365,7 +365,7 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef,
m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1);
// Ascending or Descending?
- m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? TAscendingOrder::DESC : TAscendingOrder::ASC);
+ m_aOrderbyAscending.push_back(SQL_ISTOKEN(pAscendingDescending,DESC) ? TAscendingOrder::DESC : TAscendingOrder::ASC);
}
void OStatement_Base::construct(const OUString& sql)
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx
index c4e80d29f47d..1ed686ab645d 100644
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ b/connectivity/source/drivers/file/fanalyzer.cxx
@@ -83,7 +83,7 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode)
pCompiler->execute( pColumnRef );
m_aSelectionEvaluations.push_back( TPredicates(pCompiler,pInterpreter) );
}
- else if ( ( SQL_ISRULE(pColumnRef,general_set_fct) && pColumnRef->count() != 4 ) )
+ else if ( SQL_ISRULE(pColumnRef,general_set_fct) && pColumnRef->count() != 4 )
{
m_pConnection->throwGenericSQLException(STR_QUERY_COMPLEX_COUNT,nullptr);
}
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 3682f4d9d528..be93f506805e 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -143,7 +143,7 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode)
{
execute(pPredicateNode->getChild(1));
}
- else if ((SQL_ISRULE(pPredicateNode,search_condition) || (SQL_ISRULE(pPredicateNode,boolean_term)))
+ else if ((SQL_ISRULE(pPredicateNode,search_condition) || SQL_ISRULE(pPredicateNode,boolean_term))
&& // AND/OR-linkage:
pPredicateNode->count() == 3)
{
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index 3181b940bf84..7ff389c76bc0 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -291,7 +291,7 @@ namespace connectivity
{
OUString sStrippedName = removeOldURLPrefix(sOrgName);
- if ( ((_nMode & ElementModes::WRITE) != ElementModes::WRITE ) )
+ if ( (_nMode & ElementModes::WRITE) != ElementModes::WRITE )
{
bool bIsStream = true;
try
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index 5a0ae000bee7..81f253fd3d2d 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -716,7 +716,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
analyseWhereClause( parseTree->getChild( 1 ), *subExpression );
queryExpression.addExpression( subExpression );
}
- else if ((SQL_ISRULE(parseTree,search_condition) || (SQL_ISRULE(parseTree,boolean_term)))
+ else if ((SQL_ISRULE(parseTree,search_condition) || SQL_ISRULE(parseTree,boolean_term))
&& parseTree->count() == 3) // Handle AND/OR
{
// TODO - Need to take care or AND, for now match is always OR
@@ -777,7 +777,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
{
OSL_ENSURE(parseTree->count() == 2, "Error parsing LIKE predicate");
- if ( !(SQL_ISRULE(parseTree->getChild(0), column_ref)) )
+ if ( !SQL_ISRULE(parseTree->getChild(0), column_ref) )
{
m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_LIKE_COLUMN, *this );
}
diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx
index 13cb0d280073..d9aea80da5dc 100644
--- a/connectivity/source/drivers/mork/MStatement.cxx
+++ b/connectivity/source/drivers/mork/MStatement.cxx
@@ -466,7 +466,7 @@ void OCommonStatement::setOrderbyColumn( OSQLParseNode* pColumnRef,
m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName));
// Ascending or Descending?
- m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? TAscendingOrder::DESC : TAscendingOrder::ASC);
+ m_aOrderbyAscending.push_back(SQL_ISTOKEN(pAscendingDescending,DESC) ? TAscendingOrder::DESC : TAscendingOrder::ASC);
}
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 2bb37029b583..db2a94e32178 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2008,7 +2008,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition, bool
pPart2->replace(pNot, pNotNot);
delete pNot;
}
- else if(bNegate && (SQL_ISRULE(pSearchCondition,like_predicate)))
+ else if(bNegate && SQL_ISRULE(pSearchCondition,like_predicate))
{
OSQLParseNode* pNot = pSearchCondition->getChild( 1 )->getChild( 0 );
OSQLParseNode* pNotNot = nullptr;