summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-23 11:42:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-03-23 14:58:01 +0000
commit8ac384a5ca391693773478210b6334862967ae30 (patch)
tree55dbb490f40c6f986226ba0b3a8ad8805e9d2873 /tools
parentd3e42606765cb4c44c8f876a61def608fa24a757 (diff)
only SV_DECL_COMPAT_WEAK is still in use
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/ref.hxx37
1 files changed, 3 insertions, 34 deletions
diff --git a/tools/inc/tools/ref.hxx b/tools/inc/tools/ref.hxx
index c30fe395c052..6b6202781ce3 100644
--- a/tools/inc/tools/ref.hxx
+++ b/tools/inc/tools/ref.hxx
@@ -388,21 +388,6 @@ SV_DECL_IMPL_REF(SvRefBase)
SV_DECL_REF_LIST(SvRefBase,SvRefBase*)
-class SvWeakBase;
-class SvWeakHdl : public SvRefBase
-{
- friend class SvWeakBase;
- SvWeakBase* _pObj;
-public:
- void ResetWeakBase( ) { _pObj = 0; }
-private:
- SvWeakHdl( SvWeakBase* pObj ) : _pObj( pObj ) {}
-public:
- SvWeakBase* GetObj() { return _pObj; }
-};
-
-SV_DECL_IMPL_REF( SvWeakHdl )
-
class SvCompatWeakHdl : public SvRefBase
{
friend class SvCompatWeakBase;
@@ -415,17 +400,6 @@ public:
SV_DECL_IMPL_REF( SvCompatWeakHdl )
-class SvWeakBase
-{
- SvWeakHdlRef _xHdl;
-public:
- SvWeakHdl* GetHdl() { return _xHdl; }
-
- // Wg CompilerWarnung nicht ueber Initializer
- SvWeakBase() { _xHdl = new SvWeakHdl( this ); }
- ~SvWeakBase() { _xHdl->ResetWeakBase(); }
-};
-
class SvCompatWeakBase
{
SvCompatWeakHdlRef _xHdl;
@@ -437,10 +411,10 @@ public:
~SvCompatWeakBase() { _xHdl->ResetWeakBase(); }
};
-#define SV_DECL_WEAK_IMPL( ClassName, HdlName ) \
+#define SV_DECL_COMPAT_WEAK( ClassName ) \
class ClassName##Weak \
{ \
- HdlName _xHdl; \
+ SvCompatWeakHdlRef _xHdl; \
public: \
inline ClassName##Weak( ) {} \
inline ClassName##Weak( ClassName* pObj ) { \
@@ -448,7 +422,7 @@ public: \
inline void Clear() { _xHdl.Clear(); } \
inline ClassName##Weak& operator = ( ClassName * pObj ) { \
_xHdl = pObj ? pObj->GetHdl() : 0; return *this; } \
- inline sal_Bool Is() const { \
+ inline sal_Bool Is() const { \
return _xHdl.Is() && _xHdl->GetObj(); } \
inline ClassName * operator & () const { \
return (ClassName*) ( _xHdl.Is() ? _xHdl->GetObj() : 0 ); } \
@@ -460,11 +434,6 @@ public: \
return (ClassName*) (_xHdl.Is() ? _xHdl->GetObj() : 0 ); } \
};
-#define SV_DECL_WEAK( ClassName ) SV_DECL_WEAK_IMPL( ClassName, SvWeakHdlRef )
-#define SV_DECL_COMPAT_WEAK( ClassName ) SV_DECL_WEAK_IMPL( ClassName, SvCompatWeakHdlRef )
-
-SV_DECL_WEAK( SvWeakBase )
-
#endif // _Weak_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */