Files
Upsilon/apps/shared/function_app.cpp
Gabriel Ozouf b8544e3708 [apps/shared/text_field_delegate_app] Refuse Equal
The Equal sign now triggers a syntax error in all apps but Solver. This
make its behaviour symmetrical with that of < and >.

Change-Id: Ia886c547a315d5627a69f3f2acac2cbce0e202c2
2020-11-04 15:32:58 +01:00

46 lines
1.3 KiB
C++

#include "function_app.h"
using namespace Poincare;
namespace Shared {
FunctionApp::Snapshot::Snapshot() :
m_cursor(),
m_indexFunctionSelectedByCursor(0),
m_modelVersion(0),
m_rangeVersion(0),
m_angleUnitVersion(Preferences::AngleUnit::Radian)
{
assert(m_previousModelsVersions[0] == 0);
}
void FunctionApp::Snapshot::reset() {
m_indexFunctionSelectedByCursor = 0;
m_modelVersion = 0;
assert(sizeof(m_previousModelsVersions) == sizeof(uint32_t) * FunctionGraphController::sNumberOfMemoizedModelVersions);
memset(m_previousModelsVersions, 0, sizeof(m_previousModelsVersions));
m_rangeVersion = 0;
setActiveTab(0);
}
void FunctionApp::Snapshot::storageDidChangeForRecord(const Ion::Storage::Record record) {
functionStore()->storageDidChangeForRecord(record);
}
void FunctionApp::willBecomeInactive() {
if (m_modalViewController.isDisplayingModal()) {
m_modalViewController.dismissModalViewController(true);
}
if (inputViewController()->isDisplayingModal()) {
inputViewController()->abortEditionAndDismiss();
}
::App::willBecomeInactive();
}
bool FunctionApp::isAcceptableExpression(const Expression exp) {
return TextFieldDelegateApp::isAcceptableExpression(exp) && ExpressionCanBeSerialized(exp, false, Expression(), localContext());
}
}