[poincare] Get rid of SpecialSymbols::Ans

This commit is contained in:
Émilie Feral
2018-09-27 14:10:44 +02:00
parent 11b98bb13e
commit 7f72f820a0
2 changed files with 2 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ bool App::textInputIsCorrect(const char * text) {
return false;
}
Expression ansExpression = static_cast<Snapshot *>(snapshot())->calculationStore()->ansExpression(localContext());
exp = exp.replaceSymbolWithExpression(Symbol::SpecialSymbols::Ans, ansExpression);
exp = exp.replaceSymbolWithExpression("ans", ansExpression);
char buffer[Calculation::k_printedExpressionSize];
int length = PoincareHelpers::Serialize(exp, buffer, sizeof(buffer));
/* if the buffer is totally full, it is VERY likely that writeTextInBuffer

View File

@@ -34,7 +34,7 @@ void Calculation::reset() {
void Calculation::setContent(const char * c, Context * context, Expression ansExpression) {
reset();
Expression input = Expression::parse(c).replaceSymbolWithExpression(Symbol::SpecialSymbols::Ans, ansExpression);
Expression input = Expression::parse(c).replaceSymbolWithExpression("ans", ansExpression);
/* We do not store directly the text enter by the user because we do not want
* to keep Ans symbol in the calculation store. */
PoincareHelpers::Serialize(input, m_inputText, sizeof(m_inputText));