Skip to content
Permalink
Browse files
Apply suggestions from code review
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
domi4484 and nyalldawson committed Jan 10, 2022
1 parent b37f066 commit 34fd68fd58d867d4b3ce81ada9a44e2c9a4ffc2b
Showing with 11 additions and 10 deletions.
  1. +10 −9 src/app/labeling/qgsmaptoollabel.cpp
  2. +1 −1 src/core/labeling/qgspallabeling.h
@@ -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() )
{
@@ -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;
@@ -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;
@@ -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)

0 comments on commit 34fd68f

Please sign in to comment.