[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed May 27 15:42:35 UTC 2020


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

New commits:
commit c0851e6306ed1117130d8667e22cfae8d0ee7e53
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 27 12:55:25 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed May 27 17:41:53 2020 +0200

    Resolves: tdf#133385 dangling pTargetEntry after remove or clear
    
    Change-Id: Id04b08ea5af1341d548f7bb1e3c3c7f5b7197548
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94944
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at 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();
 }
 


More information about the Libreoffice-commits mailing list