chart2/source/inc/ChartType.hxx                    |    6 +++---
 chart2/source/model/main/BaseCoordinateSystem.cxx  |    2 ++
 chart2/source/model/template/BubbleChartType.cxx   |    4 ++--
 chart2/source/model/template/BubbleChartType.hxx   |    5 +++--
 chart2/source/model/template/ChartTypeTemplate.cxx |    2 +-
 chart2/source/model/template/NetChartType.cxx      |    4 ++--
 chart2/source/model/template/NetChartType.hxx      |    7 +++----
 chart2/source/model/template/PieChartType.cxx      |    4 ++--
 chart2/source/model/template/PieChartType.hxx      |    5 +++--
 chart2/source/model/template/ScatterChartType.cxx  |    4 ++--
 chart2/source/model/template/ScatterChartType.hxx  |    5 +++--
 11 files changed, 26 insertions(+), 22 deletions(-)

New commits:
commit dfac5bf18b5568bd60b8f85a058010b8ec8d3bf7
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Oct 9 11:06:15 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Oct 9 13:24:27 2022 +0200

    tdf#151424 Spider web chart drawing error
    
    regression from
        commit 333ccb081b4ab62adce50ca4c93162b9baf984d0
        Author: Noel Grandin <noelgran...@gmail.com>
        Date:   Sat Feb 5 14:58:07 2022 +0200
        use more concrete types in chart2, Axis
    
    Change-Id: Ib80bbec9f08b9fafa6ee1c8d0cace8b44fdadabc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141135
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/inc/ChartType.hxx b/chart2/source/inc/ChartType.hxx
index a84d79893d5a..9821fdb6ff0a 100644
--- a/chart2/source/inc/ChartType.hxx
+++ b/chart2/source/inc/ChartType.hxx
@@ -69,7 +69,7 @@ public:
     // still abstract ! implement !
     virtual OUString SAL_CALL getChartType() override = 0;
     virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
-        createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
+        createCoordinateSystem( ::sal_Int32 DimensionCount ) final override;
     virtual css::uno::Sequence< OUString > SAL_CALL
         getSupportedMandatoryRoles() override;
     virtual css::uno::Sequence< OUString > SAL_CALL
@@ -103,8 +103,8 @@ public:
         const std::vector< rtl::Reference< ::chart::DataSeries > >& 
aDataSeries );
     const std::vector< rtl::Reference< ::chart::DataSeries > > & 
getDataSeries2() const { return m_aDataSeries; }
 
-    static rtl::Reference< ::chart::BaseCoordinateSystem >
-        createCoordinateSystem2( ::sal_Int32 DimensionCount );
+    virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+        createCoordinateSystem2( sal_Int32 DimensionCount );
 
 protected:
 
diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx 
b/chart2/source/model/main/BaseCoordinateSystem.cxx
index 127a7259e9a9..8a960e974e03 100644
--- a/chart2/source/model/main/BaseCoordinateSystem.cxx
+++ b/chart2/source/model/main/BaseCoordinateSystem.cxx
@@ -201,6 +201,8 @@ void SAL_CALL BaseCoordinateSystem::setAxisByDimension(
     if( nIndex < 0 )
         throw lang::IndexOutOfBoundsException();
 
+    assert(!xAxis || dynamic_cast<Axis*>(xAxis.get()));
+
     if( m_aAllAxis[ nDimensionIndex ].size() < o3tl::make_unsigned( nIndex+1 ))
     {
         m_aAllAxis[ nDimensionIndex ].resize( nIndex+1 );
diff --git a/chart2/source/model/template/BubbleChartType.cxx 
b/chart2/source/model/template/BubbleChartType.cxx
index 8a23388ab336..3521f7909fb7 100644
--- a/chart2/source/model/template/BubbleChartType.cxx
+++ b/chart2/source/model/template/BubbleChartType.cxx
@@ -116,8 +116,8 @@ rtl::Reference< ChartType > 
BubbleChartType::cloneChartType() const
 }
 
 // ____ XChartType ____
-Reference< chart2::XCoordinateSystem > SAL_CALL
-    BubbleChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+    BubbleChartType::createCoordinateSystem2( sal_Int32 DimensionCount )
 {
     rtl::Reference< CartesianCoordinateSystem > xResult =
         new CartesianCoordinateSystem( DimensionCount );
diff --git a/chart2/source/model/template/BubbleChartType.hxx 
b/chart2/source/model/template/BubbleChartType.hxx
index 10e82ae6a662..a2afa7e6941d 100644
--- a/chart2/source/model/template/BubbleChartType.hxx
+++ b/chart2/source/model/template/BubbleChartType.hxx
@@ -47,8 +47,6 @@ private:
         getSupportedMandatoryRoles() override;
     virtual css::uno::Sequence< OUString > SAL_CALL
         getSupportedPropertyRoles() override;
-    virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
-        createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
     virtual OUString SAL_CALL getRoleOfSequenceForSeriesLabel() override;
 
     // ____ OPropertySet ____
@@ -63,6 +61,9 @@ private:
 
     // ____ XCloneable ____
     virtual css::uno::Reference< css::util::XCloneable > SAL_CALL 
createClone() override;
+
+    virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+        createCoordinateSystem2( sal_Int32 DimensionCount ) override;
 };
 
 } //  namespace chart
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx 
b/chart2/source/model/template/ChartTypeTemplate.cxx
index 2e24dc2b5809..6dfff2b39d57 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -482,7 +482,7 @@ void ChartTypeTemplate::createCoordinateSystems(
     rtl::Reference< ChartType > xChartType( 
getChartTypeForNewSeries(aFormerlyUsedChartTypes));
     if( ! xChartType.is())
         return;
-    rtl::Reference< BaseCoordinateSystem > xCooSys = 
ChartType::createCoordinateSystem2( getDimension());
+    rtl::Reference< BaseCoordinateSystem > xCooSys = 
xChartType->createCoordinateSystem2( getDimension());
     if( ! xCooSys.is())
     {
         // chart type wants no coordinate systems
diff --git a/chart2/source/model/template/NetChartType.cxx 
b/chart2/source/model/template/NetChartType.cxx
index b3e809f901fe..cb4512c74884 100644
--- a/chart2/source/model/template/NetChartType.cxx
+++ b/chart2/source/model/template/NetChartType.cxx
@@ -48,8 +48,8 @@ NetChartType_Base::NetChartType_Base( const NetChartType_Base 
& rOther ) :
 NetChartType_Base::~NetChartType_Base()
 {}
 
-Reference< XCoordinateSystem > SAL_CALL
-    NetChartType_Base::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+    NetChartType_Base::createCoordinateSystem2( sal_Int32 DimensionCount )
 {
     if( DimensionCount != 2 )
         throw lang::IllegalArgumentException(
diff --git a/chart2/source/model/template/NetChartType.hxx 
b/chart2/source/model/template/NetChartType.hxx
index d9875be541a3..ae414a27c4e1 100644
--- a/chart2/source/model/template/NetChartType.hxx
+++ b/chart2/source/model/template/NetChartType.hxx
@@ -32,10 +32,6 @@ public:
 protected:
     explicit NetChartType_Base( const NetChartType_Base & rOther );
 
-    // ____ XChartType ____
-    virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
-        createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
-
     // ____ OPropertySet ____
     virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) 
const override;
 
@@ -44,6 +40,9 @@ protected:
     // ____ XPropertySet ____
     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
         getPropertySetInfo() override;
+
+    virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+        createCoordinateSystem2( sal_Int32 DimensionCount ) override;
 };
 
 class NetChartType final : public NetChartType_Base
diff --git a/chart2/source/model/template/PieChartType.cxx 
b/chart2/source/model/template/PieChartType.cxx
index b0f95e426f02..fdbfc7cedb5e 100644
--- a/chart2/source/model/template/PieChartType.cxx
+++ b/chart2/source/model/template/PieChartType.cxx
@@ -122,8 +122,8 @@ OUString SAL_CALL PieChartType::getChartType()
     return CHART2_SERVICE_NAME_CHARTTYPE_PIE;
 }
 
-Reference< chart2::XCoordinateSystem > SAL_CALL
-    PieChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+    PieChartType::createCoordinateSystem2( sal_Int32 DimensionCount )
 {
     rtl::Reference< PolarCoordinateSystem > xResult =
         new PolarCoordinateSystem( DimensionCount );
diff --git a/chart2/source/model/template/PieChartType.hxx 
b/chart2/source/model/template/PieChartType.hxx
index 0ecc0160393c..5a1e46f43d88 100644
--- a/chart2/source/model/template/PieChartType.hxx
+++ b/chart2/source/model/template/PieChartType.hxx
@@ -43,8 +43,6 @@ private:
 
     // ____ XChartType ____
     virtual OUString SAL_CALL getChartType() override;
-    virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
-        createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL
         getSupportedPropertyRoles() override;
 
@@ -60,6 +58,9 @@ private:
 
     // ____ XCloneable ____
     virtual css::uno::Reference< css::util::XCloneable > SAL_CALL 
createClone() override;
+
+    virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+        createCoordinateSystem2( sal_Int32 DimensionCount ) override;
 };
 
 } //  namespace chart
diff --git a/chart2/source/model/template/ScatterChartType.cxx 
b/chart2/source/model/template/ScatterChartType.cxx
index 9929a8e19b2d..cee026913b7f 100644
--- a/chart2/source/model/template/ScatterChartType.cxx
+++ b/chart2/source/model/template/ScatterChartType.cxx
@@ -128,8 +128,8 @@ rtl::Reference< ChartType > 
ScatterChartType::cloneChartType() const
 }
 
 // ____ XChartType ____
-Reference< chart2::XCoordinateSystem > SAL_CALL
-    ScatterChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+    ScatterChartType::createCoordinateSystem2( sal_Int32 DimensionCount )
 {
     rtl::Reference< CartesianCoordinateSystem > xResult =
         new CartesianCoordinateSystem( DimensionCount );
diff --git a/chart2/source/model/template/ScatterChartType.hxx 
b/chart2/source/model/template/ScatterChartType.hxx
index 03750e5d8f2a..f490c108ca56 100644
--- a/chart2/source/model/template/ScatterChartType.hxx
+++ b/chart2/source/model/template/ScatterChartType.hxx
@@ -45,8 +45,6 @@ private:
     virtual OUString SAL_CALL getChartType() override;
     virtual css::uno::Sequence< OUString > SAL_CALL
         getSupportedMandatoryRoles() override;
-    virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
-        createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
 
     // ____ OPropertySet ____
     virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) 
const override;
@@ -60,6 +58,9 @@ private:
 
     // ____ XCloneable ____
     virtual css::uno::Reference< css::util::XCloneable > SAL_CALL 
createClone() override;
+
+    virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+        createCoordinateSystem2( sal_Int32 DimensionCount ) override;
 };
 
 } //  namespace chart

Reply via email to