Skip to content

Commit

Permalink
Only write labelsEnabled attribute when labels are enabled
Browse files Browse the repository at this point in the history
Keeps XML minimized when not required
  • Loading branch information
nyalldawson committed Dec 6, 2024
1 parent 0f1cdfc commit f271cbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2469,7 +2469,8 @@ bool QgsRasterLayer::writeSymbology( QDomNode &layer_node, QDomDocument &documen
QDomElement labelingElement = mLabeling->save( document, context );
layerElement.appendChild( labelingElement );
}
layerElement.setAttribute( QStringLiteral( "labelsEnabled" ), mLabelsEnabled ? QStringLiteral( "1" ) : QStringLiteral( "0" ) );
if ( mLabelsEnabled )
layerElement.setAttribute( QStringLiteral( "labelsEnabled" ), QStringLiteral( "1" ) );
}

// save map tip
Expand Down

0 comments on commit f271cbb

Please sign in to comment.