diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-13 01:04:26 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-16 21:22:43 -0400 |
commit | 80b1e662777100a7dfd80176a2b528880a838167 (patch) | |
tree | fe39ee8773de6282e6e2b468b815eadf4fc7ddca /cppuhelper/source/propshlp.cxx | |
parent | Slightly changed the API. (diff) | |
download | core-80b1e662777100a7dfd80176a2b528880a838167.tar.gz core-80b1e662777100a7dfd80176a2b528880a838167.zip |
Added XPropertySet2 to allow disabling of change event notifications.
Sometimes broadcasting changes to the property set on every new
value insertion makes no sense especially during import. Turning
that off also improves performance especially when inserting millions
of property values.
Diffstat (limited to 'cppuhelper/source/propshlp.cxx')
-rw-r--r-- | cppuhelper/source/propshlp.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index 27d18ad26075..7cb259708d94 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -173,6 +173,7 @@ OPropertySetHelper::OPropertySetHelper( : rBHelper( rBHelper_ ), aBoundLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ), + m_bFireEvent(true), m_pReserved( new Impl(false, 0) ) { } @@ -182,6 +183,7 @@ OPropertySetHelper::OPropertySetHelper( : rBHelper( rBHelper_ ), aBoundLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ), + m_bFireEvent(true), m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, 0 ) ) { } @@ -192,6 +194,7 @@ OPropertySetHelper::OPropertySetHelper( : rBHelper( rBHelper_ ), aBoundLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ), + m_bFireEvent(true), m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, i_pFireEvents) ) { @@ -215,6 +218,7 @@ Any OPropertySetHelper::queryInterface( const ::com::sun::star::uno::Type & rTyp return ::cppu::queryInterface( rType, static_cast< XPropertySet * >( this ), + static_cast< XPropertySet2 * >( this ), static_cast< XMultiPropertySet * >( this ), static_cast< XFastPropertySet * >( this ) ); } @@ -626,6 +630,9 @@ void OPropertySetHelper::fire sal_Bool bVetoable ) { + if (!m_bFireEvent) + return; + OSL_ENSURE( m_pReserved.get(), "No OPropertySetHelper::Impl" ); if (m_pReserved->m_pFireEvents) { m_pReserved->m_pFireEvents->fireEvents( @@ -1029,6 +1036,12 @@ void OPropertySetHelper::firePropertiesChangeEvent( delete [] pHandles; } +void OPropertySetHelper::enableChangeListenerNotification( sal_Bool bEnable ) + throw(::com::sun::star::uno::RuntimeException) +{ + m_bFireEvent = bEnable; +} + #ifdef xdvnsdfln // XPropertyState PropertyState OPropertySetHelper::getPropertyState( const OUString& PropertyName ) |