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

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 29 12:02:11 UTC 2019


 sc/source/ui/drawfunc/drawsh.cxx    |   26 +++++++++-------
 sw/source/uibase/shells/drawdlg.cxx |   58 +++++++++++++++++++++---------------
 2 files changed, 50 insertions(+), 34 deletions(-)

New commits:
commit 58b29efeea5514755084a255b06268fed7cd6ecb
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Thu Jun 27 21:12:42 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Sat Jun 29 14:01:28 2019 +0200

    lokdialog: Convert the Format -> Line... to async exec
    
    for sw and sc
    
    Change-Id: If89bff982d16ba8d4e4524445e56ee2fe23d7876
    Reviewed-on: https://gerrit.libreoffice.org/74818
    Tested-by: Jenkins
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/74870
    Tested-by: Muhammet Kara <muhammet.kara at collabora.com>

diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index aeabba5c8212..f41eb161665c 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -379,6 +379,9 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq )
     const SdrObject*    pObj        = nullptr;
     const SdrMarkList&  rMarkList   = pView->GetMarkedObjectList();
 
+    std::shared_ptr<SfxRequest> pRequest;
+    pRequest.reset(new SfxRequest(rReq));
+
     if( rMarkList.GetMarkCount() == 1 )
         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
 
@@ -387,22 +390,25 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq )
         pView->MergeAttrFromMarked( aNewAttr, false );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetFrameWeld(),
+    VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetFrameWeld(),
                 &aNewAttr,
             pViewData->GetDocument()->GetDrawLayer(),
             pObj,
             bHasMarked));
 
-    if ( pDlg->Execute() == RET_OK )
-    {
-        if( bHasMarked )
-            pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false );
-        else
-            pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
+    pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+        if ( nResult == RET_OK )
+        {
+            if( bHasMarked )
+                pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false );
+            else
+                pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
 
-        pView->InvalidateAttribs();
-        rReq.Done();
-    }
+            pView->InvalidateAttribs();
+            pRequest->Done();
+        }
+        pDlg->disposeOnce();
+    });
 }
 
 void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq )
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 27c2ea6b9b91..7cc72c5e4ae9 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -143,36 +143,46 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
                 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
 
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-            ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog(rReq.GetFrameWeld(),
+            VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog(rReq.GetFrameWeld(),
                     &aNewAttr,
                 pDoc,
                 pObj,
                 bHasMarked));
-            if (pDlg->Execute() == RET_OK)
-            {
-                pSh->StartAction();
-                if(bHasMarked)
-                    pView->SetAttrToMarked(*pDlg->GetOutputItemSet(), false);
-                else
-                    pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false);
-                pSh->EndAction();
 
-                static sal_uInt16 aInval[] =
+            pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+                if (nResult == RET_OK)
                 {
-                    SID_ATTR_LINE_STYLE,                // ( SID_SVX_START + 169 )
-                    SID_ATTR_LINE_DASH,                 // ( SID_SVX_START + 170 )
-                    SID_ATTR_LINE_WIDTH,                // ( SID_SVX_START + 171 )
-                    SID_ATTR_LINE_COLOR,                // ( SID_SVX_START + 172 )
-                    SID_ATTR_LINE_START,                // ( SID_SVX_START + 173 )
-                    SID_ATTR_LINE_END,                  // ( SID_SVX_START + 174 )
-                    SID_ATTR_LINE_TRANSPARENCE,         // (SID_SVX_START+1107)
-                    SID_ATTR_LINE_JOINT,                // (SID_SVX_START+1110)
-                    SID_ATTR_LINE_CAP,                  // (SID_SVX_START+1111)
-                    0
-                };
-
-                GetView().GetViewFrame()->GetBindings().Invalidate(aInval);
-            }
+                    pSh->StartAction();
+                    if(bHasMarked)
+                        pView->SetAttrToMarked(*pDlg->GetOutputItemSet(), false);
+                    else
+                        pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false);
+                    pSh->EndAction();
+
+                    static sal_uInt16 aInval[] =
+                    {
+                        SID_ATTR_LINE_STYLE,                // ( SID_SVX_START + 169 )
+                        SID_ATTR_LINE_DASH,                 // ( SID_SVX_START + 170 )
+                        SID_ATTR_LINE_WIDTH,                // ( SID_SVX_START + 171 )
+                        SID_ATTR_LINE_COLOR,                // ( SID_SVX_START + 172 )
+                        SID_ATTR_LINE_START,                // ( SID_SVX_START + 173 )
+                        SID_ATTR_LINE_END,                  // ( SID_SVX_START + 174 )
+                        SID_ATTR_LINE_TRANSPARENCE,         // (SID_SVX_START+1107)
+                        SID_ATTR_LINE_JOINT,                // (SID_SVX_START+1110)
+                        SID_ATTR_LINE_CAP,                  // (SID_SVX_START+1111)
+                        0
+                    };
+
+                    GetView().GetViewFrame()->GetBindings().Invalidate(aInval);
+                }
+
+                if (pDoc->IsChanged())
+                    GetShell().SetModified();
+                else if (bChanged)
+                    pDoc->SetChanged();
+
+                pDlg->disposeOnce();
+            });
         }
         break;
 


More information about the Libreoffice-commits mailing list