summaryrefslogtreecommitdiff
path: root/extensions/source/propctrlr/propertyhandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/propctrlr/propertyhandler.cxx')
-rw-r--r--extensions/source/propctrlr/propertyhandler.cxx36
1 files changed, 25 insertions, 11 deletions
diff --git a/extensions/source/propctrlr/propertyhandler.cxx b/extensions/source/propctrlr/propertyhandler.cxx
index a1817393324f..bd6ba2af7407 100644
--- a/extensions/source/propctrlr/propertyhandler.cxx
+++ b/extensions/source/propctrlr/propertyhandler.cxx
@@ -42,7 +42,6 @@ namespace pcr
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::lang;
@@ -79,11 +78,11 @@ namespace pcr
return;
// remove all old property change listeners
- ::comphelper::OInterfaceIteratorHelper2 removeListener = m_aPropertyListeners.createIterator();
- ::comphelper::OInterfaceIteratorHelper2 readdListener = m_aPropertyListeners.createIterator(); // will copy the container as needed
+ ::comphelper::OInterfaceIteratorHelper3 removeListener(m_aPropertyListeners);
+ ::comphelper::OInterfaceIteratorHelper3 readdListener(m_aPropertyListeners); // will copy the container as needed
while ( removeListener.hasMoreElements() )
- removePropertyChangeListener( static_cast< XPropertyChangeListener* >( removeListener.next() ) );
- OSL_ENSURE( m_aPropertyListeners.empty(), "PropertyHandler::inspect: derived classes are expected to forward the removePropertyChangeListener call to their base class (me)!" );
+ removePropertyChangeListener( removeListener.next() );
+ OSL_ENSURE( m_aPropertyListeners.getLength() == 0, "PropertyHandler::inspect: derived classes are expected to forward the removePropertyChangeListener call to their base class (me)!" );
// remember the new component, and give derived classes the chance to react on it
m_xComponent = xNewComponent;
@@ -91,7 +90,7 @@ namespace pcr
// add the listeners, again
while ( readdListener.hasMoreElements() )
- addPropertyChangeListener( static_cast< XPropertyChangeListener* >( readdListener.next() ) );
+ addPropertyChangeListener( readdListener.next() );
}
void PropertyHandler::onNewComponent()
@@ -164,7 +163,7 @@ namespace pcr
::rtl::Reference< IPropertyEnumRepresentation > aEnumConversion(
new DefaultEnumRepresentation( *m_pInfoService, _rPropertyValue.getValueType(), nPropId ) );
// TODO/UNOize: cache those converters?
- return makeAny( aEnumConversion->getDescriptionForValue( _rPropertyValue ) );
+ return Any( aEnumConversion->getDescriptionForValue( _rPropertyValue ) );
}
return PropertyHandlerHelper::convertToControlValue(
@@ -228,13 +227,13 @@ namespace pcr
::osl::MutexGuard aGuard( m_aMutex );
if ( !_rxListener.is() )
throw NullPointerException();
- m_aPropertyListeners.addListener( _rxListener );
+ m_aPropertyListeners.addInterface( _rxListener );
}
void SAL_CALL PropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener )
{
::osl::MutexGuard aGuard( m_aMutex );
- m_aPropertyListeners.removeListener( _rxListener );
+ m_aPropertyListeners.removeInterface( _rxListener );
}
sal_Bool SAL_CALL PropertyHandler::suspend( sal_Bool /*_bSuspend*/ )
@@ -242,7 +241,22 @@ namespace pcr
return true;
}
- IMPLEMENT_FORWARD_XCOMPONENT( PropertyHandler, PropertyHandler_Base )
+ void SAL_CALL PropertyHandler::dispose( )
+ {
+ PropertyHandler_Base::WeakComponentImplHelperBase::dispose();
+ m_xComponent.clear();
+ m_xComponentPropertyInfo.clear();
+ m_xTypeConverter.clear();
+ }
+ void SAL_CALL PropertyHandler::addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener )
+ {
+ PropertyHandler_Base::WeakComponentImplHelperBase::addEventListener( Listener );
+ }
+ void SAL_CALL PropertyHandler::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener )
+ {
+ PropertyHandler_Base::WeakComponentImplHelperBase::removeEventListener( Listener );
+ }
+
void SAL_CALL PropertyHandler::disposing()
{
@@ -260,7 +274,7 @@ namespace pcr
aEvent.PropertyName = _rPropName;
aEvent.OldValue = _rOldValue;
aEvent.NewValue = _rNewValue;
- m_aPropertyListeners.notify( aEvent, &XPropertyChangeListener::propertyChange );
+ m_aPropertyListeners.notifyEach( &XPropertyChangeListener::propertyChange, aEvent );
}
const Property* PropertyHandler::impl_getPropertyFromId_nothrow( PropertyId _nPropId ) const