vcl/source/treelist/treelistbox.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 775a205a334659c124c02272edd81a01af69cf47
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed May 27 12:55:25 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu May 28 15:21:44 2020 +0200

    Resolves: tdf#133385 dangling pTargetEntry after remove or clear
    
    Change-Id: Id04b08ea5af1341d548f7bb1e3c3c7f5b7197548
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94955
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/treelist/treelistbox.cxx 
b/vcl/source/treelist/treelistbox.cxx
index d8bc727766b6..bb52e28fe0d4 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -1977,6 +1977,7 @@ void SvTreeListBox::LoseFocus()
 void SvTreeListBox::ModelHasCleared()
 {
     pImpl->m_pCursor = nullptr; // else we crash in GetFocus when editing 
in-place
+    pTargetEntry = nullptr;
     pEdCtrl.reset();
     pImpl->Clear();
     nFocusWidth = -1;
@@ -2250,8 +2251,12 @@ void SvTreeListBox::ModelIsRemoving( SvTreeListEntry* 
pEntry )
 
 void SvTreeListBox::ModelHasRemoved( SvTreeListEntry* pEntry  )
 {
-    if ( pEntry == pHdlEntry)
+    if (pEntry == pHdlEntry)
         pHdlEntry = nullptr;
+
+    if (pEntry == pTargetEntry)
+        pTargetEntry = nullptr;
+
     pImpl->EntryRemoved();
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to