summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/dbase/dindexnode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/dbase/dindexnode.cxx')
-rw-r--r--connectivity/source/drivers/dbase/dindexnode.cxx37
1 files changed, 30 insertions, 7 deletions
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 714ea8736781..064660b046a3 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -805,22 +805,31 @@ SvStream& connectivity::dbase::WriteONDXPagePtr(SvStream &rStream, const ONDXPag
return rStream;
}
-
// ONDXPagePtr
+ONDXPagePtr::ONDXPagePtr()
+ : mpPage(nullptr)
+ , nPagePos(0)
+{
+}
+ONDXPagePtr::ONDXPagePtr(ONDXPagePtr&& rRef)
+{
+ mpPage = rRef.mpPage;
+ rRef.mpPage = nullptr;
+ nPagePos = rRef.nPagePos;
+}
-ONDXPagePtr::ONDXPagePtr(const ONDXPagePtr& rRef)
- :mpPage(rRef.mpPage)
- ,nPagePos(rRef.nPagePos)
+ONDXPagePtr::ONDXPagePtr(ONDXPagePtr const & rRef)
+ : mpPage(rRef.mpPage)
+ , nPagePos(rRef.nPagePos)
{
if (mpPage != nullptr)
mpPage->AddNextRef();
}
-
ONDXPagePtr::ONDXPagePtr(ONDXPage* pRefPage)
- :mpPage(pRefPage)
- ,nPagePos(0)
+ : mpPage(pRefPage)
+ , nPagePos(0)
{
if (mpPage != nullptr)
mpPage->AddFirstRef();
@@ -828,6 +837,20 @@ ONDXPagePtr::ONDXPagePtr(ONDXPage* pRefPage)
nPagePos = pRefPage->GetPagePos();
}
+ONDXPagePtr::~ONDXPagePtr()
+{
+ if (mpPage != nullptr) mpPage->ReleaseRef();
+}
+
+void ONDXPagePtr::Clear()
+{
+ if (mpPage != nullptr) {
+ ONDXPage * pRefObj = mpPage;
+ mpPage = nullptr;
+ pRefObj->ReleaseRef();
+ }
+}
+
ONDXPagePtr& ONDXPagePtr::operator=(ONDXPagePtr const & rOther)
{
if (rOther.mpPage != nullptr) {