[escher][apps] Get rid of duplicate overriden methods:

cumulatedHeightFromIndex, indexFromCumulatedHeight
This commit is contained in:
Émilie Feral
2018-06-12 10:27:23 +02:00
parent 67cddf554d
commit c24e2726fa
6 changed files with 0 additions and 57 deletions

View File

@@ -147,23 +147,6 @@ KDCoordinate HistoryController::rowHeight(int j) {
return calculation->height(calculationApp->localContext()) + 3*HistoryViewCell::k_digitVerticalMargin;
}
KDCoordinate HistoryController::cumulatedHeightFromIndex(int j) {
int result = 0;
for (int k = 0; k < j; k++) {
result += rowHeight(k);
}
return result;
}
int HistoryController::indexFromCumulatedHeight(KDCoordinate offsetY) {
int result = 0;
int j = 0;
while (result < offsetY && j < numberOfRows()) {
result += rowHeight(j++);
}
return (result < offsetY || offsetY == 0) ? j : j - 1;
}
int HistoryController::typeAtLocation(int i, int j) {
return 0;
}

View File

@@ -24,8 +24,6 @@ public:
int reusableCellCount(int type) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
KDCoordinate rowHeight(int j) override;
KDCoordinate cumulatedHeightFromIndex(int j) override;
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
int typeAtLocation(int i, int j) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
void scrollToCell(int i, int j);

View File

@@ -173,23 +173,6 @@ KDCoordinate VariableBoxController::ContentViewController::rowHeight(int index)
return Metric::ToolboxRowHeight;
}
KDCoordinate VariableBoxController::ContentViewController::cumulatedHeightFromIndex(int j) {
int result = 0;
for (int k = 0; k < j; k++) {
result += rowHeight(k);
}
return result;
}
int VariableBoxController::ContentViewController::indexFromCumulatedHeight(KDCoordinate offsetY) {
int result = 0;
int j = 0;
while (result < offsetY && j < numberOfRows()) {
result += rowHeight(j++);
}
return (result < offsetY || offsetY == 0) ? j : j - 1;
}
int VariableBoxController::ContentViewController::typeAtLocation(int i, int j) {
if (m_currentPage == Page::RootMenu) {
return 1;

View File

@@ -28,8 +28,6 @@ private:
int reusableCellCount(int type) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
KDCoordinate rowHeight(int j) override;
KDCoordinate cumulatedHeightFromIndex(int j) override;
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
int typeAtLocation(int i, int j) override;
void setSender(Responder * responder) { m_sender = responder; }
void reloadData();

View File

@@ -26,8 +26,6 @@ public:
HighlightCell * reusableCell(int index, int type) override;
int reusableCellCount(int type) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
KDCoordinate cumulatedHeightFromIndex(int j) override;
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
int typeAtLocation(int i, int j) override;
protected:

View File

@@ -155,23 +155,6 @@ void Toolbox::willDisplayCellForIndex(HighlightCell * cell, int index) {
myCell->setMessage(messageTree->label());
}
KDCoordinate Toolbox::cumulatedHeightFromIndex(int j) {
int result = 0;
for (int k = 0; k < j; k++) {
result += rowHeight(k);
}
return result;
}
int Toolbox::indexFromCumulatedHeight(KDCoordinate offsetY) {
int result = 0;
int j = 0;
while (result < offsetY && j < numberOfRows()) {
result += rowHeight(j++);
}
return (result < offsetY || offsetY == 0) ? j : j - 1;
}
int Toolbox::typeAtLocation(int i, int j) {
MessageTree * messageTree = (MessageTree *)m_messageTreeModel->children(j);
if (messageTree->numberOfChildren() == 0) {