diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-06-21 17:24:00 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-06-21 17:24:00 +0000 |
commit | 57df697d27aa07975e8e245e4924f641e40bb15d (patch) | |
tree | 145ef812036cba80b991848fcf1d0b7d4cc2bc7a /forms/source/component/CheckBox.cxx | |
parent | #88615# Dialog changed to modal (diff) | |
download | core-57df697d27aa07975e8e245e4924f641e40bb15d.tar.gz core-57df697d27aa07975e8e245e4924f641e40bb15d.zip |
#88610# correctly add as property change listener on our aggregate
Diffstat (limited to 'forms/source/component/CheckBox.cxx')
-rw-r--r-- | forms/source/component/CheckBox.cxx | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx index 50b7d49238d4..4cab4828584e 100644 --- a/forms/source/component/CheckBox.cxx +++ b/forms/source/component/CheckBox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: CheckBox.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: fs $ $Date: 2001-04-02 10:28:06 $ + * last change: $Author: fs $ $Date: 2001-06-21 18:24:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -129,10 +129,11 @@ InterfaceRef SAL_CALL OCheckBoxModel_CreateInstance(const Reference<XMultiServic //------------------------------------------------------------------ OCheckBoxModel::OCheckBoxModel(const Reference<XMultiServiceFactory>& _rxFactory) - :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_CHECKBOX, FRM_CONTROL_CHECKBOX, sal_False) + :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_CHECKBOX, FRM_CONTROL_CHECKBOX, sal_False, sal_False) // use the old control name for compytibility reasons ,OPropertyChangeListener(m_aMutex) ,m_bInReset(sal_False) + ,m_pAggregatePropertyMultiplexer(NULL) { m_nClassId = FormComponentType::CHECKBOX; m_nDefaultChecked = CB_NOCHECK; @@ -141,10 +142,35 @@ OCheckBoxModel::OCheckBoxModel(const Reference<XMultiServiceFactory>& _rxFactory increment(m_refCount); if (m_xAggregateSet.is()) { - OPropertyChangeMultiplexer* pMultiplexer = new OPropertyChangeMultiplexer(this, m_xAggregateSet); - pMultiplexer->addProperty(PROPERTY_STATE); + m_pAggregatePropertyMultiplexer = new OPropertyChangeMultiplexer(this, m_xAggregateSet, sal_False); + m_pAggregatePropertyMultiplexer->acquire(); + m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_STATE); } decrement(m_refCount); + + doSetDelegator(); +} + +//------------------------------------------------------------------------------ +OCheckBoxModel::~OCheckBoxModel() +{ + doResetDelegator(); + + if (m_pAggregatePropertyMultiplexer) + { + m_pAggregatePropertyMultiplexer->dispose(); + m_pAggregatePropertyMultiplexer->release(); + m_pAggregatePropertyMultiplexer = NULL; + } +} + +//------------------------------------------------------------------------------ +void SAL_CALL OCheckBoxModel::disposing() +{ + if (m_pAggregatePropertyMultiplexer) + m_pAggregatePropertyMultiplexer->dispose(); + + OBoundControlModel::disposing(); } //------------------------------------------------------------------------------ |