[apps/calculation] Invalid calculation height memoization when leaving

the app.

Fix wrong memoization: in calculation app input '[[1+i, 2][3,4]]', change
the complex format to Polar, go back to the calculation app --> the
calculation height was no recomputed despite the fact that the approximation
output changed.
This commit is contained in:
Émilie Feral
2019-08-19 09:59:01 +02:00
parent 05972099fe
commit 1cc09de9ae
4 changed files with 17 additions and 1 deletions

View File

@@ -33,6 +33,13 @@ Calculation * Calculation::next() const {
return reinterpret_cast<Calculation *>(const_cast<char *>(result));
}
void Calculation::tidy() {
/* Reset height memoization (the complex format could have changed when
* re-entering Calculation app which would impact the heights). */
m_height = -1;
m_expandedHeight = -1;
}
const char * Calculation::approximateOutputText() const {
const char * exactOutput = exactOutputText();
return exactOutput + strlen(exactOutput) + 1;