Kaydet (Commit) f219bfb2 authored tarafından Noel Grandin's avatar Noel Grandin

use SimpleReferenceObject in svx module

to replace hand-rolled version

Change-Id: I084a21161ae44991199fbd2b12d61dcb7d592408
üst 482f9792
...@@ -148,7 +148,6 @@ namespace svxform ...@@ -148,7 +148,6 @@ namespace svxform
private: private:
::osl::Mutex m_aMutex; ::osl::Mutex m_aMutex;
oslInterlockedCount m_refCount;
ListenerImplementation m_pScriptListener; ListenerImplementation m_pScriptListener;
FmFormModel& m_rFormModel; FmFormModel& m_rFormModel;
bool m_bDisposed; bool m_bDisposed;
...@@ -165,10 +164,6 @@ namespace svxform ...@@ -165,10 +164,6 @@ namespace svxform
virtual void revokeEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager ) SAL_OVERRIDE; virtual void revokeEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager ) SAL_OVERRIDE;
virtual void dispose() SAL_OVERRIDE; virtual void dispose() SAL_OVERRIDE;
// IReference
virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
private: private:
void impl_registerOrRevoke_throw( const Reference< XEventAttacherManager >& _rxManager, bool _bRegister ); void impl_registerOrRevoke_throw( const Reference< XEventAttacherManager >& _rxManager, bool _bRegister );
}; };
...@@ -804,8 +799,7 @@ namespace svxform ...@@ -804,8 +799,7 @@ namespace svxform
FormScriptingEnvironment::FormScriptingEnvironment( FmFormModel& _rModel ) FormScriptingEnvironment::FormScriptingEnvironment( FmFormModel& _rModel )
:m_refCount( 0 ) :m_pScriptListener( NULL )
,m_pScriptListener( NULL )
,m_rFormModel( _rModel ) ,m_rFormModel( _rModel )
,m_bDisposed( false ) ,m_bDisposed( false )
{ {
...@@ -856,23 +850,6 @@ namespace svxform ...@@ -856,23 +850,6 @@ namespace svxform
} }
oslInterlockedCount SAL_CALL FormScriptingEnvironment::acquire()
{
return osl_atomic_increment( &m_refCount );
}
oslInterlockedCount SAL_CALL FormScriptingEnvironment::release()
{
if ( 0 == osl_atomic_decrement( &m_refCount ) )
{
delete this;
return 0;
}
return m_refCount;
}
IFormScriptingEnvironment::~IFormScriptingEnvironment() IFormScriptingEnvironment::~IFormScriptingEnvironment()
{ {
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <com/sun/star/script/XEventAttacherManager.hpp> #include <com/sun/star/script/XEventAttacherManager.hpp>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <salhelper/simplereferenceobject.hxx>
class FmFormModel; class FmFormModel;
...@@ -35,7 +36,7 @@ namespace svxform ...@@ -35,7 +36,7 @@ namespace svxform
/** describes the interface implemented by a component which handles scripting requirements /** describes the interface implemented by a component which handles scripting requirements
in a form/control environment. in a form/control environment.
*/ */
class SAL_NO_VTABLE IFormScriptingEnvironment : public ::rtl::IReference class SAL_NO_VTABLE IFormScriptingEnvironment : public ::salhelper::SimpleReferenceObject
{ {
public: public:
/** registers an XEventAttacherManager whose events should be monitored and handled /** registers an XEventAttacherManager whose events should be monitored and handled
......
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