chart2/source/controller/dialogs/DialogModel.cxx |    2 +-
 chart2/source/controller/dialogs/DialogModel.hxx |    2 +-
 chart2/source/inc/Diagram.hxx                    |    5 +++--
 chart2/source/model/main/Diagram.cxx             |   14 ++++----------
 4 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 5f0a3a20efd26f50efbe92643c95f09bd21dfc0f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 15 16:21:40 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 17 12:47:20 2023 +0000

    use more concrete types in Diagram::moveSeries
    
    Change-Id: Ic5bb7f36137afe112d1a542bd642355d996cf68c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149048
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/controller/dialogs/DialogModel.cxx 
b/chart2/source/controller/dialogs/DialogModel.cxx
index 495bf8f396d3..36015c560285 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -524,7 +524,7 @@ DialogModel::tRolesWithRanges 
DialogModel::getRolesWithRanges(
 }
 
 void DialogModel::moveSeries(
-    const Reference< XDataSeries > & xSeries,
+    const rtl::Reference< DataSeries > & xSeries,
     MoveDirection eDirection )
 {
     m_aTimerTriggeredControllerLock.startTimer();
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx 
b/chart2/source/controller/dialogs/DialogModel.hxx
index 9b7cf1cdcf25..576f29c20f4b 100644
--- a/chart2/source/controller/dialogs/DialogModel.hxx
+++ b/chart2/source/controller/dialogs/DialogModel.hxx
@@ -104,7 +104,7 @@ public:
         Down, Up
     };
 
-    void moveSeries( const css::uno::Reference< css::chart2::XDataSeries > & 
xSeries,
+    void moveSeries( const rtl::Reference< DataSeries > & xSeries,
                      MoveDirection eDirection );
 
     /// @return the newly inserted series
diff --git a/chart2/source/inc/Diagram.hxx b/chart2/source/inc/Diagram.hxx
index a5e877a1f4cf..4c1d40df28bf 100644
--- a/chart2/source/inc/Diagram.hxx
+++ b/chart2/source/inc/Diagram.hxx
@@ -41,6 +41,7 @@ namespace chart
 {
 class BaseCoordinateSystem;
 class ChartType;
+class DataSeries;
 class Legend;
 class DataTable;
 class Wall;
@@ -197,7 +198,7 @@ public:
     *
     */
     bool moveSeries(
-                const css::uno::Reference< css::chart2::XDataSeries >& 
xGivenDataSeries,
+                const rtl::Reference< DataSeries >& xGivenDataSeries,
                 bool bForward );
 
     /**
@@ -216,7 +217,7 @@ public:
     *
     */
     bool isSeriesMoveable(
-            const css::uno::Reference< css::chart2::XDataSeries >& 
xGivenDataSeries,
+            const rtl::Reference< DataSeries >& xGivenDataSeries,
             bool bForward );
 
 private:
diff --git a/chart2/source/model/main/Diagram.cxx 
b/chart2/source/model/main/Diagram.cxx
index fabaa5b5db1a..aced36a4a98d 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -1002,29 +1002,23 @@ static bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
 }
 
 bool Diagram::isSeriesMoveable(
-    const Reference< css::chart2::XDataSeries >& xGivenDataSeries,
+    const rtl::Reference< DataSeries >& xGivenDataSeries,
     bool bForward )
 {
     const bool bDoMove = false;
 
-    rtl::Reference pGivenDataSeries = 
dynamic_cast<DataSeries*>(xGivenDataSeries.get());
-    assert(pGivenDataSeries || !xGivenDataSeries);
-
     bool bIsMoveable = lcl_moveSeriesOrCheckIfMoveIsAllowed(
-        *this, pGivenDataSeries, bForward, bDoMove );
+        *this, xGivenDataSeries, bForward, bDoMove );
 
     return bIsMoveable;
 }
 
-bool Diagram::moveSeries( const Reference< css::chart2::XDataSeries >& 
xGivenDataSeries, bool bForward )
+bool Diagram::moveSeries( const rtl::Reference< DataSeries >& 
xGivenDataSeries, bool bForward )
 {
     const bool bDoMove = true;
 
-    rtl::Reference pGivenDataSeries = 
dynamic_cast<DataSeries*>(xGivenDataSeries.get());
-    assert(pGivenDataSeries || !xGivenDataSeries);
-
     bool bMoved = lcl_moveSeriesOrCheckIfMoveIsAllowed(
-        *this, pGivenDataSeries, bForward, bDoMove );
+        *this, xGivenDataSeries, bForward, bDoMove );
 
     return bMoved;
 }

Reply via email to