Skip to content

Commit 45faef9

Browse files
committedJan 25, 2013
leaner imitation of .arg
1 parent f6806a9 commit 45faef9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed
 

‎src/core/qgsexpression.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -572,15 +572,9 @@ static QVariant fcnLPad( const QVariantList& values, QgsFeature* , QgsExpression
572572
static QVariant fcnFormatString( const QVariantList& values, QgsFeature* , QgsExpression *parent )
573573
{
574574
QString string = getStringValue( values.at( 0 ), parent );
575-
for ( int n = 1; n <= values.length() - 1; n++ )
575+
for ( int n = 1; n < values.length(); n++ )
576576
{
577-
QString arg = getStringValue( values.at( n ), parent );
578-
QString place = '%' + QString::number( n );
579-
if ( string.indexOf( place ) == -1 )
580-
{
581-
continue;
582-
}
583-
string.replace( place, arg );
577+
string = string.arg( getStringValue( values.at( n ), parent ) );
584578
}
585579
return string;
586580
}

0 commit comments

Comments
 (0)
Please sign in to comment.