From 71f3aaf39eb01d00fe70861e4bae7ad23e894699 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 6 Jun 2018 20:22:59 +1000 Subject: [PATCH] Fix crash in merge features dialog Fixes #19119 --- src/app/qgsmergeattributesdialog.cpp | 4 +--- src/app/qgsmergeattributesdialog.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/qgsmergeattributesdialog.cpp b/src/app/qgsmergeattributesdialog.cpp index 3a6b2aca91b..e21ce2a7bff 100644 --- a/src/app/qgsmergeattributesdialog.cpp +++ b/src/app/qgsmergeattributesdialog.cpp @@ -361,10 +361,8 @@ void QgsMergeAttributesDialog::refreshMergedValue( int col ) mUpdating = false; } -QVariant QgsMergeAttributesDialog::featureAttribute( QgsFeatureId featureId, int col ) +QVariant QgsMergeAttributesDialog::featureAttribute( QgsFeatureId featureId, int fieldIdx ) { - int fieldIdx = mTableWidget->horizontalHeaderItem( col )->data( FieldIndex ).toInt(); - int i; for ( i = 0; i < mFeatureList.size() && mFeatureList.at( i ).id() != featureId; i++ ) ; diff --git a/src/app/qgsmergeattributesdialog.h b/src/app/qgsmergeattributesdialog.h index a1018a6271f..862dce50849 100644 --- a/src/app/qgsmergeattributesdialog.h +++ b/src/app/qgsmergeattributesdialog.h @@ -81,7 +81,7 @@ class APP_EXPORT QgsMergeAttributesDialog: public QDialog, private Ui::QgsMergeA //! Calculates the merged value of a column (depending on the selected merge behavior) and inserts the value in the corresponding cell void refreshMergedValue( int col ); //! Inserts the attribute value of a specific feature into the row of merged attributes - QVariant featureAttribute( QgsFeatureId featureId, int col ); + QVariant featureAttribute( QgsFeatureId featureId, int fieldIdx ); //! Appends the values of the features for the final value QVariant concatenationAttribute( int col );