mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibGUI: Make a copy of source_rows before resizing it in sort_mapping()
This commit is contained in:
parent
4f19deb13b
commit
b2e6ba8d7f
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
Add a link
Reference in a new issue