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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 19 19:07:19 UTC 2019


 sc/source/ui/docshell/docsh4.cxx |   23 ++++++++++++++---------
 sc/source/ui/pagedlg/tphf.cxx    |   13 +++++++------
 2 files changed, 21 insertions(+), 15 deletions(-)

New commits:
commit c6af5af11d889dc0feee35c9daf9909249f5a6d9
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jan 10 14:31:21 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Sep 19 21:06:15 2019 +0200

    make insert->header/footer dialogs async
    
    Change-Id: I0e8eac86280d42752db2d7bde8c6aecf452bad6c
    Reviewed-on: https://gerrit.libreoffice.org/66089
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 2281ade467e7dcc9652f74dbc4d9736100b0ad78)
    Reviewed-on: https://gerrit.libreoffice.org/79127
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 319481947672..d30202cf10c8 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1860,21 +1860,26 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller,
 
                         ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 
-                        ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
+                        VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
                                                                                 GetActiveDialogParent(),
                                                                                 rStyleSet,
                                                                                 aStr,
                                                                                 nResId));
-                        if ( pDlg->Execute() == RET_OK )
-                        {
-                            const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
+                        std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
+                        rReq.Ignore(); // the 'old' request is not relevant any more
+                        pDlg->StartExecuteAsync([this, pDlg, pStyleSheet, xRequest](sal_Int32 nResult){
+                            if ( nResult == RET_OK )
+                            {
+                                const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
 
-                            if ( pOutSet )
-                                m_aDocument.ModifyStyleSheet( *pStyleSheet, *pOutSet );
+                                if ( pOutSet )
+                                    m_aDocument.ModifyStyleSheet( *pStyleSheet, *pOutSet );
 
-                            SetDocumentModified();
-                            rReq.Done();
-                        }
+                                SetDocumentModified();
+                                xRequest->Done();
+                                pDlg->disposeOnce();
+                            }
+                        });
                     }
                 }
             }
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index 8cc1f28a327c..d7ca87aec728 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -182,13 +182,14 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void)
 
         ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 
-        ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
+        VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
             this, aDataSet, aStrPageStyle, nResId));
-
-        if ( pDlg->Execute() == RET_OK )
-        {
-            aDataSet.Put( *pDlg->GetOutputItemSet() );
-        }
+        pDlg->StartExecuteAsync([this, pDlg](sal_Int32 nResult){
+            if ( nResult == RET_OK )
+            {
+                aDataSet.Put( *pDlg->GetOutputItemSet() );
+            }
+        });
     }
     else
     {


More information about the Libreoffice-commits mailing list