summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-24 20:27:48 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-25 12:07:51 +0100
commit9d13202243b26d507b61eb4a787d1df2ce037e21 (patch)
tree0ce4209620458d2ef9b5dee94e860d6f2fb1da64 /fpicker
parentb23a16ff513369b6bf1f534a387d911b6336c9c8 (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
Diffstat (limited to 'fpicker')
-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 d8e8ce6f7d72..d3b5237384f4 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;
});