From 03f86366cd8b0764377f84f0c6c1dd241bb79294 Mon Sep 17 00:00:00 2001 From: Giuseppe Sucameli Date: Wed, 14 Mar 2012 00:54:36 +0100 Subject: [PATCH] convert $currfield (was %%) running actions from "Identify actions" tool --- src/core/qgsattributeaction.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/qgsattributeaction.cpp b/src/core/qgsattributeaction.cpp index f934d1c41a9..b5a8fe5b5c6 100644 --- a/src/core/qgsattributeaction.cpp +++ b/src/core/qgsattributeaction.cpp @@ -77,7 +77,10 @@ void QgsAttributeAction::doAction( int index, QgsFeature &feat, int defaultValue { QMap substitutionMap; if ( defaultValueIndex >= 0 ) - substitutionMap.insert( "$currfield", QVariant( defaultValueIndex ) ); + { + if ( feat.attributeMap().contains( defaultValueIndex ) ) + substitutionMap.insert( "$currfield", feat.attributeMap()[ defaultValueIndex ] ); + } doAction( index, feat, &substitutionMap ); }