sd/source/ui/annotations/annotationmanager.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8391fec92f1ce53afde397dbfddfbd5832ed7f5b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Jun 16 21:27:34 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Jun 17 14:28:37 2024 +0200

    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.mcnam...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168935

diff --git a/sd/source/ui/annotations/annotationmanager.cxx 
b/sd/source/ui/annotations/annotationmanager.cxx
index 1446756d339a..22fb7eca3586 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -665,7 +665,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 )
                 {

Reply via email to