From 5b67269e72c8f2ff8739ed79b4cea9a8f5e64fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 18 Jul 2018 17:25:11 +0200 Subject: [PATCH] [poincare] Fix SequenceToolbox special cells display when scrolling When scrolling from "v(n+1)" to "abs(x)", the "v(n+1)" cell disappeared --- apps/sequence/list/sequence_toolbox.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/sequence/list/sequence_toolbox.cpp b/apps/sequence/list/sequence_toolbox.cpp index b27604498..ee11cfb84 100644 --- a/apps/sequence/list/sequence_toolbox.cpp +++ b/apps/sequence/list/sequence_toolbox.cpp @@ -54,9 +54,11 @@ HighlightCell * SequenceToolbox::reusableCell(int index, int type) { } void SequenceToolbox::willDisplayCellForIndex(HighlightCell * cell, int index) { - if (typeAtLocation(0, index) != 2) { - MathToolbox::willDisplayCellForIndex(cell, mathToolboxIndex(index)); + if (typeAtLocation(0, index) == 2) { + static_cast(cell)->setExpressionLayout(m_addedCellLayout[index]); + return; } + MathToolbox::willDisplayCellForIndex(cell, mathToolboxIndex(index)); } int SequenceToolbox::typeAtLocation(int i, int j) { @@ -105,9 +107,6 @@ void SequenceToolbox::setExtraCells(const char * sequenceName, int recurrenceDep new VerticalOffsetLayout(LayoutEngine::createStringLayout(indice, strlen(indice), KDText::FontSize::Small), VerticalOffsetLayout::Type::Subscript, false), false); } - for (int index = 0; index < k_maxNumberOfDisplayedRows; index++) { - m_addedCells[index].setExpressionLayout(m_addedCellLayout[index]); - } } bool SequenceToolbox::selectAddedCell(int selectedRow){