diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:51:46 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:51:46 +0000 |
commit | 0409e21c7c059824b7cdfbc72e0f7fd16e3afe64 (patch) | |
tree | 8e903eb2a62587c9892a8460ba750045b6b147cb /cppuhelper | |
parent | 35ad68d70234a26c5ee0602564570fdaa671c407 (diff) |
INTEGRATION: CWS custommeta (1.18.22); FILE MERGED
2008/02/04 15:23:31 mst 1.18.22.1: new interface: new OPropertySetHelper constructor
- cppuhelper/inc/cppuhelper/propshlp.hxx,cppuhelper/source/propshlp.cxx:
+ new interface IEventNotificationHook
+ new constructor for OPropertySetHelper, taking an IEventNotificationHook
+ OPropertySetHelper::fire calls given IEventNotificationHook
- cppuhelper/source/{cc5_solaris_sparc.map,gcc3.map}:
+ export new OPropertySetHelper constructor
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/propshlp.cxx | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index acd1ea5b6999..ff85212cbc6a 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -4,9 +4,9 @@ * * $RCSfile: propshlp.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: vg $ $Date: 2007-09-20 14:25:51 $ + * last change: $Author: obo $ $Date: 2008-02-26 13:51:46 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -147,6 +147,24 @@ sal_Bool OPropertySetHelperInfo_Impl::hasPropertyByName( const OUString & Proper } // ---------------------------------------------------- +// class PropertySetHelper_Impl +// ---------------------------------------------------- +class OPropertySetHelper::Impl { + +public: + Impl ( bool i_bIgnoreRuntimeExceptionsWhileFiring, + IEventNotificationHook *i_pFireEvents) + : m_bIgnoreRuntimeExceptionsWhileFiring( + i_bIgnoreRuntimeExceptionsWhileFiring ), + m_pFireEvents( i_pFireEvents ) + { } + + bool m_bIgnoreRuntimeExceptionsWhileFiring; + class IEventNotificationHook * const m_pFireEvents; +}; + + +// ---------------------------------------------------- // class PropertySetHelper // ---------------------------------------------------- OPropertySetHelper::OPropertySetHelper( @@ -154,7 +172,7 @@ OPropertySetHelper::OPropertySetHelper( : rBHelper( rBHelper_ ), aBoundLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ), - m_pReserved( 0 ) + m_pReserved( new Impl(false, 0) ) { } @@ -163,8 +181,18 @@ OPropertySetHelper::OPropertySetHelper( : rBHelper( rBHelper_ ), aBoundLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ), - m_pReserved( reinterpret_cast< void * >( - bIgnoreRuntimeExceptionsWhileFiring ? 1 : 0 ) ) + m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, 0 ) ) +{ +} + +OPropertySetHelper::OPropertySetHelper( + OBroadcastHelper & rBHelper_, IEventNotificationHook * i_pFireEvents, + bool bIgnoreRuntimeExceptionsWhileFiring) + : rBHelper( rBHelper_ ), + aBoundLC( rBHelper_.rMutex ), + aVetoableLC( rBHelper_.rMutex ), + m_pReserved( + new Impl( bIgnoreRuntimeExceptionsWhileFiring, i_pFireEvents) ) { } @@ -510,6 +538,13 @@ void OPropertySetHelper::fire sal_Bool bVetoable ) { + OSL_ENSURE( m_pReserved.get(), "No OPropertySetHelper::Impl" ); + if (m_pReserved->m_pFireEvents) { + m_pReserved->m_pFireEvents->fireEvents( + pnHandles, nHandles, bVetoable, + m_pReserved->m_bIgnoreRuntimeExceptionsWhileFiring); + } + // Only fire, if one or more properties changed if( nHandles ) { @@ -542,7 +577,7 @@ void OPropertySetHelper::fire } bool bIgnoreRuntimeExceptionsWhileFiring = - (m_pReserved == reinterpret_cast< void const * >(1)); + m_pReserved->m_bIgnoreRuntimeExceptionsWhileFiring; // fire the events for all changed properties for( i = 0; i < nChangesLen; i++ ) |