[apps/shared] Define static app() accessor in FunctionApp class

This commit is contained in:
Ruben Dashyan
2019-07-18 17:48:27 +02:00
committed by EmilieNumworks
parent 2c9489966d
commit ff887ec4a0
10 changed files with 15 additions and 18 deletions

View File

@@ -66,7 +66,7 @@ bool SumGraphController::handleEvent(Ion::Events::Event event) {
}
bool SumGraphController::moveCursorHorizontallyToPosition(double x) {
FunctionApp * myApp = static_cast<FunctionApp *>(app());
FunctionApp * myApp = FunctionApp::app();
assert(!m_record.isNull());
ExpiringPointer<Function> function = myApp->functionStore()->modelForRecord(m_record);
double y = function->evaluateAtAbscissa(x, myApp->localContext());
@@ -138,7 +138,7 @@ void SumGraphController::reloadBannerView() {
double result;
Poincare::Layout functionLayout;
if (m_step == Step::Result) {
FunctionApp * myApp = static_cast<FunctionApp *>(app());
FunctionApp * myApp = FunctionApp::app();
assert(!m_record.isNull());
ExpiringPointer<Function> function = myApp->functionStore()->modelForRecord(m_record);
result = function->sumBetweenBounds(m_startSum, m_endSum, myApp->localContext());