diff options
author | Henry Castro <hcastro@collabora.com> | 2018-03-11 18:44:58 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2018-03-12 04:46:21 +0100 |
commit | c9c0f257f4abe738203d2294ca86822e200d3ce3 (patch) | |
tree | bfa49fde60b35c283aaea9c5eb8a00f3f43330ad /sc/source/ui/view/tabvwshf.cxx | |
parent | cab04bc39b5164ea74216cd849c3af5f5b298f79 (diff) |
lokdialog: convert the show sheet dialog to async exec
Change-Id: I501d9444ef9798a26b4db06ab51e4fb691144b17
Reviewed-on: https://gerrit.libreoffice.org/51094
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sc/source/ui/view/tabvwshf.cxx')
-rw-r--r-- | sc/source/ui/view/tabvwshf.cxx | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index ae3a8bc6ac88..64e5cb52ef3b 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -135,7 +135,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - ScopedVclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); + VclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); OSL_ENSURE(pDlg, "Dialog create fail!"); OUString aTabName; @@ -150,18 +150,24 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) } } - if ( pDlg->Execute() == RET_OK ) - { - const sal_Int32 nCount = pDlg->GetSelectedEntryCount(); - for (sal_Int32 nPos=0; nPos<nCount; ++nPos) + std::shared_ptr<SfxRequest> pReq = std::make_shared<SfxRequest>(rReq); + pDlg->StartExecuteAsync([this, pDlg, pReq](sal_Int32 nResult){ + OUString sTable; + std::vector<OUString> sTables; + if (RET_OK == nResult) { - aName = pDlg->GetSelectedEntry(nPos); - rReq.AppendItem( SfxStringItem( FID_TABLE_SHOW, aName ) ); - rNames.push_back(aName); + const sal_Int32 nCount = pDlg->GetSelectedEntryCount(); + for (sal_Int32 nPos=0; nPos<nCount; ++nPos) + { + sTable = pDlg->GetSelectedEntry(nPos); + pReq->AppendItem( SfxStringItem( FID_TABLE_SHOW, sTable ) ); + sTables.push_back(sTable); + } + ShowTable( sTables ); + pReq->Done(); } - ShowTable( rNames ); - rReq.Done(); - } + }); + rReq.Ignore(); } } break; |