summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-03-28 12:43:38 +0200
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-03-28 12:43:38 +0200
commit851d6112c1e3b09ebeae211b6b997bffad6461e3 (patch)
tree918f3fb7625818e429c23a4d91a59224aab41455 /vbahelper
parent620ecfa0dd997c747b45ba29da656353526ec0e2 (diff)
calcvba: try to extract different types as numeric index
Diffstat (limited to 'vbahelper')
-rwxr-xr-xvbahelper/source/vbahelper/collectionbase.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vbahelper/source/vbahelper/collectionbase.cxx b/vbahelper/source/vbahelper/collectionbase.cxx
index 7a99aabecdf8..16fc673f54d5 100755
--- a/vbahelper/source/vbahelper/collectionbase.cxx
+++ b/vbahelper/source/vbahelper/collectionbase.cxx
@@ -314,11 +314,10 @@ uno::Any CollectionBase::getAnyItemOrThis( const uno::Any& rIndex ) throw (uno::
{
if( !rIndex.hasValue() )
return uno::Any( uno::Reference< XCollectionBase >( this ) );
- if( rIndex.has< sal_Int32 >() )
- return getItemByIndex( rIndex.get< sal_Int32 >() );
if( rIndex.has< ::rtl::OUString >() )
return getItemByName( rIndex.get< ::rtl::OUString >() );
- throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid item index." ) ), 0 );
+ // extractIntFromAny() throws if no index can be extracted
+ return getItemByIndex( extractIntFromAny( rIndex ) );
}
// protected ------------------------------------------------------------------