diff options
Diffstat (limited to 'vbahelper/source/msforms/vbacombobox.cxx')
-rw-r--r-- | vbahelper/source/msforms/vbacombobox.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx index 07c937ccbb05..dc10964bf3cf 100644 --- a/vbahelper/source/msforms/vbacombobox.cxx +++ b/vbahelper/source/msforms/vbacombobox.cxx @@ -66,21 +66,21 @@ void SAL_CALL ScVbaComboBox::setListIndex( const uno::Any& _value ) { sal_Int16 nIndex = 0; - if( _value >>= nIndex ) + if( !(_value >>= nIndex) ) + return; + + sal_Int32 nOldIndex = -1; + getListIndex() >>= nOldIndex; + uno::Sequence< OUString > sItems; + m_xProps->getPropertyValue( "StringItemList" ) >>= sItems; + if( ( nIndex >= 0 ) && ( sItems.getLength() > nIndex ) ) { - sal_Int32 nOldIndex = -1; - getListIndex() >>= nOldIndex; - uno::Sequence< OUString > sItems; - m_xProps->getPropertyValue( "StringItemList" ) >>= sItems; - if( ( nIndex >= 0 ) && ( sItems.getLength() > nIndex ) ) - { - OUString sText = sItems[ nIndex ]; - m_xProps->setPropertyValue( "Text", uno::makeAny( sText ) ); + OUString sText = sItems[ nIndex ]; + m_xProps->setPropertyValue( "Text", uno::makeAny( sText ) ); - // fire the _Change event - if( nOldIndex != nIndex ) - fireClickEvent(); - } + // fire the _Change event + if( nOldIndex != nIndex ) + fireClickEvent(); } } |