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

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 27 21:40:15 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 d306d22d570817adb3986fc7054ae1e36768b8be
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: Thu Jun 27 23:38:26 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>

diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 1f31a09cf439..2b3414368a96 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -373,6 +373,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();
 
@@ -381,22 +384,25 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq )
         pView->MergeAttrFromMarked( aNewAttr, false );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(),
+    VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(),
                 &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 c2232bfa413b..b7e6fbd5ee11 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -144,36 +144,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