[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,6 +1,7 @@
#include "values_parameter_controller.h"
#include "../app.h"
#include "../../constant.h"
#include "../../apps_container.h"
#include <assert.h>
namespace Graph {
@@ -110,8 +111,8 @@ void ValuesParameterController::editInterval(bool overwrite, char initialDigit)
TextMenuListCell * cell = (TextMenuListCell *)valuesParameterController->reusableCell(activeCell);
InputViewController * myInputViewController = (InputViewController *)sender;
const char * textBody = myInputViewController->textBody();
App * myApp = (App *)valuesParameterController->app();
Context * globalContext = myApp->globalContext();
AppsContainer * appsContainer = (AppsContainer *)valuesParameterController->app()->container();
Context * globalContext = appsContainer->context();
float floatBody = Expression::parse(textBody)->approximate(*globalContext);
valuesParameterController->setIntervalParameterAtIndex(activeCell, floatBody);
valuesParameterController->willDisplayCellForIndex(cell, activeCell);