diff options
author | Frank Schönheit <fs@openoffice.org> | 2002-12-02 08:56:36 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2002-12-02 08:56:36 +0000 |
commit | b0c4be14883b4390642c3c60da343d0571ca34e7 (patch) | |
tree | 3eb1ff42f79f4f6ad5af7f387195f8abee11cd3f /forms/source/component/FormattedField.cxx | |
parent | 426af421c326aa4670c92c9559bfed40cffea077 (diff) |
#105577# properly (hopefully :) implemented XClonable
Diffstat (limited to 'forms/source/component/FormattedField.cxx')
-rw-r--r-- | forms/source/component/FormattedField.cxx | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 8a21e7bc19a6..66e173739f3b 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FormattedField.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: fs $ $Date: 2002-10-09 13:49:57 $ + * last change: $Author: fs $ $Date: 2002-12-02 09:56:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -377,33 +377,54 @@ InterfaceRef SAL_CALL OFormattedModel_CreateInstance(const Reference<XMultiServi } //------------------------------------------------------------------ -OFormattedModel::OFormattedModel(const Reference<XMultiServiceFactory>& _rxFactory) - :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_FORMATTEDFIELD, FRM_CONTROL_FORMATTEDFIELD, sal_False ) - // use the old control name for compytibility reasons - ,OErrorBroadcaster( OComponentHelper::rBHelper ) - ,OPropertyChangeListener(m_aMutex) - ,m_bOriginalNumeric(sal_False) - ,m_bNumeric(sal_False) - ,m_xOriginalFormatter(NULL) - ,m_nKeyType(NumberFormat::UNDEFINED) - ,m_aNullDate(DBTypeConversion::getStandardDate()) - ,m_bAggregateListening(sal_False) - ,m_pPropertyMultiplexer(NULL) - ,m_nFieldType( DataType::OTHER ) +void OFormattedModel::implConstruct() { - DBG_CTOR(OFormattedModel, NULL); - m_nClassId = FormComponentType::TEXTFIELD; + // members + m_bOriginalNumeric = sal_False; + m_bNumeric = sal_False; + m_xOriginalFormatter = NULL; + m_nKeyType = NumberFormat::UNDEFINED; + m_aNullDate = DBTypeConversion::getStandardDate(); + m_bAggregateListening = sal_False; + m_pPropertyMultiplexer = NULL; + m_nFieldType = DataType::OTHER; + // default our formats supplier increment(m_refCount); setPropertyToDefaultByHandle(PROPERTY_ID_FORMATSSUPPLIER); decrement(m_refCount); + startAggregateListening(); + doSetDelegator(); +} + +//------------------------------------------------------------------ +OFormattedModel::OFormattedModel(const Reference<XMultiServiceFactory>& _rxFactory) + :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_FORMATTEDFIELD, FRM_CONTROL_FORMATTEDFIELD, sal_False ) + // use the old control name for compytibility reasons + ,OErrorBroadcaster( OComponentHelper::rBHelper ) + ,OPropertyChangeListener( m_aMutex ) +{ + DBG_CTOR(OFormattedModel, NULL); + + implConstruct(); + m_sDataFieldConnectivityProperty = PROPERTY_EFFECTIVE_VALUE; + m_nClassId = FormComponentType::TEXTFIELD; + if (OFormattedModel::nValueHandle == -1) OFormattedModel::nValueHandle = getOriginalHandle(PROPERTY_ID_EFFECTIVE_VALUE); +} - startAggregateListening(); - doSetDelegator(); +//------------------------------------------------------------------ +OFormattedModel::OFormattedModel( const OFormattedModel* _pOriginal, const Reference< XMultiServiceFactory >& _rxFactory ) + :OEditBaseModel( _pOriginal, _rxFactory ) + ,OErrorBroadcaster( OComponentHelper::rBHelper ) + ,OPropertyChangeListener( m_aMutex ) +{ + DBG_CTOR(OFormattedModel, NULL); + + implConstruct(); } //------------------------------------------------------------------------------ @@ -415,6 +436,10 @@ OFormattedModel::~OFormattedModel() DBG_DTOR(OFormattedModel, NULL); } +// XCloneable +//------------------------------------------------------------------------------ +IMPLEMENT_DEFAULT_CLONING( OFormattedModel ) + //------------------------------------------------------------------------------ void OFormattedModel::startAggregateListening() { |