summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2020-05-24 22:56:28 +0200
committerAndras Timar <andras.timar@collabora.com>2020-05-27 08:44:39 +0200
commita1a39b5444842d092b1931cf42a5303bb7c1bb92 (patch)
tree49428500e9b6c1e5cee32cf8be056f53c5642781
parent344fd7aaa967ae304f60def3ba92b25c4f0334f0 (diff)
tdf#133348 remove from list before calling SetActiveSidebarWin
so GetNextPostIt won't deal with mvPostItFields containing empty unique_ptr See bt here: https://bugs.documentfoundation.org/attachment.cgi?id=161242 Change-Id: I7c9a3e91d5186492cb185f799b60d1dcc5edf7af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94766 (cherry picked from commit b0bbfdf89d6496ffda4dc409ec5f2add8c94fe2a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 73950af7db24..88f917a923ea 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -316,12 +316,14 @@ void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
if (i != mvPostItFields.end())
{
std::unique_ptr<SwSidebarItem> p = std::move(*i);
- if (GetActiveSidebarWin() == p->pPostIt)
- SetActiveSidebarWin(nullptr);
// tdf#120487 remove from list before dispose, so comment window
// won't be recreated due to the entry still in the list if focus
// transferring from the pPostIt triggers relayout of postits
+ // tdf#133348 remove from list before calling SetActiveSidebarWin
+ // so GetNextPostIt won't deal with mvPostItFields containing empty unique_ptr
mvPostItFields.erase(i);
+ if (GetActiveSidebarWin() == p->pPostIt)
+ SetActiveSidebarWin(nullptr);
p->pPostIt.disposeAndClear();
}
mbLayout = true;