summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-01-22 14:39:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-01-22 19:48:44 +0100
commit0edec422600cce2b042d5414443ad25ab515f351 (patch)
treea309ad8e9b77ca9eb1720e36c90fa5a082b563d0 /chart2
parentdde1868544bf325a359bdf4336623ac65e6ff4e0 (diff)
make object name dialog async
Change-Id: Icf81810297dc5767cedd051cf8ccdfbb101f35ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162395 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/main/ShapeController.cxx23
1 files changed, 14 insertions, 9 deletions
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 68483225b3bc..fe09d3e9af61 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -433,20 +433,25 @@ void ShapeController::executeDispatch_RenameObject()
if ( !pSelectedObj )
return;
- OUString aName = pSelectedObj->GetName();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
weld::Window* pChartWindow(m_pChartController->GetChartFrame());
- ScopedVclPtr< AbstractSvxObjectNameDialog > pDlg(
- pFact->CreateSvxObjectNameDialog(pChartWindow, aName));
+ VclPtr< AbstractSvxObjectNameDialog > pDlg(
+ pFact->CreateSvxObjectNameDialog(pChartWindow, pSelectedObj->GetName()));
pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
- if ( pDlg->Execute() == RET_OK )
- {
- aName = pDlg->GetName();
- if (pSelectedObj->GetName() != aName)
+ pDlg->StartExecuteAsync(
+ [pDlg, pSelectedObj] (sal_Int32 nResult)->void
{
- pSelectedObj->SetName( aName );
+ if (nResult == RET_OK)
+ {
+ OUString aName = pDlg->GetName();
+ if (pSelectedObj->GetName() != aName)
+ {
+ pSelectedObj->SetName( aName );
+ }
+ }
+ pDlg->disposeOnce();
}
- }
+ );
}
void ShapeController::executeDispatch_ChangeZOrder( ChartCommandID nId )