Kaydet (Commit) c9c0f257 authored tarafından Henry Castro's avatar Henry Castro

lokdialog: convert the show sheet dialog to async exec

Change-Id: I501d9444ef9798a26b4db06ab51e4fb691144b17
Reviewed-on: https://gerrit.libreoffice.org/51094Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarHenry Castro <hcastro@collabora.com>
üst cab04bc3
...@@ -135,7 +135,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ...@@ -135,7 +135,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
ScopedVclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); VclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent()));
OSL_ENSURE(pDlg, "Dialog create fail!"); OSL_ENSURE(pDlg, "Dialog create fail!");
OUString aTabName; OUString aTabName;
...@@ -150,18 +150,24 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ...@@ -150,18 +150,24 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
} }
} }
if ( pDlg->Execute() == RET_OK ) std::shared_ptr<SfxRequest> pReq = std::make_shared<SfxRequest>(rReq);
{ pDlg->StartExecuteAsync([this, pDlg, pReq](sal_Int32 nResult){
const sal_Int32 nCount = pDlg->GetSelectedEntryCount(); OUString sTable;
for (sal_Int32 nPos=0; nPos<nCount; ++nPos) std::vector<OUString> sTables;
if (RET_OK == nResult)
{ {
aName = pDlg->GetSelectedEntry(nPos); const sal_Int32 nCount = pDlg->GetSelectedEntryCount();
rReq.AppendItem( SfxStringItem( FID_TABLE_SHOW, aName ) ); for (sal_Int32 nPos=0; nPos<nCount; ++nPos)
rNames.push_back(aName); {
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; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment