diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-04-22 17:34:50 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-04-22 17:55:55 +0200 |
commit | a2c54dc208278afca127c049f069b48b2a35710e (patch) | |
tree | c745fa39f830f0674a2180744b2b4cbe479d8896 /forms/source/component/ListBox.cxx | |
parent | 1e698bb7f1614f69caa5a30df64a47d18435c89b (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.cxx | 15 |
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; |