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

Jan Holesovsky kendy at collabora.com
Thu Jan 18 13:08:25 UTC 2018


 sd/source/ui/func/fuarea.cxx   |   60 ++++++++++++++++++++++-------------------
 sd/source/ui/view/drviews2.cxx |    2 -
 2 files changed, 34 insertions(+), 28 deletions(-)

New commits:
commit 8e1d11a0328c4162241734d2472238b09898d5a1
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 17 20:15:22 2018 +0100

    lokdialog: Convert the Format -> ... -> Area... to async exec.
    
    Change-Id: I3756bd472b4e54db1d1c9da382d5d655f472bdb7
    Reviewed-on: https://gerrit.libreoffice.org/48119
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index ac4fff67a62d..b7764c4893d4 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -52,39 +52,45 @@ rtl::Reference<FuPoor> FuArea::Create( ViewShell* pViewSh, ::sd::Window* pWin, :
 
 void FuArea::DoExecute( SfxRequest& rReq )
 {
-    const SfxItemSet* pArgs = rReq.GetArgs();
+    rReq.Ignore ();
 
-    if( !pArgs )
+    const SfxItemSet* pArgs = rReq.GetArgs();
+    if (pArgs)
     {
-        SfxItemSet aNewAttr( mpDoc->GetPool() );
-        mpView->GetAttributes( aNewAttr );
-
-        SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-        ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog( nullptr,
-                                                                        &aNewAttr,
-                                                                        mpDoc,
-                                                                        true) : nullptr);
-        if( pDlg && (pDlg->Execute() == RET_OK) )
-        {
-            mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
-        }
+        mpViewShell->Cancel();
+        return;
+    }
 
-        // attributes changed, update Listboxes in Objectbars
-        static sal_uInt16 SidArray[] = {
-                        SID_ATTR_FILL_STYLE,
-                        SID_ATTR_FILL_COLOR,
-                        SID_ATTR_FILL_GRADIENT,
-                        SID_ATTR_FILL_HATCH,
-                        SID_ATTR_FILL_BITMAP,
-                        SID_ATTR_FILL_TRANSPARENCE,
-                        SID_ATTR_FILL_FLOATTRANSPARENCE,
-                        0 };
-
-        mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
+    SfxItemSet aNewAttr( mpDoc->GetPool() );
+    mpView->GetAttributes( aNewAttr );
+
+    SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+    VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog(nullptr, &aNewAttr, mpDoc, true) : nullptr);
+    if (!pDlg)
+    {
+        mpViewShell->Cancel();
+        return;
     }
 
-    rReq.Ignore ();
+    pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+        if (nResult == RET_OK)
+        {
+            mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
 
+            // attributes changed, update Listboxes in Objectbars
+            static const sal_uInt16 SidArray[] = {
+                            SID_ATTR_FILL_STYLE,
+                            SID_ATTR_FILL_COLOR,
+                            SID_ATTR_FILL_GRADIENT,
+                            SID_ATTR_FILL_HATCH,
+                            SID_ATTR_FILL_BITMAP,
+                            SID_ATTR_FILL_TRANSPARENCE,
+                            SID_ATTR_FILL_FLOATTRANSPARENCE,
+                            0 };
+
+            mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
+        }
+    }, pDlg);
 }
 
 void FuArea::Activate()
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 22a07f8c960a..6e9bc31b03e0 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1018,7 +1018,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         case SID_ATTRIBUTES_AREA:  // BASIC
         {
             SetCurrentFunction( FuArea::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
-            Cancel();
+            // Cancel() called directly in FuTransform::Create()
         }
         break;
 


More information about the Libreoffice-commits mailing list