diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2011-03-28 12:43:38 +0200 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2011-03-28 12:43:38 +0200 |
commit | 5c5c66291c468a2c01eb4305a31ca64b4c1fb659 (patch) | |
tree | 9fb94fc04cfb74e2e674375f6e8596acc32e8fbc | |
parent | d1660aff78a18133b95ce37dc76222b5c79fab54 (diff) |
calcvba: try to extract different types as numeric index
-rwxr-xr-x | vbahelper/source/vbahelper/collectionbase.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vbahelper/source/vbahelper/collectionbase.cxx b/vbahelper/source/vbahelper/collectionbase.cxx index 7a99aabecd..16fc673f54 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 ------------------------------------------------------------------ |