Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix regexp_substr expression to correctly return only first matched g…
…roup, not entire matched string
  • Loading branch information
nyalldawson committed Aug 8, 2013
1 parent 33c288a commit 41f8abb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsexpression.cpp
Expand Up @@ -688,7 +688,7 @@ static QVariant fcnRegexpSubstr( const QVariantList& values, const QgsFeature* ,
if ( re.captureCount() > 0 )
{
// return first capture
return QVariant( re.capturedTexts()[0] );
return QVariant( re.capturedTexts()[1] );
}
else
{
Expand Down Expand Up @@ -1661,7 +1661,7 @@ bool QgsExpression::needsGeometry()

void QgsExpression::initGeomCalculator()
{
if( mCalc )
if ( mCalc )
return;

// Use planimetric as default
Expand All @@ -1671,7 +1671,7 @@ void QgsExpression::initGeomCalculator()

void QgsExpression::setGeomCalculator( QgsDistanceArea &calc )
{
if( !mCalc )
if ( !mCalc )
mCalc = new QgsDistanceArea();

// Copy from supplied calculator
Expand Down

0 comments on commit 41f8abb

Please sign in to comment.