diff options
author | David Tardon <dtardon@redhat.com> | 2016-05-17 15:54:17 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-05-17 15:54:35 +0200 |
commit | 55a7d9ff6c2f754ea8ba1def8c1ff464629eb81d (patch) | |
tree | 5bf3ad34575b011c05795c2de27de5c0b4bc5478 /chart2 | |
parent | b0f964d3c32b276613b07b3cc0312ed94618169f (diff) |
avoid assert
Change-Id: I60ea0f29226d12e98ed88716d092d7f9f7df184f
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/BarChart.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx index 411fb4ccb2f1..a082d21b121a 100644 --- a/chart2/source/view/charttypes/BarChart.cxx +++ b/chart2/source/view/charttypes/BarChart.cxx @@ -468,6 +468,10 @@ void BarChart::createShapes() if( aLogicYSumMap.find(nAttachedAxisIndex)==aLogicYSumMap.end() ) aLogicYSumMap[nAttachedAxisIndex]=0.0; + const sal_Int32 nSlotPoints = aXSlotIter->getPointCount(); + if( nPointIndex >= nSlotPoints ) + continue; + double fMinimumY = 0.0, fMaximumY = 0.0; aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex , isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex ); @@ -510,8 +514,9 @@ void BarChart::createShapes() // get distance from base value to maximum and minimum double fMinimumY = 0.0, fMaximumY = 0.0; - aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex - , isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex ); + if( nPointIndex < aXSlotIter->getPointCount()) + aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex + , isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex ); double fLogicPositiveYSum = 0.0; if( !::rtl::math::isNan( fMaximumY ) ) |