summaryrefslogtreecommitdiff
path: root/chart2/source/view/charttypes/AreaChart.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/charttypes/AreaChart.cxx')
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 22d952b8eeff..7ecf7e9ebeeb 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -144,7 +144,7 @@ drawing::Direction3D AreaChart::getPreferredDiagramAspectRatio() const
return aRet;
}
-void AreaChart::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot )
+void AreaChart::addSeries( std::unique_ptr<VDataSeries> pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot )
{
if( m_bArea && pSeries )
{
@@ -160,7 +160,7 @@ void AreaChart::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32 xSlo
xSlot=0;
ySlot=0;
}
- VSeriesPlotter::addSeries( pSeries, zSlot, xSlot, ySlot );
+ VSeriesPlotter::addSeries( std::move(pSeries), zSlot, xSlot, ySlot );
}
void lcl_removeDuplicatePoints( drawing::PolyPolygonShape3D& rPolyPoly, PlottingPositionHelper& rPosHelper )
@@ -540,7 +540,7 @@ void AreaChart::impl_createSeriesShapes()
drawing::PolyPolygonShape3D* pSeriesPoly = nullptr;
//iterate through all series
- for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
+ for( std::unique_ptr<VDataSeries> const & pSeries : rXSlot.m_aSeriesVector )
{
sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
@@ -554,12 +554,12 @@ void AreaChart::impl_createSeriesShapes()
pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
if( m_bArea )
{
- if( !impl_createArea( pSeries, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
+ if( !impl_createArea( pSeries.get(), pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
continue;
}
if( m_bLine )
{
- if( !impl_createLine( pSeries, pSeriesPoly, pPosHelper ) )
+ if( !impl_createLine( pSeries.get(), pSeriesPoly, pPosHelper ) )
continue;
}
aPreviousSeriesPolyMap[nAttachedAxisIndex] = pSeriesPoly;
@@ -586,13 +586,12 @@ void lcl_reorderSeries( std::vector< std::vector< VDataSeriesGroup > >& rZSlots
std::vector< VDataSeriesGroup >::reverse_iterator aXIt( aZIt->rbegin() );
std::vector< VDataSeriesGroup >::reverse_iterator aXEnd( aZIt->rend() );
for( ; aXIt != aXEnd; ++aXIt )
- aXSlot.push_back(*aXIt);
+ aXSlot.push_back(std::move(*aXIt));
- aRet.push_back(aXSlot);
+ aRet.push_back(std::move(aXSlot));
}
- rZSlots.clear();
- rZSlots = aRet;
+ rZSlots = std::move(aRet);
}
}//anonymous namespace
@@ -664,7 +663,7 @@ void AreaChart::createShapes()
//iterate through all x slots in this category to get 100percent sum
for( auto const& rXSlot : rZSlot )
{
- for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
+ for( std::unique_ptr<VDataSeries> const & pSeries : rXSlot.m_aSeriesVector )
{
if(!pSeries)
continue;
@@ -701,12 +700,12 @@ void AreaChart::createShapes()
{
std::vector<std::map< sal_Int32, double > > aLogicYForNextSeriesMapByX(nEndIndex); //one for each different nAttachedAxisIndex
//iterate through all series
- for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
+ for( std::unique_ptr<VDataSeries> const & pSeries : rXSlot.m_aSeriesVector )
{
if(!pSeries)
continue;
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(pSeries, m_xSeriesTarget);
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(pSeries.get(), m_xSeriesTarget);
sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
@@ -789,7 +788,7 @@ void AreaChart::createShapes()
drawing::Position3D aScenePosition( pPosHelper->transformLogicToScene( fLogicX,fLogicY,fLogicZ, false ) );
//better performance for big data
- FormerPoint aFormerPoint( aSeriesFormerPointMap[pSeries] );
+ FormerPoint aFormerPoint( aSeriesFormerPointMap[pSeries.get()] );
pPosHelper->setCoordinateSystemResolution( m_aCoordinateSystemResolution );
if( !pSeries->isAttributedDataPoint(nIndex)
&&
@@ -800,7 +799,7 @@ void AreaChart::createShapes()
m_bPointsWereSkipped = true;
continue;
}
- aSeriesFormerPointMap[pSeries] = FormerPoint(aScaledLogicPosition.PositionX, aScaledLogicPosition.PositionY, aScaledLogicPosition.PositionZ);
+ aSeriesFormerPointMap[pSeries.get()] = FormerPoint(aScaledLogicPosition.PositionX, aScaledLogicPosition.PositionY, aScaledLogicPosition.PositionZ);
//store point information for series polygon
//for area and/or line (symbols only do not need this)