summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-10 12:02:32 +0200
committerNoel Grandin <noel@peralex.com>2014-10-10 12:04:09 +0200
commitfaa6455995966e41653204779d055b885b27fc4c (patch)
tree60c7d54a2f8c23d238076d29d52de42f98fe49e0 /connectivity
parent315693688d2ccc6f922fd552f2dd72f2ecc45913 (diff)
add copy constructor for ONDXPagePtr class
which I forgot in commit a0a919d2b541c415ad9b81d2ee91895bf106e9bb "remove SvRefBase::QueryDelete" Change-Id: Ib52b9cb58451abd62f75d7376b069bf6aef550b2
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/dbase/dindexnode.cxx13
-rw-r--r--connectivity/source/inc/dbase/dindexnode.hxx2
2 files changed, 15 insertions, 0 deletions
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index fe206273db37..f1fb06831808 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -835,6 +835,19 @@ ONDXPagePtr::ONDXPagePtr(ONDXPage* pRefPage)
nPagePos = pRefPage->GetPagePos();
}
+ONDXPagePtr& ONDXPagePtr::operator=(ONDXPagePtr const & rOther)
+{
+ if (rOther.mpPage != 0) {
+ rOther.mpPage->AddNextRef();
+ }
+ ONDXPage * pOldObj = mpPage;
+ mpPage = rOther.mpPage;
+ if (pOldObj != 0) {
+ pOldObj->ReleaseRef();
+ }
+ 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 791df0236efd..b32163511e6a 100644
--- a/connectivity/source/inc/dbase/dindexnode.hxx
+++ b/connectivity/source/inc/dbase/dindexnode.hxx
@@ -94,6 +94,7 @@ namespace connectivity
ONDXPage* mpPage;
sal_uInt32 nPagePos; // Position in the index file
+
public:
ONDXPagePtr(sal_uInt32 nPos = 0) : mpPage(0), nPagePos(nPos) {}
ONDXPagePtr(const ONDXPagePtr& rRef);
@@ -107,6 +108,7 @@ namespace connectivity
ONDXPage * operator ->() const { assert(mpPage != 0); return mpPage; }
bool Is() const { return mpPage != 0; }
inline void Clear();
+ ONDXPagePtr& operator=(const ONDXPagePtr& rRef);
};
// Index Page