File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
python/plugins/fTools/tools Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -374,16 +374,26 @@ def single_to_multi( self ):
374
374
merge_all = self .myField == "--- " + self .tr ( "Merge all" ) + " ---"
375
375
if not len ( unique ) == self .vlayer .featureCount () or merge_all :
376
376
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
377
383
multi_feature = []
378
384
first = True
379
385
fit = vprovider .getFeatures ()
380
386
while fit .nextFeature ( inFeat ):
381
387
atMap = inFeat .attributes ()
382
388
if not merge_all :
383
389
idVar = atMap [ index ]
390
+ if isinstance ( idVar , basestring ):
391
+ idVarMod = idVar .strip ()
392
+ else :
393
+ idVarMod = idVar
384
394
else :
385
395
idVar = ""
386
- if idVar . strip () == i . strip () or merge_all :
396
+ if idVarMod == iMod or merge_all :
387
397
if first :
388
398
atts = atMap
389
399
first = False
You can’t perform that action at this time.
0 commit comments