Skip to content
Permalink
Browse files
leaner imitation of .arg
  • Loading branch information
jef-n committed Jan 25, 2013
1 parent f6806a9 commit 45faef9c94970ea2e2508814a17853e0b463c66c
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/core/qgsexpression.cpp
@@ -572,15 +572,9 @@ static QVariant fcnLPad( const QVariantList& values, QgsFeature* , QgsExpression
static QVariant fcnFormatString( const QVariantList& values, QgsFeature* , QgsExpression *parent )
{
QString string = getStringValue( values.at( 0 ), parent );
for ( int n = 1; n <= values.length() - 1; n++ )
for ( int n = 1; n < values.length(); n++ )
{
QString arg = getStringValue( values.at( n ), parent );
QString place = '%' + QString::number( n );
if ( string.indexOf( place ) == -1 )
{
continue;
}
string.replace( place, arg );
string = string.arg( getStringValue( values.at( n ), parent ) );
}
return string;
}

0 comments on commit 45faef9

Please sign in to comment.