chart2/source/controller/main/ChartController.cxx |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit afbb4e44478e520b866032df8f0a0a344568233e
Author:     codewithvk <vivek.jav...@collabora.com>
AuthorDate: Wed Feb 14 15:15:37 2024 +0530
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Fri Feb 16 06:28:49 2024 +0100

    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.jav...@collabora.com>
    Change-Id: I0697d5918d35d132aa7c17f86204742017f7ff17
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163358
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index fbd2968c864d..5601994eee26 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1416,17 +1416,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 )

Reply via email to