From 078f5b846ce3b7740955c6c304d83ad46f386ad0 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Mon, 27 Aug 2012 14:26:19 +0200 Subject: [PATCH] fix #6253 --- src/gui/qgsattributeeditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/qgsattributeeditor.cpp b/src/gui/qgsattributeeditor.cpp index eebfa269086..c6f61bf7c5a 100644 --- a/src/gui/qgsattributeeditor.cpp +++ b/src/gui/qgsattributeeditor.cpp @@ -600,15 +600,16 @@ bool QgsAttributeEditor::retrieveValue( QWidget *widget, QgsVectorLayer *vl, int if ( editType == QgsVectorLayer::ValueRelation ) { text = '{'; - for ( int i = 0; i < lw->count(); i++ ) + for ( int i = 0, n = 0; i < lw->count(); i++ ) { if ( lw->item( i )->checkState() == Qt::Checked ) { - if ( i > 0 ) + if ( n > 0 ) { text.append( ',' ); } text.append( lw->item( i )->data( Qt::UserRole ).toString() ); + n++; } } text.append( '}' );