sw/source/uibase/docvw/AnnotationWin2.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 180ee81404522237c66a872cd0be718e79e00bfc
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Dec 9 17:19:57 2021 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Dec 10 12:12:28 2021 +0100

    Resolves: tdf#146141 don't double delete comments
    
    which can happen because empty comments are deleted automatically
    on losing focus back to main document, so explicit delete of an
    empty comment resulted in a double delete
    
    Change-Id: I30390995a260235ed8702b0a088c05e91c953b3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126590
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 606945672144..70460686d03d 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1043,7 +1043,7 @@ void SwAnnotationWin::DeactivatePostIt()
     if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
         GetOutlinerView()->SetBackgroundColor(COL_TRANSPARENT);
 
-    if ( !IsProtected() && mpOutliner->GetEditEngine().GetText().isEmpty() )
+    if (!mnEventId && !IsProtected() && 
mpOutliner->GetEditEngine().GetText().isEmpty())
     {
         mnEventId = Application::PostUserEvent( LINK( this, SwAnnotationWin, 
DeleteHdl), nullptr, true );
     }

Reply via email to