diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-03-05 14:21:43 +0000 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-03-10 11:29:19 +0100 |
commit | 20dee53e0c2535d1a75e9a32fec49c0fcb79ac54 (patch) | |
tree | cbab8b5f2dc64816a8cf69669a0b265f95415860 /sw | |
parent | 358d34e12d8f88543ddca8c0e852712e6ef1b10c (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/+/90028
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-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 2b056fca6ffe..d2c5357e6f01 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -793,6 +793,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, @@ -828,12 +830,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: @@ -843,6 +846,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) if(CTX_UPDATE_ALL == nSelectedPopupEntry) nSlot = FN_UPDATE_TOX; pCont = nullptr; + bUpdateHard = true; } break; case CTX_EDIT: @@ -1014,7 +1018,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) GotoContent(pCont); if(nSlot) rDispatch.Execute(nSlot); - if(Update( false )) + if (Update(bUpdateHard)) Display(); } @@ -1098,7 +1102,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(); @@ -1153,7 +1157,6 @@ bool SwGlobalTree::Update(bool bHard) *m_pSwGlblDocContents = std::move( *pTempContents ); } } - } else { |