diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-25 10:52:55 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-25 10:52:55 +0000 |
commit | b04d678332189c780fca01edd06e63bc4aa5a8f7 (patch) | |
tree | 51dafd1facb2b2e664aac7a471ab8abf1339b28e | |
parent | 2a5f404126f2088a4aa323f90a524c66b9217565 (diff) |
INTEGRATION: CWS dba30d (1.26.18); FILE MERGED
2008/05/27 12:28:02 fs 1.26.18.1: #i89657# refactoring, so that our binding's getValue is only called when our mutex is not locked
-rw-r--r-- | forms/source/component/Date.cxx | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index 5bf03b270..72daa5f0b 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: Date.cxx,v $ - * $Revision: 1.26 $ + * $Revision: 1.27 $ * * This file is part of OpenOffice.org. * @@ -308,21 +308,14 @@ Any ODateModel::translateControlValueToExternalValue( ) const } //------------------------------------------------------------------------------ -Any ODateModel::translateExternalValueToControlValue( ) const +Any ODateModel::translateExternalValueToControlValue( const Any& _rExternalValue ) const { - OSL_PRECOND( hasExternalValueBinding(), - "ODateModel::translateExternalValueToControlValue: precondition not met!" ); - Any aControlValue; - if ( hasExternalValueBinding() ) + if ( _rExternalValue.hasValue() ) { - Any aExternalValue = getExternalValueBinding()->getValue( ::getCppuType( static_cast< util::Date* >( NULL ) ) ); - if ( aExternalValue.hasValue() ) - { - util::Date aDate; - OSL_VERIFY( aExternalValue >>= aDate ); - aControlValue <<= DBTypeConversion::toINT32( aDate ); - } + util::Date aDate; + OSL_VERIFY( _rExternalValue >>= aDate ); + aControlValue <<= DBTypeConversion::toINT32( aDate ); } return aControlValue; } @@ -355,12 +348,9 @@ Any ODateModel::getDefaultForReset() const } //------------------------------------------------------------------------------ -sal_Bool ODateModel::approveValueBinding( const Reference< binding::XValueBinding >& _rxBinding ) +Sequence< Type > ODateModel::getSupportedBindingTypes() { - OSL_PRECOND( _rxBinding.is(), "ODateModel::approveValueBinding: invalid binding!" ); - - return _rxBinding.is() - && _rxBinding->supportsType( ::getCppuType( static_cast< util::Date* >( NULL ) ) ); + return Sequence< Type >( &::getCppuType( static_cast< util::Date* >( NULL ) ), 1 ); } //......................................................................... |