[Libreoffice-commits] core.git: cppu/source

Stephan Bergmann sbergman at redhat.com
Tue Sep 20 16:24:01 UTC 2016


 cppu/source/uno/lbmap.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 11aa8ac4e3ae212cd06ffe9f24c5d99af5dfb9a3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Sep 20 18:22:32 2016 +0200

    cid#1371314: Add move semantics
    
    Change-Id: I995cbdb2b6adc707abe5f1a179e94251641120bc

diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index e5c3568..7cfba7a 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -62,10 +62,20 @@ class Mapping
 public:
     inline explicit Mapping( uno_Mapping * pMapping = nullptr );
     inline Mapping( const Mapping & rMapping );
+    Mapping(Mapping && other): _pMapping(other._pMapping)
+    { other._pMapping = nullptr; }
     inline ~Mapping();
     inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping );
     inline Mapping & SAL_CALL operator = ( const Mapping & rMapping )
         { return operator = ( rMapping._pMapping ); }
+    Mapping & operator =(Mapping && other) {
+        if (_pMapping != nullptr) {
+            (*_pMapping->release)(_pMapping);
+        }
+        _pMapping = other._pMapping;
+        other._pMapping = nullptr;
+        return *this;
+    }
     inline uno_Mapping * SAL_CALL get() const
         { return _pMapping; }
     inline bool SAL_CALL is() const


More information about the Libreoffice-commits mailing list