Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #36349 from troopa81/fix_rename_user_expr
Don't add another user expression when changing its label
  • Loading branch information
elpaso committed May 15, 2020
2 parents 157e437 + 279909a commit c13b677
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -927,6 +927,12 @@ void QgsExpressionBuilderWidget::editSelectedUserExpression()

if ( dlg.exec() == QDialog::DialogCode::Accepted )
{
// label has changed removed the old one before adding the new one
if ( dlg.label() != item->text() )
{
mExpressionTreeView->removeFromUserExpressions( item->text() );
}

mExpressionTreeView->saveToUserExpressions( dlg.label(), dlg.expression(), dlg.helpText() );
}
}
Expand Down

0 comments on commit c13b677

Please sign in to comment.