Skip to content

Commit bdd8168

Browse files
committedJun 8, 2017
Fix a crash when toggling a layer to editable mode
1 parent c340e37 commit bdd8168

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/app/qgsmaptoollabel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ bool QgsMapToolLabel::currentLabelDataDefinedPosition( double &x, bool &xSuccess
469469

470470
bool QgsMapToolLabel::layerIsRotatable( QgsVectorLayer *vlayer, int &rotationCol ) const
471471
{
472-
if ( !vlayer || !vlayer->isEditable() )
472+
if ( !vlayer || !vlayer->isEditable() || !vlayer->labeling() )
473473
{
474474
return false;
475475
}
@@ -590,7 +590,7 @@ bool QgsMapToolLabel::diagramMoveable( QgsVectorLayer *vlayer, int &xCol, int &y
590590

591591
bool QgsMapToolLabel::labelMoveable( QgsVectorLayer *vlayer, int &xCol, int &yCol ) const
592592
{
593-
if ( !vlayer || !vlayer->isEditable() )
593+
if ( !vlayer || !vlayer->isEditable() || !vlayer->labeling() )
594594
{
595595
return false;
596596
}
@@ -623,7 +623,7 @@ bool QgsMapToolLabel::layerCanPin( QgsVectorLayer *vlayer, int &xCol, int &yCol
623623

624624
bool QgsMapToolLabel::labelCanShowHide( QgsVectorLayer *vlayer, int &showCol ) const
625625
{
626-
if ( !vlayer || !vlayer->isEditable() )
626+
if ( !vlayer || !vlayer->isEditable() || !vlayer->labeling() )
627627
{
628628
return false;
629629
}

0 commit comments

Comments
 (0)
Please sign in to comment.