From 1c859fd1dff8f08f577dc153178ba6aa477667a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 14 Nov 2018 10:55:24 +0100 Subject: [PATCH] [poincare] Do not beautify after reduce interrupted simplification --- poincare/src/expression.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/poincare/src/expression.cpp b/poincare/src/expression.cpp index 82d86fc7e..9dae0cd26 100644 --- a/poincare/src/expression.cpp +++ b/poincare/src/expression.cpp @@ -317,11 +317,10 @@ Expression Expression::ParseAndSimplify(const char * text, Context & context, Pr Expression Expression::simplify(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) { sSimplificationHasBeenInterrupted = false; Expression e = reduce(context, angleUnit, replaceSymbols); - e = e.deepBeautify(context, angleUnit); - if (sSimplificationHasBeenInterrupted) { - return Expression(); + if (!sSimplificationHasBeenInterrupted) { + e = e.deepBeautify(context, angleUnit); } - return e; + return sSimplificationHasBeenInterrupted ? Expression() : e; } Expression Expression::ExpressionWithoutSymbols(Expression e, Context & context) {