Skip to content

Commit

Permalink
Fix for bug 1892, Merge tool (Postgis features) results in shifted at…
Browse files Browse the repository at this point in the history
…tribute positions

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11497 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 25, 2009
1 parent 93613af commit 6ef9017
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/qgsmergeattributesdialog.cpp
Expand Up @@ -514,17 +514,20 @@ QgsAttributeMap QgsMergeAttributesDialog::mergedAttributesMap() const
}

resultMap = mFeatureList[0].attributeMap();
//go through all the items and replace the values in the attribute map
for ( int i = 0; i < resultMap.size(); ++i )
int index = 0;
QgsAttributeMap::iterator it = resultMap.begin();

for ( ; it != resultMap.end(); ++it )
{
QTableWidgetItem* currentItem = mTableWidget->item( mFeatureList.size() + 1, i );
QTableWidgetItem* currentItem = mTableWidget->item( mFeatureList.size() + 1, index );
if ( !currentItem )
{
continue;
}
QString mergedString = currentItem->text();
QVariant newValue( mergedString );
resultMap.insert( i, newValue );
resultMap.insert( it.key(), newValue );
++index;
}

return resultMap;
Expand Down

0 comments on commit 6ef9017

Please sign in to comment.