From e190825b739712ba0c861d74fc1a589c7e94672d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 24 Nov 2016 12:01:57 +0000 Subject: [PATCH] coverity#1371267 Missing move assignment operator Change-Id: Iefcfd20ac17f24f4fc3faec72b15de6bfb42eeac --- connectivity/source/drivers/dbase/dindexnode.cxx | 11 +++++++++++ connectivity/source/inc/dbase/dindexnode.hxx | 1 + 2 files changed, 12 insertions(+) diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 7790f74d6aac..7c82b58553d5 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 3a0e58dd9800..7adf900173d4 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; }