summaryrefslogtreecommitdiff
path: root/forms/source/component/ListBox.cxx
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-04-22 17:34:50 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-04-22 17:55:55 +0200
commita2c54dc208278afca127c049f069b48b2a35710e (patch)
treec745fa39f830f0674a2180744b2b4cbe479d8896 /forms/source/component/ListBox.cxx
parent1e698bb7f1614f69caa5a30df64a47d18435c89b (diff)
ListBox: take care of validation (use binding value when appropriate)
Change-Id: I7c2ab0e42a82baa39e1b48124cc8cf58bfa126d5
Diffstat (limited to 'forms/source/component/ListBox.cxx')
-rw-r--r--forms/source/component/ListBox.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 18421abf8dfa..2ea90a99dacf 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1513,6 +1513,13 @@ namespace frm
return aReturn;
}
+ //------------------------------------------------------------------------------
+ Any OListBoxModel::translateControlValueToValidatableValue( ) const
+ {
+ OSL_PRECOND( hasValidator(), "OListBoxModel::translateControlValueToValidatableValue: no validator, so why should I?" );
+ return getCurrentFormComponentValue();
+ }
+
//--------------------------------------------------------------------
Any OListBoxModel::getCurrentSingleValue() const
{
@@ -1552,8 +1559,12 @@ namespace frm
//--------------------------------------------------------------------
Any OListBoxModel::getCurrentFormComponentValue() const
{
- if ( hasValidator() )
- return OBoundControlModel::getCurrentFormComponentValue();
+ {
+ Reference< com::sun::star::form::validation::XValidator > vtor (const_cast<OListBoxModel*>(this)->getValidator());
+ Reference< XValueBinding > extBinding (const_cast<OListBoxModel*>(this)->getValueBinding());
+ if ( vtor.is() && vtor == extBinding )
+ return translateControlValueToExternalValue();
+ }
Any aCurrentValue;