summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/ChartView.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-01-23 13:46:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-23 14:44:17 +0100
commit4007a8135a689221e30b69b849beea674a8e63d0 (patch)
treed581b5b660337a923faff3a09e964c067740179f /chart2/source/view/main/ChartView.cxx
parentbc518de4b9ae9d5985b3706dd4fbf60a0d6e1a79 (diff)
use more concrete types in chart2, ChartModel
Change-Id: Icee63a8a9d2e63f05064506df6c2d36314fe05c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view/main/ChartView.cxx')
-rw-r--r--chart2/source/view/main/ChartView.cxx26
1 files changed, 17 insertions, 9 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index de1dc6db0fa0..112bb1b91b42 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -414,7 +414,7 @@ VCoordinateSystem* addCooSysToList( std::vector< std::unique_ptr<VCoordinateSyst
if(!pVCooSys)
return nullptr;
- OUString aCooSysParticle( ObjectIdentifier::createParticleForCoordinateSystem( xCooSys, rChartModel ) );
+ OUString aCooSysParticle( ObjectIdentifier::createParticleForCoordinateSystem( xCooSys, &rChartModel ) );
pVCooSys->setParticle(aCooSysParticle);
pVCooSys->setExplicitCategoriesProvider( new ExplicitCategoriesProvider(xCooSys, rChartModel) );
@@ -1400,7 +1400,6 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
SeriesPlottersType& rSeriesPlotterList = rParam.mpSeriesPlotterContainer->getSeriesPlotterList();
//create VAxis, so they can give necessary information for automatic scaling
- uno::Reference<chart2::XChartDocument> const xChartDoc(&mrChartModel);
uno::Reference<util::XNumberFormatsSupplier> const xNumberFormatsSupplier(
mrChartModel.getNumberFormatsSupplier());
size_t nC = 0;
@@ -1416,7 +1415,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
pVCooSys->set3DWallPositions( eLeftWallPos, eBackWallPos, eBottomPos );
}
- pVCooSys->createVAxisList(xChartDoc, rPageSize, rParam.maRemainingSpace, rParam.mbUseFixedInnerSize);
+ pVCooSys->createVAxisList(&mrChartModel, rPageSize, rParam.maRemainingSpace, rParam.mbUseFixedInnerSize);
}
// - prepare list of all axis and how they are used
@@ -1818,7 +1817,16 @@ bool lcl_getPropertySwapXAndYAxis( const rtl::Reference< Diagram >& xDiagram )
sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
const Reference< chart2::XAxis >& xAxis
, const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
- , const Reference<chart2::XChartDocument>& xChartDoc)
+ , const css::uno::Reference< css::chart2::XChartDocument>& xChartDoc)
+{
+ return AxisHelper::getExplicitNumberFormatKeyForAxis( xAxis, xCorrespondingCoordinateSystem, xChartDoc
+ , true /*bSearchForParallelAxisIfNothingIsFound*/ );
+}
+
+sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
+ const Reference< chart2::XAxis >& xAxis
+ , const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
+ , const rtl::Reference<::chart::ChartModel>& xChartDoc)
{
return AxisHelper::getExplicitNumberFormatKeyForAxis( xAxis, xCorrespondingCoordinateSystem, xChartDoc
, true /*bSearchForParallelAxisIfNothingIsFound*/ );
@@ -1888,28 +1896,28 @@ awt::Rectangle ExplicitValueProvider::AddSubtractAxisTitleSizes(
if( xTitle_Height.is() )
{
- OUString aCID_X( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle_Height, rModel ) );
+ OUString aCID_X( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle_Height, &rModel ) );
nTitleSpaceHeight = pExplicitValueProvider->getRectangleOfObject( aCID_X, true ).Height;
if( nTitleSpaceHeight )
nTitleSpaceHeight+=lcl_getDiagramTitleSpace();
}
if( xTitle_Width.is() )
{
- OUString aCID_Y( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle_Width, rModel ) );
+ OUString aCID_Y( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle_Width, &rModel ) );
nTitleSpaceWidth = pExplicitValueProvider->getRectangleOfObject( aCID_Y, true ).Width;
if(nTitleSpaceWidth)
nTitleSpaceWidth+=lcl_getDiagramTitleSpace();
}
if( xSecondTitle_Height.is() )
{
- OUString aCID_X( ObjectIdentifier::createClassifiedIdentifierForObject( xSecondTitle_Height, rModel ) );
+ OUString aCID_X( ObjectIdentifier::createClassifiedIdentifierForObject( xSecondTitle_Height, &rModel ) );
nSecondTitleSpaceHeight = pExplicitValueProvider->getRectangleOfObject( aCID_X, true ).Height;
if( nSecondTitleSpaceHeight )
nSecondTitleSpaceHeight+=lcl_getDiagramTitleSpace();
}
if( xSecondTitle_Width.is() )
{
- OUString aCID_Y( ObjectIdentifier::createClassifiedIdentifierForObject( xSecondTitle_Width, rModel ) );
+ OUString aCID_Y( ObjectIdentifier::createClassifiedIdentifierForObject( xSecondTitle_Width, &rModel ) );
nSecondTitleSpaceWidth += pExplicitValueProvider->getRectangleOfObject( aCID_Y, true ).Width;
if( nSecondTitleSpaceWidth )
nSecondTitleSpaceWidth+=lcl_getDiagramTitleSpace();
@@ -2109,7 +2117,7 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
bYAxisTitle = true;
}
apVTitle = std::make_shared<VTitle>(xTitle);
- OUString aCID = ObjectIdentifier::createClassifiedIdentifierForObject(xTitle, rModel);
+ OUString aCID = ObjectIdentifier::createClassifiedIdentifierForObject(xTitle, &rModel);
apVTitle->init(xPageShapes, aCID);
apVTitle->createShapes(awt::Point(0, 0), rPageSize, aTextMaxWidth, bYAxisTitle);
awt::Size aTitleUnrotatedSize = apVTitle->getUnrotatedSize();