mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[escher] SelectableTableView: fix wrong assert
This commit is contained in:
committed by
EmilieNumworks
parent
ca2fdf8ffd
commit
df45f800e1
@@ -158,7 +158,15 @@ void SelectableTableView::unhighlightSelectedCell() {
|
||||
if (selectedColumn() >= 0 && selectedColumn() < dataSource()->numberOfColumns() &&
|
||||
selectedRow() >= 0 && selectedRow() < dataSource()->numberOfRows()) {
|
||||
HighlightCell * previousCell = cellAtLocation(selectedColumn(), selectedRow());
|
||||
assert(previousCell);
|
||||
previousCell->setHighlighted(false);
|
||||
/* Previous cell does not always exist.
|
||||
* For example, unhighlightSelectedCell can be called twice:
|
||||
* - from selectCellAtLocation
|
||||
* - and then from m_delegate->tableViewDidChangeSelection inside unhighlightSelectedCell
|
||||
* The first call selects an invisible cell. At the time of the second call,
|
||||
* the selected cell might be still invisible because scrolling happens
|
||||
* after. */
|
||||
if (previousCell) {
|
||||
previousCell->setHighlighted(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user