summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-04-05 02:50:40 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-05 18:34:22 +0200
commit291bf3b84f423217959b38b46a16055947c9e84e (patch)
tree8d42feb5c44f5056d680428e2a416c8a97e171b9 /chart2
parentbe8f375039e854775bbb4e03b68d444a9b157e95 (diff)
prevent excessive exceptions
They hide the interesting parts that I'm interested in and are always thrown so let us avoid them Change-Id: I532a3fe678de7d3ac0776db23363df5d35c793eb
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/AxisHelper.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index 4b372ca4275e..65c297fb6b01 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -597,14 +597,18 @@ Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAx
, const Reference< XCoordinateSystem >& xCooSys )
{
Reference< XAxis > xRet;
- try
- {
- if( xCooSys.is() )
- xRet.set( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
- }
- catch( const uno::Exception & )
- {
- }
+ if(!xCooSys.is())
+ return xRet;
+
+ if(nDimensionIndex >= xCooSys->getDimension())
+ return xRet;
+
+ if(nAxisIndex > xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex))
+ return xRet;
+
+ assert(nAxisIndex >= 0);
+ assert(nDimensionIndex >= 0);
+ xRet.set( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
return xRet;
}