Skip to content

Commit

Permalink
Fix a crash when toggling a layer to editable mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jun 8, 2017
1 parent c340e37 commit bdd8168
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsmaptoollabel.cpp
Expand Up @@ -469,7 +469,7 @@ bool QgsMapToolLabel::currentLabelDataDefinedPosition( double &x, bool &xSuccess


bool QgsMapToolLabel::layerIsRotatable( QgsVectorLayer *vlayer, int &rotationCol ) const bool QgsMapToolLabel::layerIsRotatable( QgsVectorLayer *vlayer, int &rotationCol ) const
{ {
if ( !vlayer || !vlayer->isEditable() ) if ( !vlayer || !vlayer->isEditable() || !vlayer->labeling() )
{ {
return false; return false;
} }
Expand Down Expand Up @@ -590,7 +590,7 @@ bool QgsMapToolLabel::diagramMoveable( QgsVectorLayer *vlayer, int &xCol, int &y


bool QgsMapToolLabel::labelMoveable( QgsVectorLayer *vlayer, int &xCol, int &yCol ) const bool QgsMapToolLabel::labelMoveable( QgsVectorLayer *vlayer, int &xCol, int &yCol ) const
{ {
if ( !vlayer || !vlayer->isEditable() ) if ( !vlayer || !vlayer->isEditable() || !vlayer->labeling() )
{ {
return false; return false;
} }
Expand Down Expand Up @@ -623,7 +623,7 @@ bool QgsMapToolLabel::layerCanPin( QgsVectorLayer *vlayer, int &xCol, int &yCol


bool QgsMapToolLabel::labelCanShowHide( QgsVectorLayer *vlayer, int &showCol ) const bool QgsMapToolLabel::labelCanShowHide( QgsVectorLayer *vlayer, int &showCol ) const
{ {
if ( !vlayer || !vlayer->isEditable() ) if ( !vlayer || !vlayer->isEditable() || !vlayer->labeling() )
{ {
return false; return false;
} }
Expand Down

0 comments on commit bdd8168

Please sign in to comment.