summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-03-05 14:21:43 +0000
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-03-11 13:58:50 +0100
commitd4104042dac31fc3f6a99dbe1d7d910a52ebd7bb (patch)
tree70d38aefe9eae7f70765a20e602e3e644cacc885
parent589a9bc9401296a2ff28146b002a31c9d14455f2 (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> (cherry picked from commit 20dee53e0c2535d1a75e9a32fec49c0fcb79ac54) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90268 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx11
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
{