Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 28, 2021
1 parent 1fb21f6 commit 2037ad9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
18 changes: 0 additions & 18 deletions src/app/labeling/qgsmaptoollabel.cpp
Expand Up @@ -598,31 +598,13 @@ bool QgsMapToolLabel::currentLabelDataDefinedPosition( double &x, bool &xSuccess
return true;
}

bool QgsMapToolLabel::layerIsRotatable( QgsVectorLayer *vlayer, int &rotationCol ) const
{
if ( !vlayer || !vlayer->isEditable() || !vlayer->labelsEnabled() )
{
return false;
}

const auto constSubProviders = vlayer->labeling()->subProviders();
for ( const QString &providerId : constSubProviders )
{
if ( labelIsRotatable( vlayer, vlayer->labeling()->settings( providerId ), rotationCol ) )
return true;
}

return false;
}

bool QgsMapToolLabel::labelIsRotatable( QgsVectorLayer *layer, const QgsPalLayerSettings &settings, int &rotationCol ) const
{
QString rColName = dataDefinedColumnName( QgsPalLayerSettings::LabelRotation, settings, layer );
rotationCol = layer->fields().lookupField( rColName );
return rotationCol != -1;
}


bool QgsMapToolLabel::currentLabelDataDefinedRotation( double &rotation, bool &rotationSuccess, int &rCol, bool ignoreXY ) const
{
QgsVectorLayer *vlayer = mCurrentLabel.layer;
Expand Down
1 change: 0 additions & 1 deletion src/app/labeling/qgsmaptoollabel.h
Expand Up @@ -87,7 +87,6 @@ class APP_EXPORT QgsMapToolLabel: public QgsMapToolAdvancedDigitizing
* Checks if labels in a layer can be rotated
* \param rotationCol out: attribute column for data defined label rotation
*/
bool layerIsRotatable( QgsVectorLayer *layer, int &rotationCol ) const;
bool labelIsRotatable( QgsVectorLayer *layer, const QgsPalLayerSettings &settings, int &rotationCol ) const;

protected:
Expand Down

0 comments on commit 2037ad9

Please sign in to comment.