[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sd/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 14 18:16:19 UTC 2020


 sd/source/ui/func/fuolbull.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit fb842a3daf5c6b9dcbf88a57bf7bf24d87ffbcca
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jan 16 08:56:44 2019 +0200
Commit:     Aron Budea <aron.budea at collabora.com>
CommitDate: Tue Jan 14 19:15:49 2020 +0100

    fix crash in draw Format->Bullets and Numbering dialog
    
    regression from
            commit a2b78c131db2bbe3555a89dfae32aefcd00949f5
            make Format->Bullets and Numbering dialog async
    
    Change-Id: Ia726612a492e644f5e40e78a3b537c5ed539aef8
    Reviewed-on: https://gerrit.libreoffice.org/66423
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Tested-by: Jenkins
    (cherry picked from commit 84acbfd2ef8a895d8689fccfffce03df02240b4e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86784
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 14dc697e71be..e695eaad8c70 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -95,20 +95,23 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
     std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
     rReq.Ignore(); // the 'old' request is not relevant any more
 
-    pDlg->StartExecuteAsync([this, pDlg, xRequest](sal_Int32 nResult){
+    // do not capture this, because this will go way before the dialog finishes executing
+    auto pView = mpView;
+    auto pViewShell = mpViewShell;
+    pDlg->StartExecuteAsync([pView, pViewShell, pDlg, xRequest](sal_Int32 nResult){
 
         if( nResult == RET_OK )
         {
             SfxItemSet aSet( *pDlg->GetOutputItemSet() );
 
-            OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+            OutlinerView* pOLV = pView->GetTextEditOutlinerView();
 
             std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard;
 
-            if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView))
+            if (OutlineView* pOutlineView = dynamic_cast<OutlineView*>(pView))
             {
-                pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow());
-                aGuard.reset(new OutlineViewModelChangeGuard(*pView));
+                pOLV = pOutlineView->GetViewByWindow(pViewShell->GetActiveWindow());
+                aGuard.reset(new OutlineViewModelChangeGuard(*pOutlineView));
             }
 
             if( pOLV )
@@ -118,7 +121,7 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
 
             /* not direct to pOlView; therefore, SdDrawView::SetAttributes can catch
                changes to master page and redirect to a template */
-            mpView->SetAttributes(*xRequest->GetArgs());
+            pView->SetAttributes(*xRequest->GetArgs());
         }
         pDlg->disposeOnce();
     });


More information about the Libreoffice-commits mailing list