Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
domi4484 and nyalldawson committed Jan 10, 2022
1 parent 4f3e705 commit 21b65e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/labeling/qgsmaptoollabel.cpp
Expand Up @@ -675,7 +675,7 @@ bool QgsMapToolLabel::currentLabelDataDefinedPosition( double &x, bool &xSuccess
if ( pointAsVariant.canConvert<QgsGeometry>() )
{
const QgsGeometry geometry = pointAsVariant.value<QgsGeometry>();
if ( const QgsPoint *point = ( geometry.constGet() ? qgsgeometry_cast<QgsPoint *>( geometry.constGet()->simplifiedTypeRef() ) : nullptr ) )
if ( const QgsPoint *point = ( geometry.constGet() ? qgsgeometry_cast<const QgsPoint *>( geometry.constGet()->simplifiedTypeRef() ) : nullptr ) )
{
x = point->x();
y = point->y();
Expand Down Expand Up @@ -880,7 +880,7 @@ bool QgsMapToolLabel::labelMoveable( QgsVectorLayer *vlayer, const QgsPalLayerSe
{
QString pointColName = dataDefinedColumnName( QgsPalLayerSettings::PositionPoint, settings, vlayer );
pointCol = vlayer->fields().lookupField( pointColName );
if ( pointCol > 0 )
if ( pointCol >= 0 )
return true;
}

Expand All @@ -891,7 +891,7 @@ bool QgsMapToolLabel::labelMoveable( QgsVectorLayer *vlayer, const QgsPalLayerSe
QString yColName = dataDefinedColumnName( QgsPalLayerSettings::PositionY, settings, vlayer );
xCol = vlayer->fields().lookupField( xColName );
yCol = vlayer->fields().lookupField( yColName );
if ( xCol > 0 || yCol > 0 )
if ( xCol >= 0 || yCol >= 0 )
return true;
}

Expand Down

0 comments on commit 21b65e0

Please sign in to comment.