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 b37f066 commit 34fd68f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions src/app/labeling/qgsmaptoollabel.cpp
Expand Up @@ -720,14 +720,15 @@ bool QgsMapToolLabel::currentLabelDataDefinedPosition( double &x, bool &xSuccess
QVariant pointAsVariant = attributes.at( pointCol );
if ( pointAsVariant.canConvert<QgsGeometry>() )
{
QgsGeometry geometryPoint = pointAsVariant.value<QgsGeometry>();
const QgsPoint *point = qgsgeometry_cast<QgsPoint *>( geometryPoint.constGet() );
const QgsGeometry geometry = pointAsVariant.value<QgsGeometry>();
if ( const QgsPoint *point = ( geometry.constGet() ? qgsgeometry_cast<QgsPoint *>( geometry.constGet()->simplifiedTypeRef() ) : nullptr ) )
{
x = point->x();
y = point->y();

x = point->x();
y = point->y();

xSuccess = true;
ySuccess = true;
xSuccess = true;
ySuccess = true;
}
}
else if ( !pointAsVariant.toByteArray().isEmpty() )
{
Expand Down Expand Up @@ -1121,7 +1122,7 @@ bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsDiagramIn
{
index = vlayer->fields().lookupField( prop.field() );
}
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty )
else
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer, false );
changed = true;
Expand Down Expand Up @@ -1171,7 +1172,7 @@ bool QgsMapToolLabel::createAuxiliaryFields( QgsCalloutPosition &details, QgsCal
{
index = vlayer->fields().lookupField( prop.field() );
}
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty )
else
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer, false );
changed = true;
Expand Down
2 changes: 1 addition & 1 deletion src/core/labeling/qgspallabeling.h
Expand Up @@ -321,7 +321,7 @@ class CORE_EXPORT QgsPalLayerSettings
// (data defined only)
PositionX = 9, //!< X-coordinate data defined label position
PositionY = 10, //!< Y-coordinate data defined label position
PositionPoint = 79, //!< Point-coordinate data defined label position
PositionPoint = 114, //!< Point-coordinate data defined label position
Hali = 11, //!< Horizontal alignment for data defined label position (Left, Center, Right)
Vali = 12, //!< Vertical alignment for data defined label position (Bottom, Base, Half, Cap, Top)
Rotation = 14, //!< Label rotation (deprecated, for old project compatibility only)
Expand Down

0 comments on commit 34fd68f

Please sign in to comment.