diff options
Diffstat (limited to 'vbahelper/source/msforms/vbacombobox.cxx')
-rw-r--r-- | vbahelper/source/msforms/vbacombobox.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx index 851cee0a4098..3f4468d7d07a 100644 --- a/vbahelper/source/msforms/vbacombobox.cxx +++ b/vbahelper/source/msforms/vbacombobox.cxx @@ -21,6 +21,7 @@ #include <filter/msfilter/msvbahelper.hxx> #include <basic/sbstar.hxx> #include <basic/sbmod.hxx> +#include <comphelper/sequence.hxx> #include "vbanewfont.hxx" #include <ooo/vba/msforms/fmStyle.hpp> #include <ooo/vba/msforms/fmDropButtonStyle.hpp> @@ -96,15 +97,14 @@ ScVbaComboBox::getListIndex() if ( sItems.hasElements() ) { OUString sText = getText(); - sal_Int32 nLen = sItems.getLength(); - for ( sal_Int32 index = 0; !sText.isEmpty() && index < nLen; ++index ) + if (!sText.isEmpty()) { - if ( sItems[ index ] == sText ) + sal_Int32 index = comphelper::findValue(sItems, sText); + if (index != -1) { SAL_INFO("vbahelper", "getListIndex returning " << index ); return uno::makeAny( index ); } - } } SAL_INFO("vbahelper", "getListIndex returning -1" ); |