mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 09:10:48 +01:00
[apps] Calculation: input text stores in cache have to be checked again
when used as its length context dependent (because of 'ans' symbol)
This commit is contained in:
committed by
EmilieNumworks
parent
53393524ef
commit
a8fe8dc22e
@@ -87,6 +87,11 @@ void EditExpressionController::didBecomeFirstResponder() {
|
||||
bool EditExpressionController::textFieldDidReceiveEvent(::TextField * textField, Ion::Events::Event event) {
|
||||
if (textField->isEditing() && textField->textFieldShouldFinishEditing(event) && textField->draftTextLength() == 0 && m_cacheBuffer[0] != 0) {
|
||||
App * calculationApp = (App *)app();
|
||||
/* The input text store in m_cacheBuffer might have beed correct the first
|
||||
* time but then be too long when replacing ans in another context */
|
||||
if (!calculationApp->textInputIsCorrect(m_cacheBuffer)) {
|
||||
return true;
|
||||
}
|
||||
m_calculationStore->push(m_cacheBuffer, calculationApp->localContext());
|
||||
m_historyController->reload();
|
||||
((ContentView *)view())->mainView()->scrollToCell(0, m_historyController->numberOfRows()-1);
|
||||
|
||||
Reference in New Issue
Block a user