summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-10-09 11:06:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-09 13:24:27 +0200
commitdfac5bf18b5568bd60b8f85a058010b8ec8d3bf7 (patch)
treef3671c400146e17882c0602f66d41f72fe761188 /chart2/source
parent286347aec204e062e47842b7d62d734fa8513d79 (diff)
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>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/inc/ChartType.hxx6
-rw-r--r--chart2/source/model/main/BaseCoordinateSystem.cxx2
-rw-r--r--chart2/source/model/template/BubbleChartType.cxx4
-rw-r--r--chart2/source/model/template/BubbleChartType.hxx5
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx2
-rw-r--r--chart2/source/model/template/NetChartType.cxx4
-rw-r--r--chart2/source/model/template/NetChartType.hxx7
-rw-r--r--chart2/source/model/template/PieChartType.cxx4
-rw-r--r--chart2/source/model/template/PieChartType.hxx5
-rw-r--r--chart2/source/model/template/ScatterChartType.cxx4
-rw-r--r--chart2/source/model/template/ScatterChartType.hxx5
11 files changed, 26 insertions, 22 deletions
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