I have a ListBoxModel that returns 0 in its getNumRows method when not connected to a data source.
I expected the refreshComponentForRow to not be called (since list is empty), but it’s called twice with rows 0 and 1 during addAndMakeVisible.
Why is that so ? Shouldn’t getNumRows have authority on the rows created or updated ?
A range verification in ListViewport::updateContents could fix this problem:
void updateContents()
{
hasUpdated = true;
const int rowHeight = owner.getRowHeight();
const int rowCount = owner.getModel() ? owner.getModel()->getNumRows() : 0;
...
if (row < rowCount)
rowComp->update (row, owner.isRowSelected (row));
...
{
