diff options
author | Oliver Bolte <obo@openoffice.org> | 2003-10-21 07:55:58 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2003-10-21 07:55:58 +0000 |
commit | 170dfe06415cdcf70ecbe2f11f3d701ae9a1685a (patch) | |
tree | 700ddce72e58628e6e1e07514090752f7ec06f7a /forms/source/component/Currency.cxx | |
parent | 4856d0c68e3589890f6e46cfd49769a3010f3ce3 (diff) |
INTEGRATION: CWS formcelllinkage (1.9.38); FILE MERGED
2003/10/01 09:18:20 fs 1.9.38.1: #i18994# merging the changes from the CWS fs002
Diffstat (limited to 'forms/source/component/Currency.cxx')
-rw-r--r-- | forms/source/component/Currency.cxx | 49 |
1 files changed, 16 insertions, 33 deletions
diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx index 3c98b239617f..a320b7593e94 100644 --- a/forms/source/component/Currency.cxx +++ b/forms/source/component/Currency.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Currency.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: vg $ $Date: 2003-05-19 13:07:57 $ + * last change: $Author: obo $ $Date: 2003-10-21 08:55:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -127,8 +127,6 @@ StringSequence SAL_CALL OCurrencyControl::getSupportedServiceNames() throw() //================================================================== // OCurrencyModel //================================================================== -sal_Int32 OCurrencyModel::nValueHandle = -1; - //------------------------------------------------------------------ InterfaceRef SAL_CALL OCurrencyModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { @@ -189,15 +187,13 @@ void OCurrencyModel::implConstruct() DBG_NAME( OCurrencyModel ) //------------------------------------------------------------------ OCurrencyModel::OCurrencyModel(const Reference<XMultiServiceFactory>& _rxFactory) - :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_CURRENCYFIELD, FRM_CONTROL_CURRENCYFIELD) + :OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_CURRENCYFIELD, FRM_CONTROL_CURRENCYFIELD, sal_False ) // use the old control name for compytibility reasons { DBG_CTOR( OCurrencyModel, NULL ); m_nClassId = FormComponentType::CURRENCYFIELD; - m_sDataFieldConnectivityProperty = PROPERTY_VALUE; - if (OCurrencyModel::nValueHandle == -1) - OCurrencyModel::nValueHandle = getOriginalHandle(PROPERTY_ID_VALUE); + initValueProperty( PROPERTY_VALUE, PROPERTY_ID_VALUE ); implConstruct(); } @@ -273,61 +269,48 @@ void OCurrencyModel::fillProperties( return FRM_COMPONENT_CURRENCYFIELD; // old (non-sun) name for compatibility ! } -// XBoundComponent //------------------------------------------------------------------------------ -sal_Bool OCurrencyModel::_commit() +sal_Bool OCurrencyModel::commitControlValueToDbColumn( bool _bPostReset ) { - Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( OCurrencyModel::nValueHandle ); - if (!compare(aNewValue, m_aSaveValue)) + Any aControlValue( m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ) ); + if ( !compare( aControlValue, m_aSaveValue ) ) { - if (aNewValue.getValueType().getTypeClass() == TypeClass_VOID) + if ( aControlValue.getValueType().getTypeClass() == TypeClass_VOID ) m_xColumnUpdate->updateNull(); else { try { - m_xColumnUpdate->updateDouble(getDouble(aNewValue)); + m_xColumnUpdate->updateDouble( getDouble( aControlValue ) ); } catch(Exception&) { return sal_False; } } - m_aSaveValue = aNewValue; + m_aSaveValue = aControlValue; } return sal_True; } //------------------------------------------------------------------------------ -void OCurrencyModel::_onValueChanged() +Any OCurrencyModel::translateDbColumnToControlValue() { m_aSaveValue <<= m_xColumn->getDouble(); - if (m_xColumn->wasNull()) + if ( m_xColumn->wasNull() ) m_aSaveValue.clear(); - { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties - // may cause any uno controls belonging to us to lock the solar mutex, which is potentially dangerous with - // our own mutex locked - // FS - 72451 - 31.01.00 - MutexRelease aRelease(m_aMutex); - m_xAggregateFastSet->setFastPropertyValue(OCurrencyModel::nValueHandle, m_aSaveValue); - } + return m_aSaveValue; } // XReset //------------------------------------------------------------------------------ -void OCurrencyModel::_reset( void ) +Any OCurrencyModel::getDefaultForReset() const { Any aValue; - if (m_aDefault.getValueType().getTypeClass() == TypeClass_DOUBLE) + if ( m_aDefault.getValueType().getTypeClass() == TypeClass_DOUBLE ) aValue = m_aDefault; - { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties - // may cause any uno controls belonging to us to lock the solar mutex, which is potentially dangerous with - // our own mutex locked - // FS - 72451 - 31.01.00 - MutexRelease aRelease(m_aMutex); - m_xAggregateFastSet->setFastPropertyValue(OCurrencyModel::nValueHandle, aValue); - } + return aValue; } //......................................................................... |