Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03b3451e authored by Hans Boehm's avatar Hans Boehm
Browse files

Only set erroneous result of "required" evaluations.

Bug: 33555997

Otherwise the history display would see the erroneous result
and force reevaluation and error message display, even when the user
did not type "=".

Change-Id: Id3954abb886ad20cb526131cbe405db4bf5ca16b
parent 74f5e59e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ public class Evaluator implements CalculatorExpr.ExprResolver {

    public static final int INVALID_MSD = Integer.MAX_VALUE;

    // Used to represent an error result. Not displayed.
    // Used to represent an erroneous result or a required evaluation. Not displayed.
    public static final String ERRONEOUS_RESULT = "ERR";

    /**
@@ -616,7 +616,9 @@ public class Evaluator implements CalculatorExpr.ExprResolver {
                    }
                    mListener.onCancelled(mIndex);
                } else {
                    if (mRequired) {
                        mExprInfo.mResultString = ERRONEOUS_RESULT;
                    }
                    mListener.onError(mIndex, result.errorResourceId);
                }
                return;