Skip to content

Commit d91acd6

Browse files
CodeBardiannyalldawson
authored andcommittedJan 10, 2023
fix: don't keep reference of styling history on annotation layer reset
the layer styling panel always showed history of the main annotation layer of a previously opened project
1 parent 3500e06 commit d91acd6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎src/core/annotations/qgsannotationlayer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ void QgsAnnotationLayer::reset()
131131
setOpacity( 1.0 );
132132
setCrs( QgsCoordinateReferenceSystem() );
133133
setTransformContext( QgsCoordinateTransformContext() );
134+
135+
undoStackStyles()->clear();
136+
134137
clear();
135138
}
136139

‎tests/src/python/test_qgsannotationlayer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def testReset(self):
152152
self.assertEqual(len(layer.items()), 0)
153153
self.assertEqual(layer.opacity(), 1.0)
154154
self.assertFalse(layer.crs().isValid())
155+
self.assertEqual(layer.undoStackStyles().count(), 0)
155156

156157
def testExtent(self):
157158
layer = QgsAnnotationLayer('test', QgsAnnotationLayer.LayerOptions(QgsProject.instance().transformContext()))

0 commit comments

Comments
 (0)
Please sign in to comment.