Kaydet (Commit) 5c64fd7c authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

Restore ABI compatibility with LO 3.4 and earlier

Factor out ABI-breaking changes to OPropertySetHelper into a derived
class OPropertySetHelper2.

Only gcc3.map is up-to-date.
üst 20a3baeb
...@@ -54,11 +54,11 @@ namespace comphelper ...@@ -54,11 +54,11 @@ namespace comphelper
//= OPropertyStateHelper //= OPropertyStateHelper
//================================================================== //==================================================================
/// helper class for implementing property states /// helper class for implementing property states
class COMPHELPER_DLLPUBLIC OPropertyStateHelper :public ::cppu::OPropertySetHelper class COMPHELPER_DLLPUBLIC OPropertyStateHelper :public ::cppu::OPropertySetHelper2
,public ::com::sun::star::beans::XPropertyState ,public ::com::sun::star::beans::XPropertyState
{ {
public: public:
OPropertyStateHelper(::cppu::OBroadcastHelper& rBHlp):OPropertySetHelper(rBHlp) { } OPropertyStateHelper(::cppu::OBroadcastHelper& rBHlp):OPropertySetHelper2(rBHlp) { }
OPropertyStateHelper(::cppu::OBroadcastHelper& rBHlp, OPropertyStateHelper(::cppu::OBroadcastHelper& rBHlp,
::cppu::IEventNotificationHook *i_pFireEvents); ::cppu::IEventNotificationHook *i_pFireEvents);
......
...@@ -57,7 +57,7 @@ namespace comphelper ...@@ -57,7 +57,7 @@ namespace comphelper
//--------------------------------------------------------------------- //---------------------------------------------------------------------
::com::sun::star::uno::Any SAL_CALL OPropertyStateHelper::queryInterface(const ::com::sun::star::uno::Type& _rType) throw( ::com::sun::star::uno::RuntimeException) ::com::sun::star::uno::Any SAL_CALL OPropertyStateHelper::queryInterface(const ::com::sun::star::uno::Type& _rType) throw( ::com::sun::star::uno::RuntimeException)
{ {
::com::sun::star::uno::Any aReturn = OPropertySetHelper::queryInterface(_rType); ::com::sun::star::uno::Any aReturn = OPropertySetHelper2::queryInterface(_rType);
// our own ifaces // our own ifaces
if ( !aReturn.hasValue() ) if ( !aReturn.hasValue() )
aReturn = ::cppu::queryInterface(_rType, static_cast< ::com::sun::star::beans::XPropertyState*>(this)); aReturn = ::cppu::queryInterface(_rType, static_cast< ::com::sun::star::beans::XPropertyState*>(this));
...@@ -82,7 +82,7 @@ namespace comphelper ...@@ -82,7 +82,7 @@ namespace comphelper
OPropertyStateHelper::OPropertyStateHelper( OPropertyStateHelper::OPropertyStateHelper(
::cppu::OBroadcastHelper& rBHlp, ::cppu::OBroadcastHelper& rBHlp,
::cppu::IEventNotificationHook *i_pFireEvents) ::cppu::IEventNotificationHook *i_pFireEvents)
: ::cppu::OPropertySetHelper(rBHlp, i_pFireEvents) { } : ::cppu::OPropertySetHelper2(rBHlp, i_pFireEvents) { }
OPropertyStateHelper::~OPropertyStateHelper() {} OPropertyStateHelper::~OPropertyStateHelper() {}
......
...@@ -351,8 +351,7 @@ public: ...@@ -351,8 +351,7 @@ public:
*/ */
class OPropertySetHelper : public ::com::sun::star::beans::XMultiPropertySet, class OPropertySetHelper : public ::com::sun::star::beans::XMultiPropertySet,
public ::com::sun::star::beans::XFastPropertySet, public ::com::sun::star::beans::XFastPropertySet,
public ::com::sun::star::beans::XPropertySet, public ::com::sun::star::beans::XPropertySet
public ::com::sun::star::beans::XPropertySetOption
{ {
public: public:
/** /**
...@@ -372,11 +371,12 @@ public: ...@@ -372,11 +371,12 @@ public:
of this object. Stored in the variable rBHelper. of this object. Stored in the variable rBHelper.
@param bIgnoreRuntimeExceptionsWhileFiring @param bIgnoreRuntimeExceptionsWhileFiring
indicates whether occuring RuntimeExceptions will be indicates whether occurring RuntimeExceptions will be
ignored when firing notifications (vetoableChange((), ignored when firing notifications
propertyChange()) to listeners. (vetoableChange(), propertyChange())
to listeners.
PropertyVetoExceptions may still be thrown. PropertyVetoExceptions may still be thrown.
This flag is useful in a inter-process scenarios when This flag is useful in an inter-process scenario when
remote bridges may break down remote bridges may break down
(firing DisposedExceptions). (firing DisposedExceptions).
*/ */
...@@ -395,11 +395,12 @@ public: ...@@ -395,11 +395,12 @@ public:
additional event notifier additional event notifier
@param bIgnoreRuntimeExceptionsWhileFiring @param bIgnoreRuntimeExceptionsWhileFiring
indicates whether occuring RuntimeExceptions will be indicates whether occurring RuntimeExceptions will be
ignored when firing notifications (vetoableChange((), ignored when firing notifications
propertyChange()) to listeners. (vetoableChange(), propertyChange())
to listeners.
PropertyVetoExceptions may still be thrown. PropertyVetoExceptions may still be thrown.
This flag is useful in a inter-process scenarios when This flag is useful in an inter-process scenario when
remote bridges may break down remote bridges may break down
(firing DisposedExceptions). (firing DisposedExceptions).
*/ */
...@@ -412,7 +413,7 @@ public: ...@@ -412,7 +413,7 @@ public:
Only returns a reference to XMultiPropertySet, XFastPropertySet, XPropertySet and Only returns a reference to XMultiPropertySet, XFastPropertySet, XPropertySet and
XEventListener. XEventListener.
*/ */
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
throw (::com::sun::star::uno::RuntimeException); throw (::com::sun::star::uno::RuntimeException);
/** eases implementing XTypeProvider::getTypes, returns the types of XMultiPropertySet, XFastPropertySet, XPropertySet /** eases implementing XTypeProvider::getTypes, returns the types of XMultiPropertySet, XFastPropertySet, XPropertySet
...@@ -506,10 +507,6 @@ public: ...@@ -506,10 +507,6 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener > & Listener ) const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener > & Listener )
throw(::com::sun::star::uno::RuntimeException); throw(::com::sun::star::uno::RuntimeException);
// XPropertySetOption
virtual void SAL_CALL enableChangeListenerNotification( sal_Bool bEnable )
throw(::com::sun::star::uno::RuntimeException);
/** /**
The property sequence is created in the call. The interface isn't used after the call. The property sequence is created in the call. The interface isn't used after the call.
*/ */
...@@ -637,8 +634,6 @@ protected: ...@@ -637,8 +634,6 @@ protected:
*/ */
OMultiTypeInterfaceContainerHelperInt32 aVetoableLC; OMultiTypeInterfaceContainerHelperInt32 aVetoableLC;
bool m_bFireEvent;
class Impl; class Impl;
/** reserved for future use. finally, the future has arrived... /** reserved for future use. finally, the future has arrived...
...@@ -676,6 +671,44 @@ public: ...@@ -676,6 +671,44 @@ public:
#pragma warning(pop) #pragma warning(pop)
#endif #endif
/**
OPropertySetHelper plus XPropertySetOption
*/
class OPropertySetHelper2 : public OPropertySetHelper,
public ::com::sun::star::beans::XPropertySetOption
{
public:
/** Constructor.
See OPropertySetHelper constructors documentation
*/
explicit OPropertySetHelper2(
OBroadcastHelper & rBHelper,
IEventNotificationHook *i_pFireEvents = NULL,
bool bIgnoreRuntimeExceptionsWhileFiring = false);
// XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
throw (::com::sun::star::uno::RuntimeException);
// XPropertySetOption
virtual void SAL_CALL enableChangeListenerNotification( sal_Bool bEnable )
throw(::com::sun::star::uno::RuntimeException);
private:
OPropertySetHelper2( const OPropertySetHelper & ) SAL_THROW( () );
OPropertySetHelper2 & operator = ( const OPropertySetHelper & ) SAL_THROW( () );
public:
// Suppress warning about virtual functions but non-virtual destructor:
/**
You must call disposing before destruction.
*/
virtual ~OPropertySetHelper2() SAL_THROW( () );
};
} // end namespace cppuhelper } // end namespace cppuhelper
#endif // #endif //
......
...@@ -260,7 +260,6 @@ _ZThn*_N4cppu16OComponentHelper7releaseEv; ...@@ -260,7 +260,6 @@ _ZThn*_N4cppu16OComponentHelper7releaseEv;
_ZThn*_N4cppu18OPropertySetHelper14queryInterfaceERKN3com3sun4star3uno4TypeE; _ZThn*_N4cppu18OPropertySetHelper14queryInterfaceERKN3com3sun4star3uno4TypeE;
_ZThn*_N4cppu18OPropertySetHelper20getFastPropertyValueE?; _ZThn*_N4cppu18OPropertySetHelper20getFastPropertyValueE?;
_ZThn*_N4cppu18OPropertySetHelper20setFastPropertyValueE?RKN3com3sun4star3uno3AnyE; _ZThn*_N4cppu18OPropertySetHelper20setFastPropertyValueE?RKN3com3sun4star3uno3AnyE;
_ZThn*_N4cppu18OPropertySetHelper14queryInterfaceERKN3com3sun4star3uno4TypeE;
_ZThn*_N4cppu18OPropertySetHelper16getPropertyValueERKN3rtl8OUStringE; _ZThn*_N4cppu18OPropertySetHelper16getPropertyValueERKN3rtl8OUStringE;
_ZThn*_N4cppu18OPropertySetHelper16setPropertyValueERKN3rtl8OUStringERKN3com3sun4star3uno3AnyE; _ZThn*_N4cppu18OPropertySetHelper16setPropertyValueERKN3rtl8OUStringERKN3com3sun4star3uno3AnyE;
_ZThn*_N4cppu18OPropertySetHelper25addPropertyChangeListenerERKN3rtl8OUStringERKN3com3sun4star3uno9ReferenceINS7_5beans23XPropertyChangeListenerEEE; _ZThn*_N4cppu18OPropertySetHelper25addPropertyChangeListenerERKN3rtl8OUStringERKN3com3sun4star3uno9ReferenceINS7_5beans23XPropertyChangeListenerEEE;
...@@ -392,6 +391,16 @@ UDK_3.7 { # OOo 3.4 ...@@ -392,6 +391,16 @@ UDK_3.7 { # OOo 3.4
UDK_3.8 { # LibO 3.5 UDK_3.8 { # LibO 3.5
global: global:
_ZN4cppu18OPropertySetHelper32enableChangeListenerNotificationEh; ## class OPropertySetHelper2
_ZThn*_N4cppu18OPropertySetHelper32enableChangeListenerNotificationEh; # constructors
_ZN4cppu19OPropertySetHelper2C1ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb;
_ZN4cppu19OPropertySetHelper2C2ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb;
# destructors
_ZN4cppu19OPropertySetHelper2D0Ev;
_ZN4cppu19OPropertySetHelper2D1Ev;
_ZN4cppu19OPropertySetHelper2D2Ev;
# queryInterface
_ZN4cppu19OPropertySetHelper214queryInterfaceERKN3com3sun4star3uno4TypeE;
# enableChangeListenerNotification
_ZN4cppu19OPropertySetHelper232enableChangeListenerNotificationEh;
} UDK_3.7; } UDK_3.7;
...@@ -287,6 +287,7 @@ UDK_3.7 { # OOo 3.4 ...@@ -287,6 +287,7 @@ UDK_3.7 { # OOo 3.4
UDK_3.8 { # LibO 3.5 UDK_3.8 { # LibO 3.5
global: global:
?enableChangeListenerNotification@OPropertySetHelper@cppu@@UAAXE@Z; ?queryInterface@OPropertySetHelper@cppu@@UAA?AVAny@uno@star@sun@com@@ABVType@4567@@Z;
??_7OPropertySetHelper@cppu@@6BXPropertySetOption@beans@star@sun@com@@@; ?enableChangeListenerNotification@OPropertySetHelper2@cppu@@UAAXE@Z;
??_7OPropertySetHelper2@cppu@@6BXPropertySetOption@beans@star@sun@com@@@;
} UDK_3.7; } UDK_3.7;
...@@ -152,11 +152,13 @@ public: ...@@ -152,11 +152,13 @@ public:
IEventNotificationHook *i_pFireEvents IEventNotificationHook *i_pFireEvents
) )
:m_bIgnoreRuntimeExceptionsWhileFiring( i_bIgnoreRuntimeExceptionsWhileFiring ) :m_bIgnoreRuntimeExceptionsWhileFiring( i_bIgnoreRuntimeExceptionsWhileFiring )
,m_bFireEvents(true)
,m_pFireEvents( i_pFireEvents ) ,m_pFireEvents( i_pFireEvents )
{ {
} }
bool m_bIgnoreRuntimeExceptionsWhileFiring; bool m_bIgnoreRuntimeExceptionsWhileFiring;
bool m_bFireEvents;
class IEventNotificationHook * const m_pFireEvents; class IEventNotificationHook * const m_pFireEvents;
::std::vector< sal_Int32 > m_handles; ::std::vector< sal_Int32 > m_handles;
...@@ -173,7 +175,6 @@ OPropertySetHelper::OPropertySetHelper( ...@@ -173,7 +175,6 @@ OPropertySetHelper::OPropertySetHelper(
: rBHelper( rBHelper_ ), : rBHelper( rBHelper_ ),
aBoundLC( rBHelper_.rMutex ), aBoundLC( rBHelper_.rMutex ),
aVetoableLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ),
m_bFireEvent(true),
m_pReserved( new Impl(false, 0) ) m_pReserved( new Impl(false, 0) )
{ {
} }
...@@ -183,7 +184,6 @@ OPropertySetHelper::OPropertySetHelper( ...@@ -183,7 +184,6 @@ OPropertySetHelper::OPropertySetHelper(
: rBHelper( rBHelper_ ), : rBHelper( rBHelper_ ),
aBoundLC( rBHelper_.rMutex ), aBoundLC( rBHelper_.rMutex ),
aVetoableLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ),
m_bFireEvent(true),
m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, 0 ) ) m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, 0 ) )
{ {
} }
...@@ -194,35 +194,50 @@ OPropertySetHelper::OPropertySetHelper( ...@@ -194,35 +194,50 @@ OPropertySetHelper::OPropertySetHelper(
: rBHelper( rBHelper_ ), : rBHelper( rBHelper_ ),
aBoundLC( rBHelper_.rMutex ), aBoundLC( rBHelper_.rMutex ),
aVetoableLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ),
m_bFireEvent(true),
m_pReserved( m_pReserved(
new Impl( bIgnoreRuntimeExceptionsWhileFiring, i_pFireEvents) ) new Impl( bIgnoreRuntimeExceptionsWhileFiring, i_pFireEvents) )
{ {
} }
OPropertySetHelper2::OPropertySetHelper2(
OBroadcastHelper & irBHelper,
IEventNotificationHook *i_pFireEvents,
bool bIgnoreRuntimeExceptionsWhileFiring)
:OPropertySetHelper( irBHelper, i_pFireEvents, bIgnoreRuntimeExceptionsWhileFiring )
{
}
/** /**
* You must call disposing before. * You must call disposing before.
*/ */
OPropertySetHelper::~OPropertySetHelper() SAL_THROW( () ) OPropertySetHelper::~OPropertySetHelper() SAL_THROW( () )
{ {
} }
OPropertySetHelper2::~OPropertySetHelper2() SAL_THROW( () )
{
}
/** // XInterface
* These method is called from queryInterface, if no delegator is set.
* Otherwise this method is called from the delegator.
*/
// XAggregation
Any OPropertySetHelper::queryInterface( const ::com::sun::star::uno::Type & rType ) Any OPropertySetHelper::queryInterface( const ::com::sun::star::uno::Type & rType )
throw (RuntimeException) throw (RuntimeException)
{ {
return ::cppu::queryInterface( return ::cppu::queryInterface(
rType, rType,
static_cast< XPropertySet * >( this ), static_cast< XPropertySet * >( this ),
static_cast< XPropertySetOption * >( this ),
static_cast< XMultiPropertySet * >( this ), static_cast< XMultiPropertySet * >( this ),
static_cast< XFastPropertySet * >( this ) ); static_cast< XFastPropertySet * >( this ) );
} }
Any OPropertySetHelper2::queryInterface( const ::com::sun::star::uno::Type & rType )
throw (RuntimeException)
{
Any cnd(cppu::queryInterface(rType, static_cast< XPropertySetOption * >(this)));
if ( cnd.hasValue() )
return cnd;
else
return OPropertySetHelper::queryInterface(rType);
}
/** /**
* called from the derivee's XTypeProvider::getTypes implementation * called from the derivee's XTypeProvider::getTypes implementation
*/ */
...@@ -631,10 +646,11 @@ void OPropertySetHelper::fire ...@@ -631,10 +646,11 @@ void OPropertySetHelper::fire
sal_Bool bVetoable sal_Bool bVetoable
) )
{ {
if (!m_bFireEvent) OSL_ENSURE( m_pReserved.get(), "No OPropertySetHelper::Impl" );
if (! m_pReserved->m_bFireEvents)
return; return;
OSL_ENSURE( m_pReserved.get(), "No OPropertySetHelper::Impl" );
if (m_pReserved->m_pFireEvents) { if (m_pReserved->m_pFireEvents) {
m_pReserved->m_pFireEvents->fireEvents( m_pReserved->m_pFireEvents->fireEvents(
pnHandles, nHandles, bVetoable, pnHandles, nHandles, bVetoable,
...@@ -1037,10 +1053,10 @@ void OPropertySetHelper::firePropertiesChangeEvent( ...@@ -1037,10 +1053,10 @@ void OPropertySetHelper::firePropertiesChangeEvent(
delete [] pHandles; delete [] pHandles;
} }
void OPropertySetHelper::enableChangeListenerNotification( sal_Bool bEnable ) void OPropertySetHelper2::enableChangeListenerNotification( sal_Bool bEnable )
throw(::com::sun::star::uno::RuntimeException) throw(::com::sun::star::uno::RuntimeException)
{ {
m_bFireEvent = bEnable; m_pReserved->m_bFireEvents = bEnable;
} }
#ifdef xdvnsdfln #ifdef xdvnsdfln
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment