Skip to content

Commit

Permalink
Show preview for "$area" in expr builder, make preview consistent wit…
Browse files Browse the repository at this point in the history
…h result

Another partial fix for #9060
  • Loading branch information
wonder-sk committed Feb 20, 2014
1 parent 4d74ad7 commit d92a0e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/qgsfieldcalculator.cpp
Expand Up @@ -43,6 +43,12 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer* vl )

connect( builder, SIGNAL( expressionParsed( bool ) ), this, SLOT( setOkButtonState() ) );

QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs().srsid() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() );
myDa.setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );
builder->setGeomCalculator( myDa );

//default values for field width and precision
mOutputFieldWidthSpinBox->setValue( 10 );
mOutputFieldPrecisionSpinBox->setValue( 3 );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -317,7 +317,7 @@ void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged()

if ( !mFeature.isValid() )
{
mLayer->getFeatures( QgsFeatureRequest().setFlags(( mLayer->geometryType() != QGis::NoGeometry && exp.needsGeometry() ) ? QgsFeatureRequest::NoFlags : QgsFeatureRequest::NoGeometry ) ).nextFeature( mFeature );
mLayer->getFeatures().nextFeature( mFeature );
}

if ( mFeature.isValid() )
Expand Down

0 comments on commit d92a0e6

Please sign in to comment.