diff --git a/apps/shared/store_controller.cpp b/apps/shared/store_controller.cpp index e3aeb7633..e332a0385 100644 --- a/apps/shared/store_controller.cpp +++ b/apps/shared/store_controller.cpp @@ -39,10 +39,10 @@ int StoreController::indexFromCumulatedWidth(KDCoordinate offsetX) { HighlightCell * StoreController::reusableCell(int index, int type) { assert(index >= 0); switch (type) { - case 0: + case k_titleCellType: assert(index < k_numberOfTitleCells); return titleCells(index); - case 1: + case k_editableCellType: assert(index < k_maxNumberOfEditableCells); return m_editableCells[index]; default: @@ -52,14 +52,14 @@ HighlightCell * StoreController::reusableCell(int index, int type) { } int StoreController::reusableCellCount(int type) { - if (type == 0) { + if (type == k_titleCellType) { return k_numberOfTitleCells; } return k_maxNumberOfEditableCells; } int StoreController::typeAtLocation(int i, int j) { - return j!=0; + return j == 0 ? k_titleCellType : k_editableCellType; } void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) { diff --git a/apps/shared/store_controller.h b/apps/shared/store_controller.h index 915dad585..0bdf2b44d 100644 --- a/apps/shared/store_controller.h +++ b/apps/shared/store_controller.h @@ -26,6 +26,8 @@ protected: static constexpr KDCoordinate k_cellWidth = Ion::Display::Width/2 - Metric::CommonRightMargin/2 - Metric::CommonLeftMargin/2; constexpr static int k_maxNumberOfEditableCells = 22; constexpr static int k_numberOfTitleCells = 2; + static constexpr int k_titleCellType = 0; + static constexpr int k_editableCellType = 1; Responder * tabController() const override; View * loadView() override; void unloadView(View * view) override;