diff options
Diffstat (limited to 'sc/source/ui/vba/vbaworkbook.cxx')
-rw-r--r-- | sc/source/ui/vba/vbaworkbook.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index 53063bd0e4fc..bf880e473af3 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -382,18 +382,16 @@ ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException) } uno::Any SAL_CALL -ScVbaWorkbook::Names( const css::uno::Any& aIndex ) throw (uno::RuntimeException) +ScVbaWorkbook::Names( const uno::Any& aIndex ) throw (uno::RuntimeException) { - uno::Reference< frame::XModel > xModel( getModel() ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xProps( xModel, uno::UNO_QUERY_THROW ); uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NamedRanges") ) ), uno::UNO_QUERY_THROW ); - uno::Reference< XCollection > xNames( new ScVbaNames( this , mxContext , xNamedRanges , xModel )); - if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID ) - { + uno::Reference< XCollection > xNames( new ScVbaNames( this, mxContext, xNamedRanges, xModel ) ); + if ( aIndex.hasValue() ) + return uno::Any( xNames->Item( aIndex, uno::Any() ) ); return uno::Any( xNames ); } - return uno::Any( xNames->Item( aIndex, uno::Any() ) ); -} rtl::OUString& ScVbaWorkbook::getServiceImplName() |