View | Details | Raw Unified | Return to issue 76505
Collapse All | Expand All

(-)tools/inc/ref.hxx (-42 lines)
Lines 126-158 PRV_SV_IMPL_REF_COUNTERS( ClassName, Loc Link Here
126
						  OwnerLock( TRUE ), OwnerLock( FALSE ), 	\
126
						  OwnerLock( TRUE ), OwnerLock( FALSE ), 	\
127
						  EMPTYARG, pObj )
127
						  EMPTYARG, pObj )
128
128
129
#define SV_DECL_COMPAT_REF( ClassName )			\
130
class ClassName;								\
131
class ClassName##Ref							\
132
{												\
133
protected:										\
134
	SvRefBase* pRefbase;						\
135
	PRV_SV_DECL_REF( ClassName ) 			    \
136
public:											\
137
	static void Destroy( void* );		        \
138
};
139
140
#define SV_COMPAT_REF_INIT												\
141
pObj ? ( pRefbase =  													\
142
 (SfxPointerServer::GetServer()->HasPointer( pObj ) ? NULL :			\
143
 ((*(SvRefBase **)SfxPointerServer::GetServer()->CreatePointer(pObj))=	\
144
   new SvCompatRefBase( &Destroy, pObj ) ),								\
145
   (SvRefBase *)SfxPointerServer::GetServer()->GetPointer(pObj))) : 0;
146
147
#define SV_IMPL_COMPAT_REF( ClassName )										\
148
PRV_SV_IMPL_REF_COUNTERS( ClassName, Ref, AddRef(), AddNextRef(), 			\
149
						  ReleaseReference(), SV_COMPAT_REF_INIT, pRefbase )\
150
inline void ClassName##Ref::Destroy( void* pObj)							\
151
{																			\
152
	SfxPointerServer::GetServer()->ReleasePointer( pObj );					\
153
	delete ( ClassName* ) pObj;												\
154
}
155
156
#define SV_DECL_IMPL_REF(ClassName)				\
129
#define SV_DECL_IMPL_REF(ClassName)				\
157
    SV_DECL_REF(ClassName)						\
130
    SV_DECL_REF(ClassName)						\
158
    SV_IMPL_REF(ClassName)
131
    SV_IMPL_REF(ClassName)
Lines 161-170 inline void ClassName##Ref::Destroy( voi Link Here
161
    SV_DECL_LOCK(ClassName)						\
134
    SV_DECL_LOCK(ClassName)						\
162
    SV_IMPL_LOCK(ClassName)
135
    SV_IMPL_LOCK(ClassName)
163
136
164
#define SV_DECL_IMPL_COMPAT_REF( ClassName )	\
165
    SV_DECL_COMPAT_REF(ClassName)				\
166
    SV_IMPL_COMPAT_REF(ClassName)
167
168
137
169
/************************** S v R e f L i s t ****************************/
138
/************************** S v R e f L i s t ****************************/
170
#define PRV_SV_DECL_REF_LIST(CN,EN,vis) \
139
#define PRV_SV_DECL_REF_LIST(CN,EN,vis) \
Lines 414-430 public: Link Here
414
    UINT32          GetRefCount() const { return nRefCount; }
383
    UINT32          GetRefCount() const { return nRefCount; }
415
};
384
};
416
385
417
class SvCompatRefBase : public SvRefBase
418
{
419
	void (*pFunc)( void* );
420
	void *pObj;
421
protected:
422
	virtual         ~SvCompatRefBase();
423
public:
424
	SvCompatRefBase( void (*pFuncP)( void*), void *pObjP ) :
425
		pFunc( pFuncP ), pObj( pObjP ) {}
426
};
427
428
#if _SOLAR__PRIVATE
386
#if _SOLAR__PRIVATE
429
#ifndef EMPTYARG
387
#ifndef EMPTYARG
430
#define EMPTYARG
388
#define EMPTYARG
(-)tools/source/ref/ref.cxx (-4 lines)
Lines 57-64 void SvRefBase::QueryDelete() Link Here
57
	delete this;
57
	delete this;
58
}
58
}
59
59
60
SvCompatRefBase::~SvCompatRefBase()
61
{
62
	(*pFunc)( pObj );
63
}
64
60

Return to issue 76505