summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-09-17 08:38:54 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-09-17 08:38:54 +0200
commit0096dc80abf5c1456389848c2fcc33edcc29cca0 (patch)
treeae6ca2f065df61dec767fa05a4c314f926ebf3ea /forms
parentdfc599fdc4e7d8f6b78d5fef69f7766e2c2c515d (diff)
dba34a: #i114403# fixed the form-based filter for list boxes
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Filter.cxx16
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;