diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-18 13:44:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-19 22:43:13 +0100 |
commit | cd6ddba3e15d2e586cd7b8593d5164aabbbd0dcb (patch) | |
tree | a587a74f5697908ae3479c9d197692e1c7c2189d /sfx2 | |
parent | 8169fbbe715daa801fd17dddf0b9b03f71b2217e (diff) |
tdf#138884 Crash when deleting template via context menu
Change-Id: Ia332070d4d49ee697021d543c4eb6cec08994284
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107968
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/templatedlglocalview.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sfx2/source/control/templatedlglocalview.cxx b/sfx2/source/control/templatedlglocalview.cxx index a1419ab5c8d6..0949e684c414 100644 --- a/sfx2/source/control/templatedlglocalview.cxx +++ b/sfx2/source/control/templatedlglocalview.cxx @@ -123,8 +123,12 @@ void TemplateDlgLocalView::ContextMenuSelectHdl(std::string_view rIdent) return; maDeleteTemplateHdl.Call(maSelectedItem); - reload(); + // this remove is probably redundant because reload would throw away + // the old contents anyway. Maybe there is an argument that removing it + // immediately means there is possibility to show it missing while the + // possibly slow reload is operating if a repaint could occur ListView::remove(OUString::number(maSelectedItem->mnId)); + reload(); } else if (rIdent == "default") { |