[Libreoffice-commits] core.git: cppuhelper/source include/cppuhelper

Stephan Bergmann sbergman at redhat.com
Mon Sep 19 10:42:14 UTC 2016


 cppuhelper/source/gcc3.map     |    5 +++++
 cppuhelper/source/weak.cxx     |   10 ++++++++++
 include/cppuhelper/weakref.hxx |    9 +++++++++
 3 files changed, 24 insertions(+)

New commits:
commit 4f86b7a86cae630c19f6f0d1b4d6672c25e2eb3c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 19 12:40:51 2016 +0200

    cid#1371142: Move semantics for css::uno::WeakReferenceHelper
    
    Change-Id: I442b2d8061bd7d50cbf832b345a7a63461e26224

diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 12c29834a..f1537e8 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -430,6 +430,11 @@ global:
     _ZN4cppu15supportsServiceEPN3com3sun4star4lang12XServiceInfoERKN3rtl8OUStringE; # cppu::supportsService(com::sun::star::lang::XServiceInfo*, rtl::OUString const&)
 } UDK_3.8;
 
+LIBO_UDK_5.3 { # LibO 5.3
+global:
+    _ZN3com3sun4star3uno19WeakReferenceHelperaSEOS3_; # com::sun::star::uno::WeakReferenceHelper::operator=(com::sun::star::uno::WeakReferenceHelper&&)
+} LIBO_UDK_3.9;
+
 # Unique libstdc++ symbols:
 GLIBCXX_3.4 {
     global:
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 1c9b57c..9a3a8ba 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -24,7 +24,9 @@
 #include <cppuhelper/interfacecontainer.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/queryinterface.hxx>
+
 #include <algorithm>
+#include <utility>
 
 using namespace osl;
 using namespace com::sun::star::uno;
@@ -485,6 +487,14 @@ WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& r
     return operator = ( xInt );
 }
 
+WeakReferenceHelper & WeakReferenceHelper::operator =(
+    WeakReferenceHelper && other)
+{
+    clear();
+    std::swap(m_pImpl, other.m_pImpl);
+    return *this;
+}
+
 WeakReferenceHelper & SAL_CALL
 WeakReferenceHelper::operator= (const Reference< XInterface > & xInt)
 {
diff --git a/include/cppuhelper/weakref.hxx b/include/cppuhelper/weakref.hxx
index 11095b7..250bb81 100644
--- a/include/cppuhelper/weakref.hxx
+++ b/include/cppuhelper/weakref.hxx
@@ -63,6 +63,11 @@ public:
     */
     WeakReferenceHelper( const WeakReferenceHelper & rWeakRef );
 
+#if defined LIBO_INTERNAL_ONLY
+    WeakReferenceHelper(WeakReferenceHelper && other): m_pImpl(other.m_pImpl)
+    { other.m_pImpl = nullptr; }
+#endif
+
     /** Initialize this reference with the hard interface reference xInt. If the implementation
         behind xInt does not support XWeak or xInt is null then this reference will be null.
 
@@ -80,6 +85,10 @@ public:
     */
     WeakReferenceHelper & SAL_CALL operator = ( const WeakReferenceHelper & rWeakRef );
 
+#if defined LIBO_INTERNAL_ONLY
+    WeakReferenceHelper & operator =(WeakReferenceHelper && other);
+#endif
+
     /** Releases this reference and takes over hard reference xInt.
         If the implementation behind xInt does not support XWeak
         or XInt is null, then this reference is null.


More information about the Libreoffice-commits mailing list