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

Caolán McNamara caolanm at redhat.com
Thu Nov 24 12:04:16 UTC 2016


 connectivity/source/drivers/dbase/dindexnode.cxx |   11 +++++++++++
 connectivity/source/inc/dbase/dindexnode.hxx     |    1 +
 2 files changed, 12 insertions(+)

New commits:
commit e190825b739712ba0c861d74fc1a589c7e94672d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 24 12:01:57 2016 +0000

    coverity#1371267 Missing move assignment operator
    
    Change-Id: Iefcfd20ac17f24f4fc3faec72b15de6bfb42eeac

diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 7790f74..7c82b58 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -865,6 +865,17 @@ ONDXPagePtr& ONDXPagePtr::operator=(ONDXPagePtr const & rOther)
     return *this;
 }
 
+ONDXPagePtr& ONDXPagePtr::operator=(ONDXPagePtr && rOther)
+{
+    if (mpPage != nullptr) {
+        mpPage->ReleaseRef();
+    }
+    mpPage = rOther.mpPage;
+    nPagePos = rOther.nPagePos;
+    rOther.mpPage = nullptr;
+    return *this;
+}
+
 static sal_uInt32 nValue;
 
 SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage)
diff --git a/connectivity/source/inc/dbase/dindexnode.hxx b/connectivity/source/inc/dbase/dindexnode.hxx
index 3a0e58d..7adf900 100644
--- a/connectivity/source/inc/dbase/dindexnode.hxx
+++ b/connectivity/source/inc/dbase/dindexnode.hxx
@@ -97,6 +97,7 @@ namespace connectivity
             ~ONDXPagePtr();
             void Clear();
             ONDXPagePtr& operator=(ONDXPagePtr const & rRef);
+            ONDXPagePtr& operator=(ONDXPagePtr && rRef);
             bool Is() const { return mpPage != nullptr; }
 
             ONDXPage * operator ->() const { assert(mpPage != nullptr); return mpPage; }


More information about the Libreoffice-commits mailing list