Skip to content
Permalink
Browse files

Fix for bug 1892, Merge tool (Postgis features) results in shifted at…

…tribute positions

git-svn-id: http://svn.osgeo.org/qgis/trunk@11497 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Aug 25, 2009
1 parent 92333ed commit 61604a3260e8682f300cdf4ed1050e6c44b1425a
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/app/qgsmergeattributesdialog.cpp
@@ -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;

0 comments on commit 61604a3

Please sign in to comment.
You can’t perform that action at this time.