[apps] add a method to get the global context in appsContainer

Change-Id: I4b7a4c1c64ae21c7e4f0193b3314d96cef805cbb
This commit is contained in:
Émilie Feral
2016-11-10 11:15:54 +01:00
parent 54bd0a3912
commit af6a1c7046
8 changed files with 11 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
#include "values_controller.h"
#include "../../constant.h"
#include "../../apps_container.h"
#include "../app.h"
#include <assert.h>
@@ -289,8 +290,8 @@ void ValuesController::editValue(bool overwrite, char initialDigit) {
ValueCell * cell = valuesController->abscisseCellAtRow(activeRow);
InputViewController * myInputViewController = (InputViewController *)sender;
const char * textBody = myInputViewController->textBody();
App * myApp = (App *)valuesController->app();
Context * globalContext = myApp->globalContext();
AppsContainer * appsContainer = (AppsContainer *)valuesController->app()->container();
Context * globalContext = appsContainer->context();
float floatBody = Expression::parse(textBody)->approximate(*globalContext);
valuesController->interval()->setElement(activeRow-1, floatBody);
valuesController->willDisplayCellAtLocation(cell, activeColumn, activeRow);