diff options
Diffstat (limited to 'sc/source/ui/vba/vbaworksheets.cxx')
-rw-r--r-- | sc/source/ui/vba/vbaworksheets.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 7c209dd42bbe..0a9a79401d3a 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -350,17 +350,16 @@ void SAL_CALL ScVbaWorksheets::setVisible( const uno::Any& _visible ) { bool bState = false; - if ( _visible >>= bState ) + if ( !(_visible >>= bState) ) + throw uno::RuntimeException("Visible property doesn't support non boolean #FIXME" ); + + uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_QUERY_THROW ); + while ( xEnum->hasMoreElements() ) { - uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_QUERY_THROW ); - while ( xEnum->hasMoreElements() ) - { - uno::Reference< excel::XWorksheet > xSheet( xEnum->nextElement(), uno::UNO_QUERY_THROW ); - xSheet->setVisible( bState ? 1 : 0 ); - } + uno::Reference< excel::XWorksheet > xSheet( xEnum->nextElement(), uno::UNO_QUERY_THROW ); + xSheet->setVisible( bState ? 1 : 0 ); } - else - throw uno::RuntimeException("Visible property doesn't support non boolean #FIXME" ); + } void SAL_CALL |