summaryrefslogtreecommitdiff
path: root/chart2/source/tools/InternalDataProvider.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-27 18:19:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-28 20:56:19 +0100
commit642e98613ad4479f7601ea8cec78754546f563d1 (patch)
tree30003490094358f378273b44ce11838e79643f09 /chart2/source/tools/InternalDataProvider.cxx
parent38358c6b1630d1d003e3a6e8289ab36bf4d40546 (diff)
use more concrete types in chart2, ChartModel
Change-Id: Idd686acd0e8acaafcbbd18a4d6b0f298cc577784 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129111 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools/InternalDataProvider.cxx')
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 7a2fdb3aed84..696611e80fa3 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -309,22 +309,18 @@ InternalDataProvider::InternalDataProvider()
{}
InternalDataProvider::InternalDataProvider(
- const Reference< chart2::XChartDocument > & xChartDoc,
+ const rtl::Reference< ChartModel > & xModel,
bool bConnectToModel,
bool bDefaultDataInColumns)
: m_bDataInColumns( bDefaultDataInColumns )
{
- if (!xChartDoc.is())
+ if (!xModel.is())
return;
try
{
- auto pModel = dynamic_cast<ChartModel*>(xChartDoc.get());
- assert(pModel);
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( pModel ) );
+ rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xModel ) );
if( xDiagram.is())
{
- Reference< frame::XModel > xChartModel = xChartDoc;
-
//data in columns?
{
OUString aRangeString;
@@ -333,7 +329,7 @@ InternalDataProvider::InternalDataProvider(
uno::Sequence< sal_Int32 > aSequenceMapping;
const bool bSomethingDetected(
DataSourceHelper::detectRangeSegmentation(
- pModel, aRangeString, aSequenceMapping, m_bDataInColumns, bFirstCellAsLabel, bHasCategories ));
+ xModel, aRangeString, aSequenceMapping, m_bDataInColumns, bFirstCellAsLabel, bHasCategories ));
// #i120559# if no data was available, restore default
if(!bSomethingDetected && m_bDataInColumns != bDefaultDataInColumns)
@@ -346,7 +342,7 @@ InternalDataProvider::InternalDataProvider(
{
vector< vector< uno::Any > > aNewCategories;//inner count is level
{
- ExplicitCategoriesProvider aExplicitCategoriesProvider(ChartModelHelper::getFirstCoordinateSystem(pModel), *pModel);
+ ExplicitCategoriesProvider aExplicitCategoriesProvider(ChartModelHelper::getFirstCoordinateSystem(xModel), *xModel);
const Sequence< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() );
sal_Int32 nLevelCount = rSplitCategoriesList.getLength();
@@ -390,7 +386,7 @@ InternalDataProvider::InternalDataProvider(
}
// data series
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( pModel ));
+ std::vector< Reference< chart2::XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( xModel ));
lcl_internalizeSeries ftor( m_aInternalData, *this, bConnectToModel, m_bDataInColumns );
for( const auto& rxScreen : aSeriesVector )
ftor( rxScreen );