chart2/source/controller/inc/ObjectHierarchy.hxx        |    2 -
 chart2/source/controller/main/ChartController_Tools.cxx |    2 -
 chart2/source/controller/main/ObjectHierarchy.cxx       |    2 -
 chart2/source/inc/ChartTypeTemplate.hxx                 |    2 -
 chart2/source/inc/DataSeriesHelper.hxx                  |    9 +----
 chart2/source/inc/LegendHelper.hxx                      |    4 +-
 chart2/source/inc/RangeHighlighter.hxx                  |    1 
 chart2/source/model/template/ChartTypeTemplate.cxx      |    2 -
 chart2/source/model/template/PieChartTypeTemplate.cxx   |    4 +-
 chart2/source/model/template/PieChartTypeTemplate.hxx   |    2 -
 chart2/source/tools/DataSeriesHelper.cxx                |   27 +---------------
 chart2/source/tools/LegendHelper.cxx                    |    3 +
 12 files changed, 18 insertions(+), 42 deletions(-)

New commits:
commit ea00a6ce3b5e15ac2640983cfaaf11755d233644
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Jan 25 21:09:02 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jan 26 07:18:01 2022 +0100

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

diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx 
b/chart2/source/controller/inc/ObjectHierarchy.hxx
index 014210c1c839..ac7833452c50 100644
--- a/chart2/source/controller/inc/ObjectHierarchy.hxx
+++ b/chart2/source/controller/inc/ObjectHierarchy.hxx
@@ -81,7 +81,7 @@ private:
     void createLegendTree(
         ObjectHierarchy::tChildContainer & rContainer,
         const rtl::Reference<::chart::ChartModel> & xChartDoc,
-        const css::uno::Reference< css::chart2::XDiagram > & xDiagram  );
+        const rtl::Reference< ::chart::Diagram > & xDiagram  );
     void createAdditionalShapesTree( ObjectHierarchy::tChildContainer& 
rContainer );
     ObjectIdentifier getParentImpl(
         const ObjectIdentifier& rParentOID,
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx 
b/chart2/source/controller/main/ChartController_Tools.cxx
index 7e98471060a3..850ed40b1d11 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -102,7 +102,7 @@ bool lcl_deleteDataSeries(
     if( xSeries.is() && xModel.is())
     {
         rtl::Reference< ::chart::ChartType > xChartType =
-            DataSeriesHelper::getChartTypeOfSeries( xSeries, 
xModel->getFirstDiagram());
+            DataSeriesHelper::getChartTypeOfSeries( xSeries, 
xModel->getFirstChartDiagram());
         if( xChartType.is())
         {
             UndoGuard aUndoGuard(
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx 
b/chart2/source/controller/main/ObjectHierarchy.cxx
index 5a8853278f07..63ac8edb35c9 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -191,7 +191,7 @@ void ObjectHierarchy::createTree( const 
rtl::Reference<::chart::ChartModel>& xCh
 void ObjectHierarchy::createLegendTree(
     ObjectHierarchy::tChildContainer & rContainer,
     const rtl::Reference<::chart::ChartModel> & xChartDoc,
-    const Reference< XDiagram > & xDiagram  )
+    const rtl::Reference< Diagram > & xDiagram  )
 {
     if( !(xDiagram.is() && LegendHelper::hasLegend( xDiagram )) )
         return;
diff --git a/chart2/source/inc/ChartTypeTemplate.hxx 
b/chart2/source/inc/ChartTypeTemplate.hxx
index af70bb84ccb3..a6f67d3fa6c7 100644
--- a/chart2/source/inc/ChartTypeTemplate.hxx
+++ b/chart2/source/inc/ChartTypeTemplate.hxx
@@ -149,7 +149,7 @@ public:
         changeDiagram
      */
     virtual void adaptDiagram(
-        const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+        const rtl::Reference< ::chart::Diagram > & xDiagram );
 
     /** Creates a 2d or 3d cartesian coordinate system with mathematically
         oriented, linear scales with auto-min/max.  If the given
diff --git a/chart2/source/inc/DataSeriesHelper.hxx 
b/chart2/source/inc/DataSeriesHelper.hxx
index 8827a349b846..866fa7c54e9f 100644
--- a/chart2/source/inc/DataSeriesHelper.hxx
+++ b/chart2/source/inc/DataSeriesHelper.hxx
@@ -38,6 +38,7 @@ namespace com::sun::star::uno { class Any; }
 namespace com::sun::star::uno { template <class E> class Sequence; }
 namespace chart { class BaseCoordinateSystem; }
 namespace chart { class ChartType; }
+namespace chart { class Diagram; }
 
 namespace chart::DataSeriesHelper
 {
@@ -120,13 +121,13 @@ OOO_DLLPUBLIC_CHARTTOOLS
 rtl::Reference< ::chart::BaseCoordinateSystem >
     getCoordinateSystemOfSeries(
         const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
-        const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+        const rtl::Reference< ::chart::Diagram > & xDiagram );
 
 OOO_DLLPUBLIC_CHARTTOOLS
 rtl::Reference< ::chart::ChartType >
     getChartTypeOfSeries(
         const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
-        const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+        const rtl::Reference< ::chart::Diagram > & xDiagram );
 
 OOO_DLLPUBLIC_CHARTTOOLS void deleteSeries(
     const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
diff --git a/chart2/source/inc/LegendHelper.hxx 
b/chart2/source/inc/LegendHelper.hxx
index d0f19ebb8385..ca2dc0ef8e16 100644
--- a/chart2/source/inc/LegendHelper.hxx
+++ b/chart2/source/inc/LegendHelper.hxx
@@ -19,6 +19,7 @@
 #pragma once
 
 #include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ref.hxx>
 #include "charttoolsdllapi.hxx"
 
 namespace chart { class ChartModel; }
@@ -28,6 +29,7 @@ namespace com::sun::star::uno { class XComponentContext; }
 
 namespace chart
 {
+class Diagram;
 
 class OOO_DLLPUBLIC_CHARTTOOLS LegendHelper
 {
@@ -47,7 +49,7 @@ public:
         is a legend which has a "Show" property of value <FALSE/>. Otherwise,
         <TRUE/> is returned.
      */
-    static bool hasLegend( const css::uno::Reference< css::chart2::XDiagram > 
& xDiagram );
+    static bool hasLegend( const rtl::Reference< ::chart::Diagram > & xDiagram 
);
 };
 
 } //namespace chart
diff --git a/chart2/source/inc/RangeHighlighter.hxx 
b/chart2/source/inc/RangeHighlighter.hxx
index 67cb0484c121..bc876d7dc8f1 100644
--- a/chart2/source/inc/RangeHighlighter.hxx
+++ b/chart2/source/inc/RangeHighlighter.hxx
@@ -82,7 +82,6 @@ private:
     void stopListening();
     void determineRanges();
 
-    void fillRangesForDiagram( const css::uno::Reference< 
css::chart2::XDiagram > & xDiagram );
     void fillRangesForDiagram( const rtl::Reference< ::chart::Diagram > & 
xDiagram );
     void fillRangesForDataSeries( const css::uno::Reference< 
css::chart2::XDataSeries > & xSeries );
     void fillRangesForCategories( const css::uno::Reference< 
css::chart2::XAxis > & xAxis );
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx 
b/chart2/source/model/template/ChartTypeTemplate.cxx
index 0cb57443441a..c3be03150fea 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -629,7 +629,7 @@ void ChartTypeTemplate::adaptScales(
     }
 }
 
-void ChartTypeTemplate::adaptDiagram( const Reference< XDiagram > & /* 
xDiagram */ )
+void ChartTypeTemplate::adaptDiagram( const rtl::Reference< ::chart::Diagram > 
& /* xDiagram */ )
 {
 }
 
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx 
b/chart2/source/model/template/PieChartTypeTemplate.cxx
index f2ff4ec5f863..d89230a7f90e 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -594,13 +594,13 @@ void PieChartTypeTemplate::resetStyles( const 
rtl::Reference< ::chart::Diagram >
 }
 
 // ____ XChartTypeTemplate ____
-void PieChartTypeTemplate::adaptDiagram( const uno::Reference< 
chart2::XDiagram >& xDiagram )
+void PieChartTypeTemplate::adaptDiagram( const rtl::Reference< 
::chart::Diagram >& xDiagram )
 {
     if( !xDiagram.is() )
         return;
 
     //different default for scene geometry:
-    ThreeDHelper::setDefaultRotation( uno::Reference< beans::XPropertySet >( 
xDiagram, uno::UNO_QUERY ), true );
+    ThreeDHelper::setDefaultRotation( xDiagram, true );
 }
 
 IMPLEMENT_FORWARD_XINTERFACE2( PieChartTypeTemplate, ChartTypeTemplate, 
OPropertySet )
diff --git a/chart2/source/model/template/PieChartTypeTemplate.hxx 
b/chart2/source/model/template/PieChartTypeTemplate.hxx
index ea2aeff07cc7..c18ba32803b8 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.hxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.hxx
@@ -75,7 +75,7 @@ protected:
     virtual sal_Int32 getDimension() const override;
 
     virtual void adaptDiagram(
-        const css::uno::Reference< css::chart2::XDiagram > & xDiagram ) 
override;
+        const rtl::Reference< ::chart::Diagram > & xDiagram ) override;
 
     virtual sal_Int32 getAxisCountByDimension( sal_Int32 nDimension ) override;
 
diff --git a/chart2/source/tools/DataSeriesHelper.cxx 
b/chart2/source/tools/DataSeriesHelper.cxx
index fefccb4bbf38..a4b626830d1e 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -484,7 +484,7 @@ sal_Int32 getNumberFormatKeyFromAxis(
 
 rtl::Reference< ::chart::BaseCoordinateSystem > getCoordinateSystemOfSeries(
     const Reference< chart2::XDataSeries > & xSeries,
-    const Reference< chart2::XDiagram > & xDiagram )
+    const rtl::Reference< Diagram > & xDiagram )
 {
     rtl::Reference< ::chart::BaseCoordinateSystem > xResult;
     rtl::Reference< ::chart::ChartType > xDummy;
@@ -495,7 +495,7 @@ rtl::Reference< ::chart::BaseCoordinateSystem > 
getCoordinateSystemOfSeries(
 
 rtl::Reference< ::chart::ChartType > getChartTypeOfSeries(
     const Reference< chart2::XDataSeries > & xSeries,
-    const Reference< chart2::XDiagram > & xDiagram )
+    const rtl::Reference< Diagram > & xDiagram )
 {
     rtl::Reference< ::chart::ChartType > xResult;
     rtl::Reference< ::chart::BaseCoordinateSystem > xDummy;
diff --git a/chart2/source/tools/LegendHelper.cxx 
b/chart2/source/tools/LegendHelper.cxx
index 6fbd6bf63143..7d040128959c 100644
--- a/chart2/source/tools/LegendHelper.cxx
+++ b/chart2/source/tools/LegendHelper.cxx
@@ -19,6 +19,7 @@
 
 #include <LegendHelper.hxx>
 #include <ChartModel.hxx>
+#include <Diagram.hxx>
 #include <com/sun/star/chart/ChartLegendExpansion.hpp>
 #include <com/sun/star/chart2/LegendPosition.hpp>
 #include <com/sun/star/chart2/RelativePosition.hpp>
@@ -105,7 +106,7 @@ uno::Reference< chart2::XLegend > LegendHelper::getLegend(
     return xResult;
 }
 
-bool LegendHelper::hasLegend( const uno::Reference< chart2::XDiagram > & 
xDiagram )
+bool LegendHelper::hasLegend( const rtl::Reference< Diagram > & xDiagram )
 {
     bool bReturn = false;
     if( xDiagram.is())
commit f4dd0dfd27201152b1e39c35302e1ca9c6ce12b6
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Jan 25 21:05:28 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jan 26 07:17:46 2022 +0100

    remove now unused function
    
    Change-Id: Ic59756b8cecef026e8583bc378cedcc1b6e3e88a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128944
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/inc/DataSeriesHelper.hxx 
b/chart2/source/inc/DataSeriesHelper.hxx
index 512fe85f431e..8827a349b846 100644
--- a/chart2/source/inc/DataSeriesHelper.hxx
+++ b/chart2/source/inc/DataSeriesHelper.hxx
@@ -128,10 +128,6 @@ rtl::Reference< ::chart::ChartType >
         const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
         const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
 
-OOO_DLLPUBLIC_CHARTTOOLS void deleteSeries(
-    const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
-    const css::uno::Reference< css::chart2::XChartType > & xChartType );
-
 OOO_DLLPUBLIC_CHARTTOOLS void deleteSeries(
     const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
     const rtl::Reference< ::chart::ChartType > & xChartType );
diff --git a/chart2/source/tools/DataSeriesHelper.cxx 
b/chart2/source/tools/DataSeriesHelper.cxx
index ca87ca29773e..fefccb4bbf38 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -504,29 +504,6 @@ rtl::Reference< ::chart::ChartType > getChartTypeOfSeries(
     return xResult;
 }
 
-void deleteSeries(
-    const Reference< chart2::XDataSeries > & xSeries,
-    const Reference< chart2::XChartType > & xChartType )
-{
-    try
-    {
-        Reference< chart2::XDataSeriesContainer > xSeriesCnt( xChartType, 
uno::UNO_QUERY_THROW );
-        auto aSeries(
-            comphelper::sequenceToContainer<std::vector< Reference< 
chart2::XDataSeries > > >( xSeriesCnt->getDataSeries()));
-        std::vector< Reference< chart2::XDataSeries > >::iterator aIt =
-              std::find( aSeries.begin(), aSeries.end(), xSeries );
-        if( aIt != aSeries.end())
-        {
-            aSeries.erase( aIt );
-            xSeriesCnt->setDataSeries( comphelper::containerToSequence( 
aSeries ));
-        }
-    }
-    catch( const uno::Exception & )
-    {
-        DBG_UNHANDLED_EXCEPTION("chart2");
-    }
-}
-
 void deleteSeries(
     const Reference< chart2::XDataSeries > & xSeries,
     const rtl::Reference< ::chart::ChartType > & xChartType )

Reply via email to