From 531b555949a33808bd8bcd59ba84648d697735f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 30 Nov 2018 17:33:39 +0100 Subject: [PATCH] [apps/sequence] Fix method that should be virtual pure The following scenaro crashed in DEBUG=1 and did not resize the window correctly in DEBUG=0. Got to sequence u(n)=n Go to sequence/graph Remove yAuto Go to sequence/list v(n) = cos(n) remove u(n) Go to sequence/graph --- apps/sequence/graph/graph_controller.cpp | 4 ++++ apps/sequence/graph/graph_controller.h | 2 ++ apps/shared/interactive_curve_view_controller.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/sequence/graph/graph_controller.cpp b/apps/sequence/graph/graph_controller.cpp index d5686e5ca..d16d68e9d 100644 --- a/apps/sequence/graph/graph_controller.cpp +++ b/apps/sequence/graph/graph_controller.cpp @@ -29,6 +29,10 @@ TermSumController * GraphController::termSumController() { return &m_termSumController; } +int GraphController::numberOfCurves() const { + return m_sequenceStore->numberOfModels(); +} + BannerView * GraphController::bannerView() { return &m_bannerView; } diff --git a/apps/sequence/graph/graph_controller.h b/apps/sequence/graph/graph_controller.h index 7c6916c0d..40e7f70d8 100644 --- a/apps/sequence/graph/graph_controller.h +++ b/apps/sequence/graph/graph_controller.h @@ -17,6 +17,8 @@ public: GraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, SequenceStore * sequenceStore, CurveViewRange * graphRange, Shared::CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * modelVersion, uint32_t * rangeVersion, Poincare::Preferences::AngleUnit * angleUnitVersion, ButtonRowController * header); I18n::Message emptyMessage() override; TermSumController * termSumController(); +protected: + int numberOfCurves() const override; private: BannerView * bannerView() override; bool handleEnter() override; diff --git a/apps/shared/interactive_curve_view_controller.h b/apps/shared/interactive_curve_view_controller.h index 27079c950..e455a6457 100644 --- a/apps/shared/interactive_curve_view_controller.h +++ b/apps/shared/interactive_curve_view_controller.h @@ -50,7 +50,7 @@ protected: virtual bool closestCurveIndexIsSuitable(int newIndex, int currentIndex) const { assert(false); return false; } virtual double yValue(int curveIndex, double x, Poincare::Context * context) const { assert(false); return 0; } virtual bool suitableYValue(double y) const { return true; } - virtual int numberOfCurves() const { assert(false); return 0; } + virtual int numberOfCurves() const = 0; OkView m_okView; private: