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:
@@ -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() << ")";
|
||||
|
||||
Reference in New Issue
Block a user