summaryrefslogtreecommitdiff
path: root/sd/source/ui/annotations
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-06-16 21:27:34 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-06-17 09:40:03 +0200
commit5ab48fd9b1a65579b2a63077cd3d2192b57af2a5 (patch)
tree4330529b3b6443b4d9821919fa75eaba21742c56 /sd/source/ui/annotations
parent25bd91293cd3ac7bf24f491e8eab254aa78d9fcb (diff)
fix crash in "delete comments by author" in impress
insert comment, click on it to expand it, click on menubutton and use "delete all comments by..." crash on use of invalid iterator as callback trashes the vector being iterated over Change-Id: Ia86de87207f706f35a023efa433c5e67b8bb436a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168970 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd/source/ui/annotations')
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index c4d10f78f00b..296a6f5a3ac2 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -697,7 +697,8 @@ void AnnotationManagerImpl::DeleteAnnotationsByAuthor( std::u16string_view sAuth
if( pPage )
{
- for (auto const& xAnnotation : pPage->getAnnotations())
+ std::vector<rtl::Reference<sdr::annotation::Annotation>> aAnnotations(pPage->getAnnotations()); // intentionally copy
+ for (auto const& xAnnotation : aAnnotations)
{
if( xAnnotation->getAuthor() == sAuthor )
{