Spreadsheet: Fixed for issue #2767: In some instances, needed parentheses are dropped from the expression. Fixed and updated unit tests.

This commit is contained in:
Eivind Kvedalen
2016-09-04 23:54:06 +02:00
committed by wmayer
parent a0f796664f
commit 7279c1bd53
2 changed files with 17 additions and 1 deletions

View File

@@ -534,6 +534,10 @@ std::string OperatorExpression::toString() const
else if (!isCommutative())
needsParens = true;
}
else if (right->priority() == priority()) {
if (!isRightAssociative())
needsParens = true;
}
if (needsParens)
s << "(" << right->toString() << ")";