C++: fix the FilterModel's row_removed

Same fix as in the rust equivalent from previous commit
This commit is contained in:
Olivier Goffart 2024-02-04 16:36:24 +01:00
parent 1a4528e447
commit 5e12f0876f

View file

@ -984,11 +984,7 @@ struct ReverseModelInner : private_api::ModelChangeListener
void row_removed(size_t first_removed_row, size_t count) override
{
auto row_count = source_model->row_count();
auto old_row_count = row_count + count;
auto row = old_row_count - first_removed_row - 1;
target_model.row_removed(row, count);
target_model.row_removed(source_model->row_count() - first_removed_row, count);
}
void reset() override { source_model.reset(); }