diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-07 10:42:07 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 19:58:50 +0100 |
commit | 3ad9d2550f922ae7f555ca0753c57907d4d78ab6 (patch) | |
tree | e4c49fb42eca8566d9ab56600f4d372f4c2eb748 /include/vcl/vclptr.hxx | |
parent | 09b4246c6aa5e75c89df2961816b0124fea7fd78 (diff) |
vcl: make VclPtr<T>(T*) constructor explicit
to make it obvious in the code when we are translating between the
reference-counted type and raw pointers, since that is the danger-point
Change-Id: I32822432325fa34969e78cccf937e2ccbe1bfb70
Diffstat (limited to 'include/vcl/vclptr.hxx')
-rw-r--r-- | include/vcl/vclptr.hxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx index 5aa0c6959497..c32dbcc6691d 100644 --- a/include/vcl/vclptr.hxx +++ b/include/vcl/vclptr.hxx @@ -88,7 +88,7 @@ public: /** Constructor... */ - inline VclPtr (reference_type * pBody) + explicit inline VclPtr (reference_type * pBody) : m_rInnerRef(pBody) {} @@ -131,6 +131,11 @@ public: return m_rInnerRef.get(); } + inline void SAL_CALL set(reference_type *pBody) + { + m_rInnerRef.set(pBody); + } + inline SAL_CALL operator reference_type * () const { return m_rInnerRef.get(); |