Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 21ca8ad

Browse files
committedJul 10, 2019
[expressions] fix comparison of intervals
1 parent 57edc7b commit 21ca8ad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/core/expression/qgsexpressionnodeimpl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,14 @@ QVariant QgsExpressionNodeBinaryOperator::evalNode( QgsExpression *parent, const
400400
ENSURE_NO_EVAL_ERROR;
401401
return compare( fL - fR ) ? TVL_True : TVL_False;
402402
}
403+
else if ( QgsExpressionUtils::isIntervalSafe( vL ) && QgsExpressionUtils::isIntervalSafe( vR ) )
404+
{
405+
double fL = QgsExpressionUtils::getInterval( vL, parent ).seconds();
406+
ENSURE_NO_EVAL_ERROR;
407+
double fR = QgsExpressionUtils::getInterval( vR, parent ).seconds();
408+
ENSURE_NO_EVAL_ERROR;
409+
return compare( fL - fR ) ? TVL_True : TVL_False;
410+
}
403411
else
404412
{
405413
// do string comparison otherwise

0 commit comments

Comments
 (0)
Please sign in to comment.