summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorcodewithvk <vivek.javiya@collabora.com>2024-02-14 15:15:37 +0530
committerTomaž Vajngerl <quikee@gmail.com>2024-02-16 12:08:55 +0100
commit4965b055b5998dc345ecaeb80fc8c3874b19e2a5 (patch)
tree84b9d57e9ef495cb70331d2769baa33e3eb38917 /chart2
parent88ba9fab08514b96f458bb8c0ace175b2790638e (diff)
Chart: Make Data Range Dialog Async
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 <vivek.javiya@collabora.com> Change-Id: I0697d5918d35d132aa7c17f86204742017f7ff17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163358 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit afbb4e44478e520b866032df8f0a0a344568233e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163402 Tested-by: Jenkins
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/main/ChartController.cxx20
1 files 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<UndoLiveUpdateGuard>(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<DataSourceDialog>(GetChartFrame(), xChartDoc);
+ weld::DialogController::runAsync(aDlg, [this, aUndoGuard](int nResult) {
+ if (nResult == RET_OK)
+ {
+ impl_adaptDataSeriesAutoResize();
+ aUndoGuard->commit();
+ }
+ });
}
void ChartController::executeDispatch_MoveSeries( bool bForward )