diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-15 16:32:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-17 16:31:35 +0000 |
commit | 7a519bc2afec54f1c4c78d30023415d7ae7dc6c4 (patch) | |
tree | 65f48596819ed21a6ae65d9bdd3f7e6e6f1abce7 /chart2/source/view | |
parent | 2327015285ef31430d8b6a1c18b45d3da1890306 (diff) |
move getChartTypeByIndex inside chart2::Diagram
Change-Id: Idff60dbd7c1cdb8c60e7ac07ad3abe3c6b07e321
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149050
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/diagram/VDiagram.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx index bc41f117ef5c..fb349282fd8d 100644 --- a/chart2/source/view/diagram/VDiagram.cxx +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -56,7 +56,7 @@ VDiagram::VDiagram( ThreeDHelper::getRotationAngleFromDiagram( xDiagram, m_fXAnglePi, m_fYAnglePi, m_fZAnglePi ); if( ChartTypeHelper::isSupportingRightAngledAxes( - DiagramHelper::getChartTypeByIndex( m_xDiagram, 0 ) ) ) + m_xDiagram->getChartTypeByIndex( 0 ) ) ) { if(xDiagram.is()) xDiagram->getPropertyValue("RightAngledAxes") >>= m_bRightAngledAxes; diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index e315b354136c..a102821cc409 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -927,7 +927,9 @@ bool getAvailablePosAndSizeForDiagram( rParam.mbUseFixedInnerSize = false; //@todo: we need a size dependent on the axis labels - rtl::Reference<ChartType> xChartType(DiagramHelper::getChartTypeByIndex(xDiagram, 0)); + rtl::Reference<ChartType> xChartType; + if (xDiagram) + xChartType = xDiagram->getChartTypeByIndex(0); sal_Int32 nXDistance = sal_Int32(rPageSize.Width * constPageLayoutDistancePercentage); sal_Int32 nYDistance = sal_Int32(rPageSize.Height * constPageLayoutDistancePercentage); @@ -1992,7 +1994,9 @@ bool ChartView::createAxisTitleShapes2D( CreateShapeParam2D& rParam, const css:: { rtl::Reference<Diagram> xDiagram = mrChartModel.getFirstChartDiagram(); - rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); + rtl::Reference< ChartType > xChartType; + if (xDiagram) + xChartType = xDiagram->getChartTypeByIndex( 0 ); sal_Int32 nDimension = DiagramHelper::getDimension( xDiagram ); if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 0 ) ) |