diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-03-05 14:21:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-03-05 16:46:57 +0100 |
commit | 9985bfc034f6f8fd3f4f745b576a56dbcacae927 (patch) | |
tree | 4bcc21585500ed835b32c689c0fe135a36585791 /sw/source/uibase | |
parent | f3a9d2cf5ad6386e4a4479cad91709ee394528b7 (diff) |
crash after master document navigator update
master document navigator will otherwise crash on using update
selection/all/etc if there is no tooltip requested (which does a "hard" update)
before user uses the up/down buttons to move the areas around
Change-Id: I913df2d0922fbabdf3409a25c30b4cce6113dc8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90016
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index a48db512fea8..5192f7f0e5c5 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -791,6 +791,8 @@ IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu, bool) void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { + bool bUpdateHard = false; + SvTreeListEntry* pEntry = FirstSelected(); SwGlblDocContent* pCont = pEntry ? static_cast<SwGlblDocContent*>(pEntry->GetUserData()) : nullptr; // If a RequestHelp is called during the dialogue, @@ -826,12 +828,13 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) m_pActiveShell->UpdateTableOf(*pContent->GetTOX()); pSelEntry = NextSelected(pSelEntry); } - + bUpdateHard = true; } break; case CTX_UPDATE_INDEX: { nSlot = FN_UPDATE_TOX; + bUpdateHard = true; } break; case CTX_UPDATE_LINK: @@ -841,6 +844,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) if(CTX_UPDATE_ALL == nSelectedPopupEntry) nSlot = FN_UPDATE_TOX; pCont = nullptr; + bUpdateHard = true; } break; case CTX_EDIT: @@ -1012,7 +1016,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) GotoContent(pCont); if(nSlot) rDispatch.Execute(nSlot); - if(Update( false )) + if (Update(bUpdateHard)) Display(); } @@ -1096,7 +1100,7 @@ bool SwGlobalTree::Update(bool bHard) { SwView* pActView = GetParentWindow()->GetCreateView(); bool bRet = false; - if(pActView && pActView->GetWrtShellPtr()) + if (pActView && pActView->GetWrtShellPtr()) { const SwWrtShell* pOldShell = m_pActiveShell; m_pActiveShell = pActView->GetWrtShellPtr(); @@ -1151,7 +1155,6 @@ bool SwGlobalTree::Update(bool bHard) *m_pSwGlblDocContents = std::move( *pTempContents ); } } - } else { |