diff --git a/apps/graph/graph/integral_graph_controller.cpp b/apps/graph/graph/integral_graph_controller.cpp index 5ebb852a1..1e49258f2 100644 --- a/apps/graph/graph/integral_graph_controller.cpp +++ b/apps/graph/graph/integral_graph_controller.cpp @@ -36,7 +36,7 @@ double IntegralGraphController::cursorNextStep(double x, int direction) { return (direction > 0 ? x + m_graphRange->xGridUnit()/k_numberOfCursorStepsInGradUnit : x - m_graphRange->xGridUnit()/k_numberOfCursorStepsInGradUnit); } -ExpressionLayout * IntegralGraphController::createFunctionLayout(const char * functionName) { +LayoutReference IntegralGraphController::createFunctionLayout(const char * functionName) { char buffer[7] = "0(x)dx"; buffer[0] = functionName[0]; return LayoutHelper::String(buffer, strlen(buffer), KDText::FontSize::Small); diff --git a/apps/graph/graph/integral_graph_controller.h b/apps/graph/graph/integral_graph_controller.h index 5c0aaf8cc..685b8d1d1 100644 --- a/apps/graph/graph/integral_graph_controller.h +++ b/apps/graph/graph/integral_graph_controller.h @@ -14,7 +14,7 @@ public: private: I18n::Message legendMessageAtStep(Step step) override; double cursorNextStep(double position, int direction) override; - Poincare::ExpressionLayout * createFunctionLayout(const char * functionName) override; + Poincare::LayoutReference createFunctionLayout(const char * functionName) override; }; } diff --git a/apps/shared/sum_graph_controller.cpp b/apps/shared/sum_graph_controller.cpp index 77025580f..14bc6290f 100644 --- a/apps/shared/sum_graph_controller.cpp +++ b/apps/shared/sum_graph_controller.cpp @@ -229,8 +229,8 @@ void SumGraphController::LegendView::setEditableZone(double d) { m_editableZone.setText(buffer); } -void SumGraphController::LegendView::setSumSymbol(Step step, double start, double end, double result, ExpressionLayout * functionLayout) { - assert(step == Step::Result || functionLayout == nullptr); +void SumGraphController::LegendView::setSumSymbol(Step step, double start, double end, double result, LayoutReference functionLayout) { + assert(step == Step::Result || functionLayout.isUninitialized()); const char sigma[] = {' ', m_sumSymbol}; if (step == Step::FirstParameter) { m_sumLayoutRef = LayoutHelper::String(sigma, sizeof(sigma)); diff --git a/apps/shared/sum_graph_controller.h b/apps/shared/sum_graph_controller.h index e40a74bf8..010b2879c 100644 --- a/apps/shared/sum_graph_controller.h +++ b/apps/shared/sum_graph_controller.h @@ -39,7 +39,7 @@ private: constexpr static float k_cursorBottomMarginRatio = 0.28f; // (cursorHeight/2+bannerHeigh)/graphViewHeight virtual I18n::Message legendMessageAtStep(Step step) = 0; virtual double cursorNextStep(double position, int direction) = 0; - virtual Poincare::ExpressionLayout * createFunctionLayout(const char * functionName) = 0; + virtual Poincare::LayoutReference createFunctionLayout(const char * functionName) = 0; Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override { return m_graphRange; } Shared::CurveView * curveView() override { return m_graphView; } TextFieldDelegateApp * textFieldDelegateApp() override { @@ -58,7 +58,7 @@ private: void drawRect(KDContext * ctx, KDRect rect) const override; void setLegendMessage(I18n::Message message, Step step); void setEditableZone(double d); - void setSumSymbol(Step step, double start = NAN, double end = NAN, double result = NAN, Poincare::ExpressionLayout * sequenceName = nullptr); + void setSumSymbol(Step step, double start = NAN, double end = NAN, double result = NAN, Poincare::LayoutReference sequenceName = Poincare::LayoutReference()); private: constexpr static KDCoordinate k_legendHeight = 35; constexpr static KDCoordinate k_editableZoneWidth = 12*KDText::charSize(KDText::FontSize::Small).width();