[Libreoffice-commits] core.git: chart2/source
David Tardon
dtardon at redhat.com
Tue May 17 13:55:44 UTC 2016
chart2/source/view/charttypes/BarChart.cxx | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 55a7d9ff6c2f754ea8ba1def8c1ff464629eb81d
Author: David Tardon <dtardon at redhat.com>
Date: Tue May 17 15:54:17 2016 +0200
avoid assert
Change-Id: I60ea0f29226d12e98ed88716d092d7f9f7df184f
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 411fb4c..a082d21 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 ) )
More information about the Libreoffice-commits
mailing list