LibGUI: Make a copy of source_rows before resizing it in sort_mapping()
This commit is contained in:
parent
4f19deb13b
commit
b2e6ba8d7f
Notes:
sideshowbarker
2024-07-17 18:42:46 +09:00
Author: https://github.com/obyknovenius Commit: https://github.com/SerenityOS/serenity/commit/b2e6ba8d7f Pull-request: https://github.com/SerenityOS/serenity/pull/12580 Issue: https://github.com/SerenityOS/serenity/issues/12566
1 changed files with 2 additions and 2 deletions
|
@ -163,6 +163,8 @@ ModelIndex SortingProxyModel::parent_index(ModelIndex const& proxy_index) const
|
|||
|
||||
void SortingProxyModel::sort_mapping(Mapping& mapping, int column, SortOrder sort_order)
|
||||
{
|
||||
auto old_source_rows = mapping.source_rows;
|
||||
|
||||
int row_count = source().row_count(mapping.source_parent);
|
||||
mapping.source_rows.resize(row_count);
|
||||
mapping.proxy_rows.resize(row_count);
|
||||
|
@ -175,8 +177,6 @@ void SortingProxyModel::sort_mapping(Mapping& mapping, int column, SortOrder sor
|
|||
return;
|
||||
}
|
||||
|
||||
auto old_source_rows = mapping.source_rows;
|
||||
|
||||
for (int i = 0; i < row_count; ++i)
|
||||
mapping.source_rows[i] = i;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue