Kaydet (Commit) adbe4ea9 authored tarafından Noel Power's avatar Noel Power

ListBox.MultiSelection takes fmMultiSelect enum not bool

Change-Id: Ic9ea60feadc551b232b393faafea9760cc3b82f0
üst 1dc7c568
...@@ -31,7 +31,7 @@ interface XListBox ...@@ -31,7 +31,7 @@ interface XListBox
{ {
[attribute] any Value; [attribute] any Value;
[attribute] string Text; [attribute] string Text;
[attribute] boolean MultiSelect; [attribute] long MultiSelect;
[attribute] any ListIndex; [attribute] any ListIndex;
[attribute, readonly] long ListCount; [attribute, readonly] long ListCount;
[attribute, readonly] XNewFont Font; [attribute, readonly] XNewFont Font;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <comphelper/anytostring.hxx> #include <comphelper/anytostring.hxx>
#include <com/sun/star/script/ArrayWrapper.hpp> #include <com/sun/star/script/ArrayWrapper.hpp>
#include <com/sun/star/form/validation/XValidatableFormComponent.hpp> #include <com/sun/star/form/validation/XValidatableFormComponent.hpp>
#include <ooo/vba/msforms/fmMultiSelect.hpp>
using namespace com::sun::star; using namespace com::sun::star;
using namespace ooo::vba; using namespace ooo::vba;
...@@ -120,18 +121,33 @@ ScVbaListBox::setText( const OUString& _text ) throw (uno::RuntimeException) ...@@ -120,18 +121,33 @@ ScVbaListBox::setText( const OUString& _text ) throw (uno::RuntimeException)
setValue( uno::makeAny( _text ) ); // seems the same setValue( uno::makeAny( _text ) ); // seems the same
} }
sal_Bool SAL_CALL sal_Int32 SAL_CALL
ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException) ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException)
{ {
sal_Bool bMultiSelect = sal_False; sal_Bool bMultiSelect = sal_False;
m_xProps->getPropertyValue( "MultiSelection" ) >>= bMultiSelect; m_xProps->getPropertyValue( "MultiSelection" ) >>= bMultiSelect;
return bMultiSelect;
return bMultiSelect ? msforms::fmMultiSelect::fmMultiSelectMulti : msforms::fmMultiSelect::fmMultiSelectSingle;
} }
void SAL_CALL 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 ) );
} }
......
...@@ -52,8 +52,8 @@ public: ...@@ -52,8 +52,8 @@ public:
virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
virtual OUString SAL_CALL getText() 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 void SAL_CALL setText( const OUString& _text ) throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL getMultiSelect() throw (css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getMultiSelect() throw (css::uno::RuntimeException);
virtual void SAL_CALL setMultiSelect( sal_Bool _multiselect ) 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); virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
// Methods // Methods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment