tdf#151424 Spider web chart drawing error
regression from
commit 333ccb081b4ab62adce50ca4c93162b9baf984d0
Author: Noel Grandin <noelgrandin@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.grandin@collabora.co.uk>
diff --git a/chart2/source/inc/ChartType.hxx b/chart2/source/inc/ChartType.hxx
index a84d798..9821fdb 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 127a725..8a960e9 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 8a23388..3521f79 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 10e82ae..a2afa7e 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 2e24dc2..6dfff2b 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 b3e809f..cb4512c 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 d9875be..ae414a2 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 b0f95e4..fdbfc7ce 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 0ecc016..5a1e46f 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 9929a8e..cee0269 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 03750e5..f490c10 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