[apps/calculation] HistoryController: avoid 2 calls to

setSelectedSubviewType in tableViewDidChangeSelectionAndDidScroll
This commit is contained in:
Émilie Feral
2020-06-26 17:29:55 +02:00
parent 736833da34
commit aef804d149

View File

@@ -161,13 +161,13 @@ void HistoryController::tableViewDidChangeSelectionAndDidScroll(SelectableTableV
setSelectedSubviewType(SubviewType::Input, false, previousSelectedCellX, previousSelectedCellY);
} else {
HistoryViewCell * selectedCell = (HistoryViewCell *)(t->selectedCell());
if (selectedSubviewType() == SubviewType::Ellipsis && selectedCell->additionalInformationType() == Calculation::AdditionalInformationType::None) {
setSelectedSubviewType(SubviewType::Output, false, previousSelectedCellX, previousSelectedCellY);
}
SubviewType nextSelectedSubviewType = selectedSubviewType();
if (selectedCell && !selectedCell->displaysSingleLine()) {
nextSelectedSubviewType = previousSelectedCellY < selectedRow() ? SubviewType::Input : SubviewType::Output;
}
if (nextSelectedSubviewType == SubviewType::Ellipsis && selectedCell->additionalInformationType() == Calculation::AdditionalInformationType::None) {
nextSelectedSubviewType = SubviewType::Output;
}
setSelectedSubviewType(nextSelectedSubviewType, false, previousSelectedCellX, previousSelectedCellY);
}
// The selectedCell may change during setSelectedSubviewType