ObjectList: Delete last volume from the object even if this volume is text

This commit is contained in:
YuSanka 2022-11-29 12:59:05 +01:00
parent 9a682a10cb
commit 9323e347f0

View File

@ -772,11 +772,7 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
// get index of the last VolumeItem in CildrenList // get index of the last VolumeItem in CildrenList
size_t vol_idx = GetItemIndexForFirstVolume(node_parent); size_t vol_idx = GetItemIndexForFirstVolume(node_parent);
ObjectDataViewModelNode *last_child_node = node_parent->GetNthChild(vol_idx); ObjectDataViewModelNode *last_child_node = node_parent->GetNthChild(vol_idx);
// if last volume is text then don't delete it
if (last_child_node->is_text_volume())
return parent;
// delete this last volume // delete this last volume
DeleteSettings(wxDataViewItem(last_child_node)); DeleteSettings(wxDataViewItem(last_child_node));