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 18, 2024
1 parent 8d0aa9f commit 30867e3
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 @@ -2468,7 +2468,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 30867e3

Please sign in to comment.