Kaydet (Commit) 7e60b04a authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

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
üst a6538ba1
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: Date.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -347,16 +347,36 @@ sal_Bool ODateModel::commitControlValueToDbColumn( bool _bPostReset ) ...@@ -347,16 +347,36 @@ sal_Bool ODateModel::commitControlValueToDbColumn( bool _bPostReset )
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Any ODateModel::translateControlValueToValidatableValue( ) const Any ODateModel::translateControlValueToExternalValue( ) const
{ {
Any aValidatableValue( getControlValue() ); Any aExternalValue( getControlValue() );
if ( aValidatableValue.hasValue() ) if ( aExternalValue.hasValue() )
{ {
sal_Int32 nDate = 0; sal_Int32 nDate = 0;
OSL_ENSURE( aValidatableValue >>= nDate, "ODateModel::translateControlValueToValidatableValue: invalid date!" ); OSL_VERIFY( aExternalValue >>= nDate );
aValidatableValue <<= DBTypeConversion::toDate( 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;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment