diff options
Diffstat (limited to 'vbahelper/source/msforms/vbalistbox.cxx')
-rw-r--r-- | vbahelper/source/msforms/vbalistbox.cxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx index 8538fc29bc..437a95b99f 100644 --- a/vbahelper/source/msforms/vbalistbox.cxx +++ b/vbahelper/source/msforms/vbalistbox.cxx @@ -108,9 +108,13 @@ ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException) "Attribute use invalid." ), uno::Reference< uno::XInterface >() ); uno::Sequence< sal_Int16 > nSelectedIndices(1); + uno::Sequence< sal_Int16 > nOldSelectedIndices; + m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nOldSelectedIndices; nSelectedIndices[ 0 ] = nValue; m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) ); - m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) ); + if ( nSelectedIndices != nOldSelectedIndices ) + fireClickEvent(); + //m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) ); //liuchen 2009-8-12 solve the problem that ListBox.Text and ListBox.Value cannot be set } ::rtl::OUString SAL_CALL @@ -127,20 +131,22 @@ ScVbaListBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeExcepti setValue( uno::makeAny( _text ) ); // seems the same } -sal_Bool SAL_CALL +sal_Int32 SAL_CALL ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException) { sal_Bool bMultiSelect = sal_False; m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ) ) >>= bMultiSelect; - return bMultiSelect; + return bMultiSelect ? 1 : 0 ; } void SAL_CALL -ScVbaListBox::setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException) +ScVbaListBox::setMultiSelect( sal_Int32 _multiselect ) throw (css::uno::RuntimeException) { - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( _multiselect ) ); + sal_Bool bMultiSelect = _multiselect == 1 ? 1 : 0; + m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( bMultiSelect ) ); } + css::uno::Any SAL_CALL ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException) { @@ -205,6 +211,7 @@ ScVbaListBox::setValueEvent( const uno::Any& value ) } nList.realloc( nLength - 1 ); //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) ); + fireClickEvent(); m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) ); return; } @@ -223,6 +230,7 @@ ScVbaListBox::setValueEvent( const uno::Any& value ) nList[0] = nIndex; } //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) ); + fireClickEvent(); m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) ); } } |