From 2e4af43fe3b5f649f6bd46bf0394f39c04477c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 5 Oct 2018 12:04:16 +0200 Subject: [PATCH] [apps/graph] Fix computation of function names column There was a bug for more than 5 rows. --- apps/shared/storage_function_list_controller.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/shared/storage_function_list_controller.h b/apps/shared/storage_function_list_controller.h index 59c076c1f..ea599f67d 100644 --- a/apps/shared/storage_function_list_controller.h +++ b/apps/shared/storage_function_list_controller.h @@ -49,9 +49,11 @@ public: KDCoordinate columnWidth = k_minNameColumnWidth; int firstDisplayedIndex = m_selectableTableView.firstDisplayedRowIndex(); int lastDisplayedIndex = firstDisplayedIndex+m_selectableTableView.numberOfDisplayableRows(); + FunctionTitleCell * currentTitleCell = nullptr; for (int i = firstDisplayedIndex; i < lastDisplayedIndex; i++) { - const char * currentName = titleCells(i)->text(); - KDText::FontSize fontSize = titleCells(i)->fontSize(); + currentTitleCell = titleCells(i-firstDisplayedIndex); + const char * currentName = currentTitleCell->text(); + KDText::FontSize fontSize = currentTitleCell->fontSize(); KDCoordinate currentNameWidth = KDText::stringSize(currentName, fontSize).width(); columnWidth = columnWidth < currentNameWidth ? currentNameWidth : columnWidth; }