summaryrefslogtreecommitdiff
path: root/cppuhelper/source/propshlp.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-08-13 01:04:26 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-08-16 21:22:43 -0400
commit80b1e662777100a7dfd80176a2b528880a838167 (patch)
treefe39ee8773de6282e6e2b468b815eadf4fc7ddca /cppuhelper/source/propshlp.cxx
parentd2e538a63507aa3310a854d5c1414565efa3a361 (diff)
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.cxx13
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 )