Skip to content
Permalink
Browse files

Avoid detach of temporary

  • Loading branch information
nyalldawson committed Aug 29, 2017
1 parent 5247478 commit 2b14c46255e4dadaef584f915caf86c2eb724451
@@ -98,7 +98,7 @@ int QgsGridFileWriter::writeFile( QgsFeedback *feedback )

// create prj file
QgsInterpolator::LayerData ld;
ld = mInterpolator->layerData().first();
ld = mInterpolator->layerData().at( 0 );
QgsVectorLayer *vl = ld.vectorLayer;
QString crs = vl->crs().toWkt();
QFileInfo fi( mOutputFilePath );
@@ -68,7 +68,8 @@ void QgsMapToolAddPart::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
}

bool isGeometryEmpty = false;
if ( vlayer->selectedFeatures()[0].geometry().isNull() )
QgsFeatureList selectedFeatures = vlayer->selectedFeatures();
if ( !selectedFeatures.isEmpty() && selectedFeatures.at( 0 ).geometry().isNull() )
isGeometryEmpty = true;

if ( !checkSelection() )
@@ -156,7 +156,8 @@ void QgsMeasureDialog::mouseMove( const QgsPointXY &point )
}
else if ( !mMeasureArea && mTool->points().size() >= 1 )
{
QgsPointXY p1( mTool->points().last() ), p2( point );
QList< QgsPointXY > tmpPoints = mTool->points();
QgsPointXY p1( tmpPoints.at( tmpPoints.size() - 1 ) ), p2( point );
double d = mDa.measureLine( p1, p2 );

editTotal->setText( formatDistance( mTotal + d ) );
@@ -224,7 +225,8 @@ void QgsMeasureDialog::removeLastPoint()
if ( !mTool->done() )
{
// need to add the distance for the temporary mouse cursor point
QgsPointXY p1( mTool->points().last() );
QList< QgsPointXY > tmpPoints = mTool->points();
QgsPointXY p1( tmpPoints.at( tmpPoints.size() - 1 ) );
double d = mDa.measureLine( p1, mLastMousePoint );

d = convertLength( d, mDistanceUnits );
@@ -481,7 +483,8 @@ void QgsMeasureDialog::updateUi()

QgsPointXY p1, p2;
mTotal = 0;
for ( it = mTool->points().constBegin(); it != mTool->points().constEnd(); ++it )
QList< QgsPointXY > tmpPoints = mTool->points();
for ( it = tmpPoints.constBegin(); it != tmpPoints.constEnd(); ++it )
{
p2 = *it;
if ( !b )

0 comments on commit 2b14c46

Please sign in to comment.
You can’t perform that action at this time.