include/osl/pipe.hxx      |   15 +++++++++++++++
 include/osl/pipe_decl.hxx |    8 ++++++++
 2 files changed, 23 insertions(+)

New commits:
commit 9dbb9f9a07d43841473770e9d8c4d4f1f5ffba9a
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Tue Sep 20 11:28:06 2016 +0200

    cid#1371291: Add move semantics
    
    Change-Id: I9bca3413e023b6909fbf75e567ed75739189bc43

diff --git a/include/osl/pipe.hxx b/include/osl/pipe.hxx
index 04a971b..743dec3 100644
--- a/include/osl/pipe.hxx
+++ b/include/osl/pipe.hxx
@@ -50,6 +50,11 @@ namespace osl
             osl_acquirePipe( m_handle );
     }
 
+#if defined LIBO_INTERNAL_ONLY
+    Pipe::Pipe(Pipe && other): m_handle(other.m_handle) {
+        other.m_handle = nullptr;
+    }
+#endif
 
     inline Pipe::Pipe( oslPipe pipe, __sal_NoAcquire )
         : m_handle ( pipe )
@@ -91,6 +96,16 @@ namespace osl
         return *this;
     }
 
+#if defined LIBO_INTERNAL_ONLY
+    Pipe & Pipe::operator =(Pipe && other) {
+        if (m_handle != nullptr) {
+            osl_releasePipe(m_handle);
+        }
+        m_handle = other.m_handle;
+        other.m_handle = nullptr;
+        return *this;
+    }
+#endif
 
     inline Pipe & SAL_CALL Pipe::operator=( oslPipe pipe)
     {
diff --git a/include/osl/pipe_decl.hxx b/include/osl/pipe_decl.hxx
index 0c0430e..7383324 100644
--- a/include/osl/pipe_decl.hxx
+++ b/include/osl/pipe_decl.hxx
@@ -58,6 +58,10 @@ public:
     */
     inline Pipe(const Pipe& pipe);
 
+#if defined LIBO_INTERNAL_ONLY
+    inline Pipe(Pipe && other);
+#endif
+
     /** Constructs a Pipe reference without acquiring the handle
     */
     inline Pipe( oslPipe pipe, __sal_NoAcquire noacquire );
@@ -103,6 +107,10 @@ public:
     */
     inline Pipe& SAL_CALL operator= (const Pipe& pipe);
 
+#if defined LIBO_INTERNAL_ONLY
+    inline Pipe & operator =(Pipe && other);
+#endif
+
     /** Assignment operator. If pipe was already created, the old one will
         be discarded.
     */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to