Navigation Menu

Skip to content

Commit

Permalink
Fix new method segnatures
Browse files Browse the repository at this point in the history
  • Loading branch information
alisovenko committed Jan 9, 2017
1 parent eb1ab18 commit 3c84229
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/core/geometry/qgsgeometry.cpp
Expand Up @@ -508,7 +508,7 @@ bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
return d->geometry->insertVertex( id, QgsPointV2( x, y ) );
}

bool QgsGeometry::insertVertex( QgsPointV2& p, int beforeVertex )
bool QgsGeometry::insertVertex( const QgsPointV2& point, int beforeVertex )
{
if ( !d->geometry )
{
Expand All @@ -520,7 +520,7 @@ bool QgsGeometry::insertVertex( QgsPointV2& p, int beforeVertex )
{
detach( true );
//insert geometry instead of point
return static_cast< QgsGeometryCollection* >( d->geometry )->insertGeometry( new QgsPointV2( p ), beforeVertex );
return static_cast< QgsGeometryCollection* >( d->geometry )->insertGeometry( new QgsPointV2( point ), beforeVertex );
}

QgsVertexId id;
Expand All @@ -531,7 +531,7 @@ bool QgsGeometry::insertVertex( QgsPointV2& p, int beforeVertex )

detach( true );

return d->geometry->insertVertex( id, p );
return d->geometry->insertVertex( id, point );
}

QgsPoint QgsGeometry::vertexAt( int atVertex ) const
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeometry.h
Expand Up @@ -279,7 +279,7 @@ class CORE_EXPORT QgsGeometry
* these error conditions. (Or maybe we add another method to this
* object to help make the distinction?)
*/
bool insertVertex( QgsPointV2& p, int beforeVertex );
bool insertVertex( const QgsPointV2& point, int beforeVertex );

/** Moves the vertex at the given position number
* and item (first number is index 0)
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -1023,13 +1023,13 @@ bool QgsVectorLayer::insertVertex( double x, double y, QgsFeatureId atFeatureId,
}


bool QgsVectorLayer::insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex )
bool QgsVectorLayer::insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex )
{
if ( !mValid || !mEditBuffer || !mDataProvider )
return false;

QgsVectorLayerEditUtils utils( this );
bool result = utils.insertVertex( p, atFeatureId, beforeVertex );
bool result = utils.insertVertex( point, atFeatureId, beforeVertex );
if ( result )
updateExtents();
return result;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Expand Up @@ -943,7 +943,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
*/
bool insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex );
bool insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex );

/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayereditutils.cpp
Expand Up @@ -56,7 +56,7 @@ bool QgsVectorLayerEditUtils::insertVertex( double x, double y, QgsFeatureId atF
return true;
}

bool QgsVectorLayerEditUtils::insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex )
bool QgsVectorLayerEditUtils::insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex )
{
if ( !L->hasGeometryType() )
return false;
Expand All @@ -72,7 +72,7 @@ bool QgsVectorLayerEditUtils::insertVertex( QgsPointV2& p, QgsFeatureId atFeatur
geometry = f.geometry();
}

geometry.insertVertex( p, beforeVertex );
geometry.insertVertex( point, beforeVertex );

L->editBuffer()->changeGeometry( atFeatureId, geometry );
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayereditutils.h
Expand Up @@ -45,7 +45,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
*/
bool insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex );
bool insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex );

/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaptooledit.cpp
Expand Up @@ -34,7 +34,7 @@ QgsMapToolEdit::~QgsMapToolEdit()
}


double QgsMapToolEdit::defaultZValue()
double QgsMapToolEdit::defaultZValue() const
{
QSettings().value( QStringLiteral( "/qgis/digitizing/default_z_value" ), Qgis::DEFAULT_Z_COORDINATE ).toDouble();
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaptooledit.h
Expand Up @@ -41,7 +41,7 @@ class GUI_EXPORT QgsMapToolEdit: public QgsMapTool
* Return default Z value
* Use for set Z coordinate to new vertex for 2.5d geometries
*/
double defaultZValue();
double defaultZValue() const;

protected:

Expand Down

0 comments on commit 3c84229

Please sign in to comment.