[apps/shared] Avoid container casting when possible

Change-Id: I646e605c88ad577ebd9102032aad77ff8eae6ad7
This commit is contained in:
Émilie Feral
2017-02-13 18:05:02 +01:00
parent 627dd676be
commit 15a736c855
18 changed files with 54 additions and 52 deletions

View File

@@ -204,9 +204,9 @@ bool CalculationController::textFieldDidReceiveEvent(TextField * textField, Ion:
}
bool CalculationController::textFieldDidFinishEditing(TextField * textField, const char * text) {
AppsContainer * appsContainer = (AppsContainer *)app()->container();
Context * globalContext = appsContainer->globalContext();
float floatBody = Expression::parse(text)->approximate(*globalContext, appsContainer->preferences()->angleUnit());
App * probaApp = (App *)app();
Context * globalContext = probaApp->container()->globalContext();
float floatBody = Expression::parse(text)->approximate(*globalContext, probaApp->container()->preferences()->angleUnit());
m_calculation->setParameterAtIndex(floatBody, m_highlightedSubviewIndex-1);
for (int k = 0; k < m_calculation->numberOfParameters(); k++) {
m_contentView.willDisplayEditableCellAtIndex(k);