From 99a6451074494ba975de28f21c10ab28386bf87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 30 Aug 2019 10:39:36 +0200 Subject: [PATCH] [apps/graph/list] DomainParameterController: fix bug (use of out of scope variable) --- apps/graph/list/domain_parameter_controller.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/graph/list/domain_parameter_controller.cpp b/apps/graph/list/domain_parameter_controller.cpp index c84a5bcc8..7de22e658 100644 --- a/apps/graph/list/domain_parameter_controller.cpp +++ b/apps/graph/list/domain_parameter_controller.cpp @@ -32,29 +32,27 @@ void DomainParameterController::willDisplayCellForIndex(HighlightCell * cell, in } MessageTableCellWithEditableText * myCell = (MessageTableCellWithEditableText *)cell; Shared::CartesianFunction::PlotType plotType = function()->plotType(); - I18n::Message * labels; switch (plotType) { case Shared::CartesianFunction::PlotType::Cartesian: { - I18n::Message l[k_totalNumberOfCell] = {I18n::Message::XMin, I18n::Message::XMax}; - labels = l; + I18n::Message labels[k_totalNumberOfCell] = {I18n::Message::XMin, I18n::Message::XMax}; + myCell->setMessage(labels[index]); break; } case Shared::CartesianFunction::PlotType::Parametric: { - I18n::Message l[k_totalNumberOfCell] = {I18n::Message::TMin, I18n::Message::TMax}; - labels = l; + I18n::Message labels[k_totalNumberOfCell] = {I18n::Message::TMin, I18n::Message::TMax}; + myCell->setMessage(labels[index]); break; } default: { assert(plotType == Shared::CartesianFunction::PlotType::Polar); - I18n::Message l[k_totalNumberOfCell] = {I18n::Message::ThetaMin, I18n::Message::ThetaMax}; - labels = l; + I18n::Message labels[k_totalNumberOfCell] = {I18n::Message::ThetaMin, I18n::Message::ThetaMax}; + myCell->setMessage(labels[index]); break; } } - myCell->setMessage(labels[index]); FloatParameterController::willDisplayCellForIndex(cell, index); }