mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Fix crash and blocking condition while removing hidden columns at copy
It uses QMutableListIterator for removing while iterating and it can also be made forwards, sot it is clearer. This fixes #1256 in my environment.
This commit is contained in:
@@ -181,13 +181,11 @@ void ExtendedTableWidget::copy(const bool withHeaders)
|
||||
// Remove all indices from hidden columns, because if we don't we might copy data from hidden columns as well which is very
|
||||
// unintuitive; especially copying the rowid column when selecting all columns of a table is a problem because pasting the data
|
||||
// won't work as expected.
|
||||
for(int i=indices.size()-1;i>=0;)
|
||||
{
|
||||
if(isColumnHidden(indices.at(i).column()))
|
||||
indices.removeAt(i);
|
||||
else
|
||||
i--;
|
||||
}
|
||||
QMutableListIterator<QModelIndex> i(indices);
|
||||
while (i.hasNext()) {
|
||||
if (isColumnHidden(i.next().column()))
|
||||
i.remove();
|
||||
}
|
||||
|
||||
// Abort if there's nothing to copy
|
||||
if (indices.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user