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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 18 13:25:21 UTC 2019


 sc/source/ui/view/cellsh1.cxx |   65 +++++++++++++++++++++---------------------
 1 file changed, 33 insertions(+), 32 deletions(-)

New commits:
commit 171710c655061b3ac80b764cb234eec02224b639
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jan 10 14:42:36 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 18 14:24:57 2019 +0100

    make Format->Conditional Formatting->Manage dialog async
    
    Reviewed-on: https://gerrit.libreoffice.org/66097
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit f548dfa29239913fd71be67eadc2905010cabd95)
    
    Change-Id: I13a40c13340ea34cbcbde11289d3420855a7264f
    Reviewed-on: https://gerrit.libreoffice.org/66206
    Reviewed-by: Mert Tümer <mert.tumer at collabora.com>
    Tested-by: Mert Tümer <mert.tumer at collabora.com>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index abed90879ea8..e1af6030e534 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2651,44 +2651,45 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 if (!pList)
                     pList = pDoc->GetCondFormList( aPos.Tab() );
 
-                ScopedVclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg(
+                VclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg(
                     pTabViewShell->GetDialogParent(), pDoc, pList));
 
                 if (pDlgItem)
                     pDlg->SetModified();
 
-                short nRet = pDlg->Execute();
-                ScConditionalFormatList* pCondFormatList = pDlg->GetConditionalFormatList();
-                if(nRet == RET_OK && pDlg->CondFormatsChanged())
-                {
-                    pData->GetDocShell()->GetDocFunc().SetConditionalFormatList(pCondFormatList, aPos.Tab());
-                }
-                else if(nRet == DLG_RET_ADD)
-                {
-                    // Put the xml string parameter to initialize the
-                    // Conditional Format Dialog. ( add new )
-                    pTabViewShell->GetPool().Put(ScCondFormatDlgItem(
-                                std::shared_ptr<ScConditionalFormatList>(pCondFormatList), -1, true));
-                    // Queue message to open Conditional Format Dialog
-                    GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON );
-                }
-                else if (nRet == DLG_RET_EDIT)
-                {
-                    ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected();
-                    sal_Int32 nIndex = pFormat ? pFormat->GetKey() : -1;
-                    // Put the xml string parameter to initialize the
-                    // Conditional Format Dialog. ( edit selected conditional format )
-                    pTabViewShell->GetPool().Put(ScCondFormatDlgItem(
-                                std::shared_ptr<ScConditionalFormatList>(pCondFormatList), nIndex, true));
-
-                    // Queue message to open Conditional Format Dialog
-                    GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON );
-                }
-                else
-                    delete pCondFormatList;
+                pDlg->StartExecuteAsync([this, pDlg, pData, pTabViewShell, pDlgItem, aPos](sal_Int32 nRet){
+                    std::unique_ptr<ScConditionalFormatList> pCondFormatList(pDlg->GetConditionalFormatList());
+                    if(nRet == RET_OK && pDlg->CondFormatsChanged())
+                    {
+                        pData->GetDocShell()->GetDocFunc().SetConditionalFormatList(pCondFormatList.release(), aPos.Tab());
+                    }
+                    else if(nRet == DLG_RET_ADD)
+                    {
+                        // Put the xml string parameter to initialize the
+                        // Conditional Format Dialog. ( add new )
+                        pTabViewShell->GetPool().Put(ScCondFormatDlgItem(
+                                    std::shared_ptr<ScConditionalFormatList>(pCondFormatList.release()), -1, true));
+                        // Queue message to open Conditional Format Dialog
+                        GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON );
+                    }
+                    else if (nRet == DLG_RET_EDIT)
+                    {
+                        ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected();
+                        sal_Int32 nIndex = pFormat ? pFormat->GetKey() : -1;
+                        // Put the xml string parameter to initialize the
+                        // Conditional Format Dialog. ( edit selected conditional format )
+                        pTabViewShell->GetPool().Put(ScCondFormatDlgItem(
+                                    std::shared_ptr<ScConditionalFormatList>(pCondFormatList.release()), nIndex, true));
+
+                        // Queue message to open Conditional Format Dialog
+                        GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON );
+                    }
+                    else
+                        pCondFormatList.reset();
 
-                if (pDlgItem)
-                    pTabViewShell->GetPool().Remove(*pDlgItem);
+                    if (pDlgItem)
+                        pTabViewShell->GetPool().Remove(*pDlgItem);
+                });
             }
             break;
 


More information about the Libreoffice-commits mailing list