Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ae91e583
Kaydet (Commit)
ae91e583
authored
Nis 07, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Unroll sole use of SV_IMPL/DECL_LOCK
Change-Id: I0d4691f700a415d0376e2bc346bc51fbf6a000b2
üst
97cfb1fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
54 deletions
+75
-54
objsh.hxx
include/sfx2/objsh.hxx
+45
-2
ref.hxx
include/tools/ref.hxx
+30
-52
No files found.
include/sfx2/objsh.hxx
Dosyayı görüntüle @
ae91e583
...
@@ -720,8 +720,51 @@ public:
...
@@ -720,8 +720,51 @@ public:
SV_DECL_REF
(
SfxObjectShell
)
SV_DECL_REF
(
SfxObjectShell
)
#endif
#endif
SV_DECL_LOCK
(
SfxObjectShell
)
class
SfxObjectShellLock
SV_IMPL_LOCK
(
SfxObjectShell
)
{
protected
:
SfxObjectShell
*
pObj
;
public
:
inline
SfxObjectShellLock
()
{
pObj
=
0
;
}
inline
SfxObjectShellLock
(
const
SfxObjectShellLock
&
rObj
);
inline
SfxObjectShellLock
(
SfxObjectShell
*
pObjP
);
inline
void
Clear
();
inline
~
SfxObjectShellLock
();
inline
SfxObjectShellLock
&
operator
=
(
const
SfxObjectShellLock
&
rObj
);
inline
SfxObjectShellLock
&
operator
=
(
SfxObjectShell
*
pObj
);
inline
bool
Is
()
const
{
return
pObj
!=
NULL
;
}
inline
SfxObjectShell
*
operator
&
()
const
{
return
pObj
;
}
inline
SfxObjectShell
*
operator
->
()
const
{
return
pObj
;
}
inline
SfxObjectShell
&
operator
*
()
const
{
return
*
pObj
;
}
inline
operator
SfxObjectShell
*
()
const
{
return
pObj
;
}
};
inline
SfxObjectShellLock
::
SfxObjectShellLock
(
const
SfxObjectShellLock
&
rObj
)
{
pObj
=
rObj
.
pObj
;
if
(
pObj
)
{
pObj
->
OwnerLock
(
true
);
}
}
inline
SfxObjectShellLock
::
SfxObjectShellLock
(
SfxObjectShell
*
pObjP
)
{
pObj
=
pObjP
;
if
(
pObj
)
{
pObj
->
OwnerLock
(
true
);
}
}
inline
void
SfxObjectShellLock
::
Clear
()
{
if
(
pObj
)
{
SfxObjectShell
*
const
pRefObj
=
pObj
;
pObj
=
0
;
pRefObj
->
OwnerLock
(
false
);
}
}
inline
SfxObjectShellLock
::~
SfxObjectShellLock
()
{
if
(
pObj
)
{
pObj
->
OwnerLock
(
false
);
}
}
inline
SfxObjectShellLock
&
SfxObjectShellLock
::
operator
=
(
const
SfxObjectShellLock
&
rObj
)
{
if
(
rObj
.
pObj
)
rObj
.
pObj
->
OwnerLock
(
true
);
SfxObjectShell
*
const
pRefObj
=
pObj
;
pObj
=
rObj
.
pObj
;
if
(
pRefObj
)
{
pRefObj
->
OwnerLock
(
false
);
}
return
*
this
;
}
inline
SfxObjectShellLock
&
SfxObjectShellLock
::
operator
=
(
SfxObjectShell
*
pObjP
)
{
return
*
this
=
SfxObjectShellLock
(
pObjP
);
}
SV_IMPL_REF
(
SfxObjectShell
)
SV_IMPL_REF
(
SfxObjectShell
)
class
AutoReloadTimer_Impl
:
public
Timer
class
AutoReloadTimer_Impl
:
public
Timer
...
...
include/tools/ref.hxx
Dosyayı görüntüle @
ae91e583
...
@@ -22,77 +22,55 @@
...
@@ -22,77 +22,55 @@
#include <tools/toolsdllapi.h>
#include <tools/toolsdllapi.h>
#include <vector>
#include <vector>
#define PRV_SV_IMPL_REF_COUNTERS( ClassName, Ref, AddRef, AddNextRef, ReleaseRef, pRefbase ) \
#define SV_DECL_REF( ClassName ) \
class ClassName; \
class ClassName##Ref \
{ \
protected: \
ClassName * pObj; \
public: \
inline ClassName##Ref() { pObj = 0; } \
inline ClassName##Ref( const ClassName##Ref & rObj ); \
inline ClassName##Ref( ClassName * pObjP ); \
inline void Clear(); \
inline ~ClassName##Ref(); \
inline ClassName##Ref & operator = ( const ClassName##Ref & rObj ); \
inline ClassName##Ref & operator = ( ClassName * pObj ); \
inline bool Is() const { return pObj != NULL; } \
inline ClassName * operator & () const { return pObj; } \
inline ClassName * operator -> () const { return pObj; } \
inline ClassName & operator * () const { return *pObj; } \
inline operator ClassName * () const { return pObj; } \
};
#define SV_IMPL_REF( ClassName ) \
inline ClassName##Ref::ClassName##Ref( const ClassName##Ref & rObj ) \
inline ClassName##Ref::ClassName##Ref( const ClassName##Ref & rObj ) \
{ pObj = rObj.pObj; if( pObj ) { p
Refbase->AddNextRef; } }
\
{ pObj = rObj.pObj; if( pObj ) { p
Obj->AddNextRef(); } }
\
inline ClassName##Ref::ClassName##Ref( ClassName * pObjP ) \
inline ClassName##Ref::ClassName##Ref( ClassName * pObjP ) \
{ pObj = pObjP; if( pObj ) { p
Refbase->AddRef; } }
\
{ pObj = pObjP; if( pObj ) { p
Obj->AddRef(); } }
\
inline void ClassName##Ref::Clear() \
inline void ClassName##Ref::Clear() \
{ \
{ \
if( pObj ) \
if( pObj ) \
{ \
{ \
ClassName* const pRefObj = p
Refbase;
\
ClassName* const pRefObj = p
Obj;
\
pObj = 0; \
pObj = 0; \
pRefObj->ReleaseRef
;
\
pRefObj->ReleaseRef
erence();
\
} \
} \
} \
} \
inline ClassName##Ref::~ClassName##Ref() \
inline ClassName##Ref::~ClassName##Ref() \
{ if( pObj ) { p
Refbase->ReleaseRef; } }
\
{ if( pObj ) { p
Obj->ReleaseReference(); } }
\
inline ClassName##Ref & ClassName##Ref:: \
inline ClassName##Ref & ClassName##Ref:: \
operator = ( const ClassName##Ref & rObj ) \
operator = ( const ClassName##Ref & rObj ) \
{ \
{ \
if( rObj.pObj ) rObj.p
Refbase->AddNextRef;
\
if( rObj.pObj ) rObj.p
Obj->AddNextRef();
\
ClassName* const pRefObj = p
Refbase;
\
ClassName* const pRefObj = p
Obj;
\
pObj = rObj.pObj; \
pObj = rObj.pObj; \
if( pRefObj ) { pRefObj->ReleaseRef
; }
\
if( pRefObj ) { pRefObj->ReleaseRef
erence(); }
\
return *this; \
return *this; \
} \
} \
inline ClassName##Ref & ClassName##Ref::operator = ( ClassName * pObjP ) \
inline ClassName##Ref & ClassName##Ref::operator = ( ClassName * pObjP ) \
{ return *this = ClassName##Ref( pObjP ); }
{ return *this = ClassName##Ref( pObjP ); }
#define PRV_SV_DECL_REF_LOCK(ClassName, Ref) \
protected: \
ClassName * pObj; \
public: \
inline ClassName##Ref() { pObj = 0; } \
inline ClassName##Ref( const ClassName##Ref & rObj ); \
inline ClassName##Ref( ClassName * pObjP ); \
inline void Clear(); \
inline ~ClassName##Ref(); \
inline ClassName##Ref & operator = ( const ClassName##Ref & rObj ); \
inline ClassName##Ref & operator = ( ClassName * pObj ); \
inline bool Is() const { return pObj != NULL; } \
inline ClassName * operator & () const { return pObj; } \
inline ClassName * operator -> () const { return pObj; } \
inline ClassName & operator * () const { return *pObj; } \
inline operator ClassName * () const { return pObj; }
#define PRV_SV_DECL_REF( ClassName ) \
PRV_SV_DECL_REF_LOCK( ClassName, Ref )
#define SV_DECL_REF( ClassName ) \
class ClassName; \
class ClassName##Ref \
{ \
PRV_SV_DECL_REF( ClassName ) \
};
#define SV_DECL_LOCK( ClassName ) \
class ClassName; \
class ClassName##Lock \
{ \
PRV_SV_DECL_REF_LOCK( ClassName, Lock ) \
};
#define SV_IMPL_REF( ClassName ) \
PRV_SV_IMPL_REF_COUNTERS( ClassName, Ref, AddRef(), AddNextRef(),\
ReleaseReference(), pObj )
#define SV_IMPL_LOCK( ClassName ) \
PRV_SV_IMPL_REF_COUNTERS( ClassName, Lock, OwnerLock( true ), \
OwnerLock( true ), OwnerLock( false ), \
pObj )
#define SV_DECL_IMPL_REF(ClassName) \
#define SV_DECL_IMPL_REF(ClassName) \
SV_DECL_REF(ClassName) \
SV_DECL_REF(ClassName) \
SV_IMPL_REF(ClassName)
SV_IMPL_REF(ClassName)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment