summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-24 20:27:48 +0000
committerAron Budea <aron.budea@collabora.com>2022-08-10 23:07:31 +0200
commit04427af8479c33025a52abe99e05334e573b6158 (patch)
tree693993d027e87ec09b4188a807232dc11573444b
parent6f547d3a6c32ffbafd495752f8e71cdc52ac9e7b (diff)
tdf#145842 canceling remote file delete makes file disappear from treeview
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.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/fpicker/source/office/fileview.cxx b/fpicker/source/office/fileview.cxx
index ad82be6c0463..6690c64a7cef 100644
--- a/fpicker/source/office/fileview.cxx
+++ b/fpicker/source/office/fileview.cxx
@@ -642,16 +642,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;
});