This fixes a bug in the code to modify multiple table columns in one go.
We were accidentally adding more tracked columns when adding a new
column and then changing its name.

See issue #1627.
This commit is contained in:
Martin Kleusberg
2018-11-28 12:13:38 +01:00
parent 583301d0df
commit e8a03f462c

View File

@@ -323,7 +323,7 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
// Update the field name in the map of old column names to new column names
if(!m_bNewTable)
{
for(const auto& key : trackColumns)
for(const auto& key : trackColumns.keys())
{
if(trackColumns[key] == oldFieldName)
trackColumns[key] = field.name();
@@ -588,7 +588,7 @@ void EditTableDialog::removeField()
// Update the map of tracked columns to indicate the column is deleted
QString name = ui->treeWidget->currentItem()->text(0);
for(const auto& key : trackColumns)
for(const auto& key : trackColumns.keys())
{
if(trackColumns[key] == name)
trackColumns[key] = QString();