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 )