diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-24 20:27:48 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-03-18 15:17:31 +0100 |
commit | a291c5a4912c09fe1e774b8dae104de65a21acb6 (patch) | |
tree | b4c0afa8763bde80efda7974ec95b6f605fe8ea3 | |
parent | f8870c8a053ea021a4ad8598851a120b02620bb5 (diff) |
tdf#145842 canceling remote file delete makes file disappear from treeviewcib-6.4-6
we remove the selected entries from the treeview, so the user cancel's
the deletion of an entry we should unselect it from the candidates to
remove.
and...
Related: tdf#145842 fix a crash after deleting an entry
delete an entry in remote files dialog and go one level up and crash,
ownership of the SvtContentEntry is not with the entry, but belongs
to mpImpl->maEntries
Change-Id: Ieb2258960fc647ad15d8f315a18454a0dae8a420
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125793
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
(cherry picked from commit 9d13202243b26d507b61eb4a787d1df2ce037e21)
-rw-r--r-- | fpicker/source/office/fileview.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fpicker/source/office/fileview.cxx b/fpicker/source/office/fileview.cxx index 5b65eb1295cf..64dee0ee6239 100644 --- a/fpicker/source/office/fileview.cxx +++ b/fpicker/source/office/fileview.cxx @@ -636,16 +636,20 @@ void ViewTabListBox_Impl::DeleteEntries() eResult = aDlg.run(); } - if ( ( eResult == svtools::QUERYDELETE_ALL ) || - ( eResult == svtools::QUERYDELETE_YES ) ) + bool bDeleted = false; + + if (eResult == svtools::QUERYDELETE_ALL || eResult == svtools::QUERYDELETE_YES) { if ( Kill( aURL ) ) { - delete reinterpret_cast<SvtContentEntry*>(mxTreeView->get_id(rCurEntry).toInt64()); mpParent->EntryRemoved( aURL ); + bDeleted = true; } } + if (!bDeleted) + mxTreeView->unselect(rCurEntry); + return false; }); |