sc/source/ui/view/cellsh1.cxx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
New commits: commit b71b6f355aaef7852ae1cbc0a645143b19855848 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Feb 12 16:41:22 2026 +0000 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Feb 13 11:12:47 2026 +0100 make PasteTextImportDialog async Change-Id: I4c35a86150bd74f5f5264418c150770d008de60d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199305 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 567b5c593a2f..a7f8b1b6987c 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1783,16 +1783,25 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAddress aCellPos(nPosX, nPosY, GetViewData().CurrentTabForData()); auto pObj = std::make_shared<ScImportExport>(GetViewData().GetDocument(), aCellPos); pObj->SetOverwriting(true); - if (pDlg->Execute()) { - ScAsciiOptions aOptions; - pDlg->GetOptions(aOptions); - pDlg->SaveParameters(); - pObj->SetExtOptions(aOptions); - pObj->ImportString(sStrBuffer, format); - } - pDlg->disposeOnce(); - rReq.SetReturnValue(SfxInt16Item(nSlot, 1)); // 1 = success, 0 = fail - rReq.Done(); + + auto xRequest = std::make_shared<SfxRequest>(rReq); + rReq.Ignore(); // the 'old' request is not relevant any more + + pDlg->StartExecuteAsync( + [pDlg, pObj, format, sStrBuffer, xRequest=std::move(xRequest)](sal_Int32 nResult){ + if (nResult) { + ScAsciiOptions aOptions; + pDlg->GetOptions(aOptions); + pDlg->SaveParameters(); + pObj->SetExtOptions(aOptions); + pObj->ImportString(sStrBuffer, format); + } + + pDlg->disposeOnce(); + xRequest->SetReturnValue(SfxInt16Item(SID_PASTE_TEXTIMPORT_DIALOG, 1)); // 1 = success, 0 = fail + xRequest->Done(); + } + ); } } if (!bSuccess)
