summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/msforms/vbalistbox.cxx24
-rw-r--r--vbahelper/source/msforms/vbalistbox.hxx4
2 files changed, 22 insertions, 6 deletions
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