From 988bfa3debf00bd36e0a7225aa44a88a979729db Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 9 Oct 2000 07:28:58 +0000 Subject: #79288# #79289# #79290# Exceptions in ScFunctionListObj --- sc/source/ui/unoobj/appluno.cxx | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'sc/source/ui/unoobj/appluno.cxx') diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index 71bd17aeb9df..d679ac307909 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: appluno.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: nn $ $Date: 2000-09-28 18:18:56 $ + * last change: $Author: nn $ $Date: 2000-10-09 08:28:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -674,7 +674,12 @@ uno::Sequence SAL_CALL ScFunctionListObj::getById( sal_Int return aSeq; } } + + throw lang::IllegalArgumentException(); // not found } + else + throw uno::RuntimeException(); // should not happen + return uno::Sequence(0); } @@ -703,7 +708,12 @@ uno::Any SAL_CALL ScFunctionListObj::getByName( const rtl::OUString& aName ) return aAny; } } + + throw container::NoSuchElementException(); // not found } + else + throw uno::RuntimeException(); // should not happen + return uno::Any(); } @@ -725,18 +735,26 @@ uno::Any SAL_CALL ScFunctionListObj::getByIndex( sal_Int32 nIndex ) { ScUnoGuard aGuard; const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList(); - if ( pFuncList && nIndex >= 0 && nIndex < pFuncList->GetCount() ) + if ( pFuncList ) { - const ScFuncDesc* pDesc = pFuncList->GetFunction(nIndex); - if ( pDesc ) + if ( nIndex >= 0 && nIndex < pFuncList->GetCount() ) { - uno::Sequence aSeq( SC_FUNCDESC_PROPCOUNT ); - lcl_FillSequence( aSeq, *pDesc ); - uno::Any aAny; - aAny <<= aSeq; - return aAny; + const ScFuncDesc* pDesc = pFuncList->GetFunction(nIndex); + if ( pDesc ) + { + uno::Sequence aSeq( SC_FUNCDESC_PROPCOUNT ); + lcl_FillSequence( aSeq, *pDesc ); + uno::Any aAny; + aAny <<= aSeq; + return aAny; + } } + + throw lang::IndexOutOfBoundsException(); // illegal index } + else + throw uno::RuntimeException(); // should not happen + return uno::Any(); } -- cgit v1.2.3