Skip to content

Commit e4f410b

Browse files
committed
[ftools] S'part to M'part with non-string columns and NULL values
Fix #8625
1 parent 3fe3bc5 commit e4f410b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

python/plugins/fTools/tools/doGeometry.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,26 @@ def single_to_multi( self ):
374374
merge_all = self.myField == "--- " + self.tr( "Merge all" ) + " ---"
375375
if not len( unique ) == self.vlayer.featureCount() or merge_all:
376376
for i in unique:
377+
# Strip spaces for strings, so " A " and "A" will be grouped
378+
# TODO: Make this optional (opt-out to keep it easy for beginners)
379+
if isinstance( i, basestring ):
380+
iMod = i.strip()
381+
else:
382+
iMod = i
377383
multi_feature= []
378384
first = True
379385
fit = vprovider.getFeatures()
380386
while fit.nextFeature( inFeat ):
381387
atMap = inFeat.attributes()
382388
if not merge_all:
383389
idVar = atMap[ index ]
390+
if isinstance( idVar, basestring ):
391+
idVarMod = idVar.strip()
392+
else:
393+
idVarMod = idVar
384394
else:
385395
idVar = ""
386-
if idVar.strip() == i.strip() or merge_all:
396+
if idVarMod == iMod or merge_all:
387397
if first:
388398
atts = atMap
389399
first = False

0 commit comments

Comments
 (0)