Skip to content

Commit

Permalink
[expressions] fix comparison of intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jul 10, 2019
1 parent 57edc7b commit 21ca8ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/expression/qgsexpressionnodeimpl.cpp
Expand Up @@ -400,6 +400,14 @@ QVariant QgsExpressionNodeBinaryOperator::evalNode( QgsExpression *parent, const
ENSURE_NO_EVAL_ERROR;
return compare( fL - fR ) ? TVL_True : TVL_False;
}
else if ( QgsExpressionUtils::isIntervalSafe( vL ) && QgsExpressionUtils::isIntervalSafe( vR ) )
{
double fL = QgsExpressionUtils::getInterval( vL, parent ).seconds();
ENSURE_NO_EVAL_ERROR;
double fR = QgsExpressionUtils::getInterval( vR, parent ).seconds();
ENSURE_NO_EVAL_ERROR;
return compare( fL - fR ) ? TVL_True : TVL_False;
}
else
{
// do string comparison otherwise
Expand Down

0 comments on commit 21ca8ad

Please sign in to comment.