[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 5 15:47:31 UTC 2020


 sw/source/uibase/utlui/glbltree.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 9985bfc034f6f8fd3f4f745b576a56dbcacae927
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Mar 5 14:21:43 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Mar 5 16:46:57 2020 +0100

    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 at redhat.com>

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
     {


More information about the Libreoffice-commits mailing list