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

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


 sc/source/ui/drawfunc/drawsh.cxx |   66 ++++++++++++++++++++++++---------------
 1 file changed, 42 insertions(+), 24 deletions(-)

New commits:
commit b315e9d5bad90ca3e4eaaee5cb7da7739557f2e2
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Fri Jun 28 23:37:10 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Sat Jun 29 14:02:55 2019 +0200

    lokdialog: Convert the Format -> Position and Size... to async exec for sc
    
    Change-Id: I715ed025d97de8eb69b6e9ba227b955b49add855
    Reviewed-on: https://gerrit.libreoffice.org/74861
    Tested-by: Jenkins
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/74873
    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 f41eb161665c..c13001d9e294 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -98,6 +98,20 @@ static void lcl_setModified( const SfxObjectShell*  pShell )
     }
 }
 
+static void lcl_invalidateTransformAttr(const ScTabViewShell* pViewShell)
+{
+    SfxBindings& rBindings=pViewShell->GetViewFrame()->GetBindings();
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_WIDTH);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_HEIGHT);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_POS_X);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_POS_Y);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_ANGLE);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_ROT_X);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_ROT_Y);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_AUTOWIDTH);
+    rBindings.Invalidate(SID_ATTR_TRANSFORM_AUTOHEIGHT);
+}
+
 void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 {
     sal_uInt16              nSlot       = rReq.GetSlot();
@@ -256,6 +270,9 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
                         if( rMarkList.GetMark(0) != nullptr )
                         {
                             SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+                            std::shared_ptr<SfxRequest> pRequest;
+                            pRequest.reset(new SfxRequest(rReq));
+
                             if( pObj->GetObjIdentifier() == OBJ_CAPTION )
                             {
                                 // Caption Itemset
@@ -265,7 +282,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
                                 SfxItemSet aNewGeoAttr(pView->GetGeoAttrFromMarked());
 
                                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                                ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog(pWin ? pWin->GetFrameWeld() : nullptr, pView));
+                                VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog(pWin ? pWin->GetFrameWeld() : nullptr, pView));
 
                                 const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
                                 SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange );
@@ -273,23 +290,34 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
                                 aCombSet.Put( aNewGeoAttr );
                                 pDlg->SetInputSet( &aCombSet );
 
-                                if (pDlg->Execute() == RET_OK)
-                                {
-                                    rReq.Done(*(pDlg->GetOutputItemSet()));
-                                    pView->SetAttributes(*pDlg->GetOutputItemSet());
-                                    pView->SetGeoAttrToMarked(*pDlg->GetOutputItemSet());
-                                }
+                                pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+                                    if (nResult == RET_OK)
+                                    {
+                                        pRequest->Done(*(pDlg->GetOutputItemSet()));
+                                        pView->SetAttributes(*pDlg->GetOutputItemSet());
+                                        pView->SetGeoAttrToMarked(*pDlg->GetOutputItemSet());
+                                    }
+
+                                    lcl_invalidateTransformAttr(pViewData->GetViewShell());
+                                    pDlg->disposeOnce();
+                                });
                             }
                             else
                             {
                                 SfxItemSet aNewAttr(pView->GetGeoAttrFromMarked());
                                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                                ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxTransformTabDialog(pWin ? pWin->GetFrameWeld() : nullptr, &aNewAttr, pView));
-                                if (pDlg->Execute() == RET_OK)
-                                {
-                                    rReq.Done(*(pDlg->GetOutputItemSet()));
-                                    pView->SetGeoAttrToMarked(*pDlg->GetOutputItemSet());
-                                }
+                                VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxTransformTabDialog(pWin ? pWin->GetFrameWeld() : nullptr, &aNewAttr, pView));
+
+                                pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+                                    if (nResult == RET_OK)
+                                    {
+                                        pRequest->Done(*(pDlg->GetOutputItemSet()));
+                                        pView->SetGeoAttrToMarked(*pDlg->GetOutputItemSet());
+                                    }
+
+                                    lcl_invalidateTransformAttr(pViewData->GetViewShell());
+                                    pDlg->disposeOnce();
+                                });
                             }
                         }
 
@@ -299,17 +327,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
                 }
             }
 
-            ScTabViewShell* pViewShell = pViewData->GetViewShell();
-            SfxBindings& rBindings=pViewShell->GetViewFrame()->GetBindings();
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_WIDTH);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_HEIGHT);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_POS_X);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_POS_Y);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_ANGLE);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_ROT_X);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_ROT_Y);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_AUTOWIDTH);
-            rBindings.Invalidate(SID_ATTR_TRANSFORM_AUTOHEIGHT);
+            lcl_invalidateTransformAttr(pViewData->GetViewShell());
             break;
         }
 


More information about the Libreoffice-commits mailing list