diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-03-23 10:29:03 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-03-23 10:29:03 +0000 |
commit | 7e60b04a6b0cb0cc0f9deea01a5d8bde12419ad9 (patch) | |
tree | 8d33f8b47a4d22284760f148242bad737f6ce065 /forms/source/component/Date.cxx | |
parent | a6538ba116332adb4bc13c01c6fce9ba2bd2832c (diff) |
INTEGRATION: CWS eforms4 (1.16.6); FILE MERGED
2005/01/21 09:43:41 fs 1.16.6.3: translateControlValueToExternalValue: also in product version ....
2004/12/10 09:12:34 fs 1.16.6.2: #i36359# some method constness
2004/12/08 16:16:58 fs 1.16.6.1: #i36359# #i36303# proper handling when bound to external values
Diffstat (limited to 'forms/source/component/Date.cxx')
-rw-r--r-- | forms/source/component/Date.cxx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index 736764ce5e4d..fcccbdf378f4 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Date.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: obo $ $Date: 2004-11-16 10:36:43 $ + * last change: $Author: vg $ $Date: 2005-03-23 11:29:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -347,16 +347,36 @@ sal_Bool ODateModel::commitControlValueToDbColumn( bool _bPostReset ) } //------------------------------------------------------------------------------ -Any ODateModel::translateControlValueToValidatableValue( ) const +Any ODateModel::translateControlValueToExternalValue( ) const { - Any aValidatableValue( getControlValue() ); - if ( aValidatableValue.hasValue() ) + Any aExternalValue( getControlValue() ); + if ( aExternalValue.hasValue() ) { sal_Int32 nDate = 0; - OSL_ENSURE( aValidatableValue >>= nDate, "ODateModel::translateControlValueToValidatableValue: invalid date!" ); - aValidatableValue <<= DBTypeConversion::toDate( nDate ); + OSL_VERIFY( aExternalValue >>= nDate ); + aExternalValue <<= DBTypeConversion::toDate( nDate ); } - return aValidatableValue; + return aExternalValue; +} + +//------------------------------------------------------------------------------ +Any ODateModel::translateExternalValueToControlValue( ) const +{ + OSL_PRECOND( hasExternalValueBinding(), + "ODateModel::translateExternalValueToControlValue: precondition not met!" ); + + Any aControlValue; + if ( hasExternalValueBinding() ) + { + Any aExternalValue = getExternalValueBinding()->getValue( ::getCppuType( static_cast< util::Date* >( NULL ) ) ); + if ( aExternalValue.hasValue() ) + { + util::Date aDate; + OSL_VERIFY( aExternalValue >>= aDate ); + aControlValue <<= DBTypeConversion::toINT32( aDate ); + } + } + return aControlValue; } //------------------------------------------------------------------------------ |