From 4965b055b5998dc345ecaeb80fc8c3874b19e2a5 Mon Sep 17 00:00:00 2001 From: codewithvk Date: Wed, 14 Feb 2024 15:15:37 +0530 Subject: [PATCH] Chart: Make Data Range Dialog Async MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To reproduce the step, double-click on the chart and right-click to open the context menu, where you can see the option for data ranges. Signed-off-by: codewithvk Change-Id: I0697d5918d35d132aa7c17f86204742017f7ff17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163358 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit afbb4e44478e520b866032df8f0a0a344568233e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163402 Tested-by: Jenkins --- .../controller/main/ChartController.cxx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index f17c3dae353e..f9b3ac2a5858 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1393,17 +1393,17 @@ void ChartController::executeDispatch_SourceData() rModel.attachDataProvider(xDataProvider); } } - - UndoLiveUpdateGuard aUndoGuard( - SchResId(STR_ACTION_EDIT_DATA_RANGES), m_xUndoManager); - + auto aUndoGuard = std::make_shared(SchResId(STR_ACTION_EDIT_DATA_RANGES), + m_xUndoManager); SolarMutexGuard aSolarGuard; - ::chart::DataSourceDialog aDlg(GetChartFrame(), xChartDoc); - if (aDlg.run() == RET_OK) - { - impl_adaptDataSeriesAutoResize(); - aUndoGuard.commit(); - } + auto aDlg = std::make_shared(GetChartFrame(), xChartDoc); + weld::DialogController::runAsync(aDlg, [this, aUndoGuard](int nResult) { + if (nResult == RET_OK) + { + impl_adaptDataSeriesAutoResize(); + aUndoGuard->commit(); + } + }); } void ChartController::executeDispatch_MoveSeries( bool bForward )