diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-09-17 08:38:54 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-09-17 08:38:54 +0200 |
commit | 0096dc80abf5c1456389848c2fcc33edcc29cca0 (patch) | |
tree | ae6ca2f065df61dec767fa05a4c314f926ebf3ea /forms/source/component | |
parent | dfc599fdc4e7d8f6b78d5fef69f7766e2c2c515d (diff) |
dba34a: #i114403# fixed the form-based filter for list boxes
Diffstat (limited to 'forms/source/component')
-rw-r--r-- | forms/source/component/Filter.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index 9cbc5237cf95..f4aa133a44f4 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> +#include <com/sun/star/awt/XItemList.hpp> /** === end UNO includes === **/ #include <comphelper/numbers.hxx> @@ -342,11 +343,16 @@ namespace frm case FormComponentType::LISTBOX: { - Sequence< ::rtl::OUString> aValueSelection; - Reference< XPropertySet > aPropertyPointer(getModel(), UNO_QUERY); - aPropertyPointer->getPropertyValue(PROPERTY_VALUE_SEQ) >>= aValueSelection; - if (rEvent.Selected <= aValueSelection.getLength()) - aText.append( aValueSelection[ rEvent.Selected ] ); + try + { + const Reference< XItemList > xItemList( getModel(), UNO_QUERY_THROW ); + const ::rtl::OUString sItemText( xItemList->getItemText( rEvent.Selected ) ); + aText.append( sItemText ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } break; |