diff options
author | Noel Power <noel.power@suse.com> | 2013-04-19 17:19:03 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-05-09 14:11:15 +0100 |
commit | 2743241bd299b87da21c7888b4339a77f1e5c44c (patch) | |
tree | e133894f4a0de12604c559dca952fef4f83a05db | |
parent | 37cc1bb26fe91ce02f68e37930f00951bdec63a0 (diff) |
ListBox.MultiSelection takes fmMultiSelect enum not bool
Change-Id: Ic9ea60feadc551b232b393faafea9760cc3b82f0
-rw-r--r-- | oovbaapi/ooo/vba/msforms/XListBox.idl | 2 | ||||
-rw-r--r-- | vbahelper/source/msforms/vbalistbox.cxx | 24 | ||||
-rw-r--r-- | vbahelper/source/msforms/vbalistbox.hxx | 4 |
3 files changed, 23 insertions, 7 deletions
diff --git a/oovbaapi/ooo/vba/msforms/XListBox.idl b/oovbaapi/ooo/vba/msforms/XListBox.idl index 6bf25e98817d..f7b312ee7bf4 100644 --- a/oovbaapi/ooo/vba/msforms/XListBox.idl +++ b/oovbaapi/ooo/vba/msforms/XListBox.idl @@ -31,7 +31,7 @@ interface XListBox { [attribute] any Value; [attribute] string Text; - [attribute] boolean MultiSelect; + [attribute] long MultiSelect; [attribute] any ListIndex; [attribute, readonly] long ListCount; [attribute, readonly] XNewFont Font; diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx index 483985ea26cd..152598398b92 100644 --- a/vbahelper/source/msforms/vbalistbox.cxx +++ b/vbahelper/source/msforms/vbalistbox.cxx @@ -22,6 +22,7 @@ #include <comphelper/anytostring.hxx> #include <com/sun/star/script/ArrayWrapper.hpp> #include <com/sun/star/form/validation/XValidatableFormComponent.hpp> +#include <ooo/vba/msforms/fmMultiSelect.hpp> using namespace com::sun::star; using namespace ooo::vba; @@ -120,18 +121,33 @@ ScVbaListBox::setText( const OUString& _text ) throw (uno::RuntimeException) 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( "MultiSelection" ) >>= bMultiSelect; - return bMultiSelect; + + return bMultiSelect ? msforms::fmMultiSelect::fmMultiSelectMulti : msforms::fmMultiSelect::fmMultiSelectSingle; } void SAL_CALL -ScVbaListBox::setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException) +ScVbaListBox::setMultiSelect( sal_Int32 _multiselect ) throw (css::uno::RuntimeException) { - m_xProps->setPropertyValue( "MultiSelection" , uno::makeAny( _multiselect ) ); + sal_Bool bBoolVal = false; + switch ( _multiselect ) + { + case msforms::fmMultiSelect::fmMultiSelectMulti: + case msforms::fmMultiSelect::fmMultiSelectExtended: + bBoolVal = sal_True; + break; + case msforms::fmMultiSelect::fmMultiSelectSingle: + bBoolVal = sal_True; + break; + default: + throw lang::IllegalArgumentException(); + break; + } + m_xProps->setPropertyValue( "MultiSelection" , uno::makeAny( bBoolVal ) ); } diff --git a/vbahelper/source/msforms/vbalistbox.hxx b/vbahelper/source/msforms/vbalistbox.hxx index 3b0ee742e1a1..2a46c0bf1de2 100644 --- a/vbahelper/source/msforms/vbalistbox.hxx +++ b/vbahelper/source/msforms/vbalistbox.hxx @@ -52,8 +52,8 @@ public: virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException); virtual void SAL_CALL setText( const OUString& _text ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getMultiSelect() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getMultiSelect() throw (css::uno::RuntimeException); + virtual void SAL_CALL setMultiSelect( sal_Int32 _multiselect ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException); // Methods |