Skip to content

Commit ee2992f

Browse files
CodeBardiannyalldawson
authored andcommittedJan 3, 2023
read and write common properties on annotation layers
1 parent 6f975a7 commit ee2992f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎src/core/annotations/qgsannotationlayer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,13 @@ bool QgsAnnotationLayer::writeXml( QDomNode &layer_node, QDomDocument &doc, cons
440440
return writeSymbology( layer_node, doc, errorMsg, context );
441441
}
442442

443-
bool QgsAnnotationLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QString &, const QgsReadWriteContext &, QgsMapLayer::StyleCategories categories ) const
443+
bool QgsAnnotationLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QString &, const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories ) const
444444
{
445445
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
446446

447+
QDomElement layerElement = node.toElement();
448+
writeCommonStyle( layerElement, doc, context, categories );
449+
447450
// add the layer opacity
448451
if ( categories.testFlag( Rendering ) )
449452
{
@@ -470,10 +473,13 @@ bool QgsAnnotationLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QStr
470473
return true;
471474
}
472475

473-
bool QgsAnnotationLayer::readSymbology( const QDomNode &node, QString &, QgsReadWriteContext &, QgsMapLayer::StyleCategories categories )
476+
bool QgsAnnotationLayer::readSymbology( const QDomNode &node, QString &, QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories )
474477
{
475478
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
476479

480+
const QDomElement layerElement = node.toElement();
481+
readCommonStyle( layerElement, context, categories );
482+
477483
if ( categories.testFlag( Rendering ) )
478484
{
479485
const QDomNode layerOpacityNode = node.namedItem( QStringLiteral( "layerOpacity" ) );

0 commit comments

Comments
 (0)
Please sign in to comment.