mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
LibGUI: Make a copy of source_rows before resizing it in sort_mapping()
This commit is contained in:
committed by
Andreas Kling
parent
4f19deb13b
commit
b2e6ba8d7f
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user