sc/source/ui/view/cellsh1.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit 695e8742da850bbb15c2e6d2b5d4c99a0daf4925 Author: Sahil Gautam <sa...@libreoffice.org> AuthorDate: Sun Apr 21 23:24:50 2024 +0530 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Sun Apr 21 23:15:17 2024 +0200 tdf#80390 Use local copy in anonymous function. The nCount object might go out of scope, as it's used by an async function. https://gerrit.libreoffice.org/c/core/+/164316/comments/507b830b_001a71eb Change-Id: I4218f6e35b61704115047481cb97a193c593a072 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154750 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 69fbd1ead083..ae55a3312d25 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -352,7 +352,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case FID_INS_CELL: { InsCellCmd eCmd=INS_NONE; - size_t nCount = 0; if ( pReqArgs ) { @@ -386,20 +385,21 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); VclPtr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg(pTabViewShell->GetFrameWeld(), bTheFlag)); - pDlg->StartExecuteAsync([pDlg, pTabViewShell, &nCount](sal_Int32 nResult){ + pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ if (nResult == RET_OK) { SfxRequest aRequest(pTabViewShell->GetViewFrame(), FID_INS_CELL); InsCellCmd eTmpCmd = pDlg->GetInsCellCmd(); - nCount = pDlg->GetCount(); - InsertCells(pTabViewShell, aRequest, eTmpCmd, nCount); + size_t nInsCount = pDlg->GetCount(); + InsertCells(pTabViewShell, aRequest, eTmpCmd, nInsCount); } pDlg->disposeOnce(); }); + break; } } - InsertCells(pTabViewShell, rReq, eCmd, nCount); + InsertCells(pTabViewShell, rReq, eCmd); } break;