Skip to content

Commit

Permalink
[ftools] S'part to M'part with non-string columns and NULL values
Browse files Browse the repository at this point in the history
Fix #8625
  • Loading branch information
m-kuhn committed Jan 30, 2014
1 parent 3fe3bc5 commit e4f410b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion python/plugins/fTools/tools/doGeometry.py
Expand Up @@ -374,16 +374,26 @@ def single_to_multi( self ):
merge_all = self.myField == "--- " + self.tr( "Merge all" ) + " ---"
if not len( unique ) == self.vlayer.featureCount() or merge_all:
for i in unique:
# Strip spaces for strings, so " A " and "A" will be grouped
# TODO: Make this optional (opt-out to keep it easy for beginners)
if isinstance( i, basestring ):
iMod = i.strip()
else:
iMod = i
multi_feature= []
first = True
fit = vprovider.getFeatures()
while fit.nextFeature( inFeat ):
atMap = inFeat.attributes()
if not merge_all:
idVar = atMap[ index ]
if isinstance( idVar, basestring ):
idVarMod = idVar.strip()
else:
idVarMod = idVar
else:
idVar = ""
if idVar.strip() == i.strip() or merge_all:
if idVarMod == iMod or merge_all:
if first:
atts = atMap
first = False
Expand Down

0 comments on commit e4f410b

Please sign in to comment.