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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 18 07:40:55 UTC 2020


 sc/source/ui/attrdlg/scdlgfact.cxx |    7 +++++-
 sc/source/ui/attrdlg/scdlgfact.hxx |    5 ++--
 sc/source/ui/view/cellsh1.cxx      |   38 +++++++++++++++++++++++++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

New commits:
commit 300378fb4e99584389e1e9287febf77beaf63f75
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Aug 4 16:18:42 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Sep 18 09:40:10 2020 +0200

    Make Group dialog async
    
    Change-Id: I37fd6c44d43b0f0b424bd023e13ffa07f601a08b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100119
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102876
    Tested-by: Jenkins

diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 071e19038590..a9e9ae359993 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -483,6 +483,11 @@ void    AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(bool bFlag)
     m_xDlg->SetEdStartValEnabled(bFlag);
 }
 
+bool AbstractScGroupDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx)
+{
+    return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
 bool AbstractScGroupDlg_Impl::GetColsChecked() const
 {
     return m_xDlg->GetColsChecked();
@@ -1024,7 +1029,7 @@ VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeries
 
 VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup)
 {
-    return VclPtr<AbstractScGroupDlg_Impl>::Create(std::make_unique<ScGroupDlg>(pParent, bUnGroup, true/*bRows*/));
+    return VclPtr<AbstractScGroupDlg_Impl>::Create(std::make_shared<ScGroupDlg>(pParent, bUnGroup, true/*bRows*/));
 }
 
 VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index f1d26bf8e65c..65853602d8c5 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -285,13 +285,14 @@ public:
 
 class AbstractScGroupDlg_Impl :  public AbstractScGroupDlg
 {
-    std::unique_ptr<ScGroupDlg> m_xDlg;
+    std::shared_ptr<ScGroupDlg> m_xDlg;
 public:
-    explicit AbstractScGroupDlg_Impl(std::unique_ptr<ScGroupDlg> p)
+    explicit AbstractScGroupDlg_Impl(std::shared_ptr<ScGroupDlg> p)
         : m_xDlg(std::move(p))
     {
     }
     virtual short Execute() override;
+    virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override;
     virtual bool GetColsChecked() const override;
 };
 
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index df150de2b0cd..f9c1ab975e35 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1165,11 +1165,20 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                     {
                         ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 
-                        ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld()));
-                        if ( pDlg->Execute() == RET_OK )
-                            bColumns = pDlg->GetColsChecked();
-                        else
-                            bOk = false;
+                        VclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld()));
+
+                        pDlg->StartExecuteAsync(
+                            [pDlg, pTabViewShell] (sal_Int32 nResult) {
+                                if( RET_OK == nResult )
+                                {
+                                    bool bColumn = pDlg->GetColsChecked();
+                                    pTabViewShell->MakeOutline( bColumn );
+                                }
+                                pDlg->disposeOnce();
+                            }
+                        );
+
+                        bOk = false;
                     }
                 }
                 if (bOk)
@@ -1223,11 +1232,20 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                     {
                         ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 
-                        ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld(), true));
-                        if ( pDlg->Execute() == RET_OK )
-                            bColumns = pDlg->GetColsChecked();
-                        else
-                            bOk = false;
+                        VclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld(), true));
+
+                        pDlg->StartExecuteAsync(
+                            [pDlg, pTabViewShell] (sal_Int32 nResult) {
+                                if( RET_OK == nResult )
+                                {
+                                    bool bColumn = pDlg->GetColsChecked();
+                                    pTabViewShell->RemoveOutline( bColumn );
+                                }
+                                pDlg->disposeOnce();
+                            }
+                        );
+
+                        bOk = false;
                     }
                     else if ( bColPoss )
                         bColumns = true;


More information about the Libreoffice-commits mailing list