diff --git a/src/app/labeling/qgsmaptoollabel.cpp b/src/app/labeling/qgsmaptoollabel.cpp index 0a5b19b2a59..4a007dc6a8a 100644 --- a/src/app/labeling/qgsmaptoollabel.cpp +++ b/src/app/labeling/qgsmaptoollabel.cpp @@ -884,9 +884,9 @@ bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsPalIndexe { index = vlayer->fields().lookupField( prop.field() ); } - else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || overwriteExpression ) + else { - index = QgsAuxiliaryLayer::createProperty( p, vlayer ); + index = QgsAuxiliaryLayer::createProperty( p, vlayer, overwriteExpression ); changed = true; } @@ -935,9 +935,9 @@ bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsDiagramIn { index = vlayer->fields().lookupField( prop.field() ); } - else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || overwriteExpression ) + else { - index = QgsAuxiliaryLayer::createProperty( p, vlayer ); + index = QgsAuxiliaryLayer::createProperty( p, vlayer, overwriteExpression ); changed = true; } @@ -985,12 +985,11 @@ bool QgsMapToolLabel::createAuxiliaryFields( QgsCalloutPosition &details, QgsCal { index = vlayer->fields().lookupField( prop.field() ); } - else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || overwriteExpression ) + else { - index = QgsAuxiliaryLayer::createProperty( p, vlayer ); + index = QgsAuxiliaryLayer::createProperty( p, vlayer, overwriteExpression ); changed = true; } - calloutIndexes[p] = index; } if ( changed ) diff --git a/src/app/labeling/qgsmaptoolmovelabel.cpp b/src/app/labeling/qgsmaptoolmovelabel.cpp index 9861f4b77c5..1e143c116aa 100644 --- a/src/app/labeling/qgsmaptoolmovelabel.cpp +++ b/src/app/labeling/qgsmaptoolmovelabel.cpp @@ -111,7 +111,7 @@ void QgsMapToolMoveLabel::cadCanvasPressEvent( QgsMapMouseEvent *e ) { QgsCalloutIndexes indexes; - if ( createAuxiliaryFields( calloutPosition, indexes ) ) + if ( createAuxiliaryFields( calloutPosition, indexes, false ) ) return; if ( !canModifyCallout( calloutPosition, mCurrentCalloutMoveOrigin, xCol, yCol ) ) @@ -188,7 +188,7 @@ void QgsMapToolMoveLabel::cadCanvasPressEvent( QgsMapMouseEvent *e ) { QgsPalIndexes indexes; - if ( createAuxiliaryFields( indexes ) ) + if ( createAuxiliaryFields( indexes, false ) ) return; if ( !labelMoveable( vlayer, mCurrentLabel.settings, xCol, yCol ) ) @@ -211,7 +211,7 @@ void QgsMapToolMoveLabel::cadCanvasPressEvent( QgsMapMouseEvent *e ) { QgsDiagramIndexes indexes; - if ( createAuxiliaryFields( indexes ) ) + if ( createAuxiliaryFields( indexes, false ) ) return; if ( !diagramMoveable( vlayer, xCol, yCol ) ) diff --git a/src/app/labeling/qgsmaptoolrotatelabel.cpp b/src/app/labeling/qgsmaptoolrotatelabel.cpp index 370e225d221..53c6d99062a 100644 --- a/src/app/labeling/qgsmaptoolrotatelabel.cpp +++ b/src/app/labeling/qgsmaptoolrotatelabel.cpp @@ -117,7 +117,7 @@ void QgsMapToolRotateLabel::canvasPressEvent( QgsMapMouseEvent *e ) if ( !labelIsRotatable( mCurrentLabel.layer, mCurrentLabel.settings, rotationCol ) ) { QgsPalIndexes indexes; - if ( createAuxiliaryFields( indexes ) ) + if ( createAuxiliaryFields( indexes, false ) ) return; if ( !labelIsRotatable( mCurrentLabel.layer, mCurrentLabel.settings, rotationCol ) ) diff --git a/src/app/labeling/qgsmaptoolshowhidelabels.cpp b/src/app/labeling/qgsmaptoolshowhidelabels.cpp index dba9a5e8cb1..b641b9e323d 100644 --- a/src/app/labeling/qgsmaptoolshowhidelabels.cpp +++ b/src/app/labeling/qgsmaptoolshowhidelabels.cpp @@ -331,7 +331,7 @@ bool QgsMapToolShowHideLabels::showHide( const QgsLabelPosition &pos, bool show if ( !diagramCanShowHide( vlayer, showCol ) ) { QgsDiagramIndexes indexes; - createAuxiliaryFields( details, indexes ); + createAuxiliaryFields( details, indexes, false ); showCol = indexes[ QgsDiagramLayerSettings::Show ]; } @@ -341,7 +341,7 @@ bool QgsMapToolShowHideLabels::showHide( const QgsLabelPosition &pos, bool show if ( !labelCanShowHide( vlayer, showCol ) ) { QgsPalIndexes indexes; - createAuxiliaryFields( details, indexes ); + createAuxiliaryFields( details, indexes, false ); showCol = indexes[ QgsPalLayerSettings::Show ]; }