summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-03-12 13:04:15 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-13 06:53:34 +0000
commit898f3541371a3fc59afb0907d3397a4876791789 (patch)
treec07511bc722a088a59d91d4e4131f8f14edb8416 /chart2/source
parentb8261a99ae537078e0bc1c62154fc6c66c7556b4 (diff)
cppcheck: unsignedLessThanZero
some stuff cppcheck missed in this file. plus use empty() and front() Change-Id: I612078d503c555afd681526f95d17502ffd585ba Reviewed-on: https://gerrit.libreoffice.org/35094 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index f737a943e7de..669143f26277 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -388,16 +388,16 @@ double PieChart::getMaxOffset()
return m_fMaxOffset;
m_fMaxOffset = 0.0;
- if( m_aZSlots.size()<=0 )
+ if( m_aZSlots.empty() )
return m_fMaxOffset;
- if( m_aZSlots[0].size()<=0 )
+ if( m_aZSlots.front().empty() )
return m_fMaxOffset;
- const std::vector< VDataSeries* >& rSeriesList( m_aZSlots[0][0].m_aSeriesVector );
- if(!rSeriesList.size())
+ const std::vector< VDataSeries* >& rSeriesList( m_aZSlots.front().front().m_aSeriesVector );
+ if(rSeriesList.empty())
return m_fMaxOffset;
- VDataSeries* pSeries = rSeriesList[0];
+ VDataSeries* pSeries = rSeriesList.front();
uno::Reference< beans::XPropertySet > xSeriesProp( pSeries->getPropertiesOfSeries() );
if( !xSeriesProp.is() )
return m_fMaxOffset;
@@ -430,8 +430,8 @@ double PieChart::getMaxOffset()
double PieChart::getMaximumX()
{
double fMaxOffset = getMaxOffset();
- if( m_aZSlots.size()>0 && m_bUseRings)
- return m_aZSlots[0].size()+0.5+fMaxOffset;
+ if( !m_aZSlots.empty() && m_bUseRings)
+ return m_aZSlots.front().size()+0.5+fMaxOffset;
return 1.5+fMaxOffset;
}
double PieChart::getMinimumYInRange( double /* fMinimumX */, double /* fMaximumX */, sal_Int32 /* nAxisIndex */ )
@@ -510,8 +510,8 @@ void PieChart::createShapes()
///that the radius axis scale is the one with index 0 and the angle axis
///scale is the one with index 1.
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = m_aZSlots[0].begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = m_aZSlots[0].end();
+ std::vector< VDataSeriesGroup >::iterator aXSlotIter = m_aZSlots.front().begin();
+ const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = m_aZSlots.front().end();
///m_bUseRings == true if chart type is `donut`, == false if chart type is
///`pie`; if the chart is of `donut` type we have as many rings as many data
@@ -528,7 +528,7 @@ void PieChart::createShapes()
///such a case the `explodeable` ring is the last one.
std::vector< VDataSeriesGroup >::size_type nExplodeableSlot = 0;
if( m_pPosHelper->isMathematicalOrientationRadius() && m_bUseRings )
- nExplodeableSlot = m_aZSlots[0].size()-1;
+ nExplodeableSlot = m_aZSlots.front().size()-1;
m_aLabelInfoList.clear();
::rtl::math::setNan(&m_fMaxOffset);
@@ -552,9 +552,9 @@ void PieChart::createShapes()
ShapeParam aParam;
std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
- if(!pSeriesList->size())//there should be only one series in each x slot
+ if(pSeriesList->empty())//there should be only one series in each x slot
continue;
- VDataSeries* pSeries = (*pSeriesList)[0];
+ VDataSeries* pSeries = pSeriesList->front();
if(!pSeries)
continue;