[Libreoffice-commits] core.git: connectivity/source
Caolán McNamara
caolanm at redhat.com
Fri Nov 18 11:49:40 UTC 2016
connectivity/source/drivers/dbase/dindexnode.cxx | 37 ++++++++++++++++++-----
connectivity/source/inc/dbase/dindexnode.hxx | 29 ++++++------------
2 files changed, 40 insertions(+), 26 deletions(-)
New commits:
commit 97e61ba58c357564d8fbffea94c8aa56636480b9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 18 11:48:06 2016 +0000
sync ONDXPagePtr impl with current SvRef impl
Change-Id: I85e62a8c634a681e2e53745e3bed52731e8740e0
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 714ea87..064660b 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) {
diff --git a/connectivity/source/inc/dbase/dindexnode.hxx b/connectivity/source/inc/dbase/dindexnode.hxx
index ff73ce7..3a0e58d 100644
--- a/connectivity/source/inc/dbase/dindexnode.hxx
+++ b/connectivity/source/inc/dbase/dindexnode.hxx
@@ -90,19 +90,20 @@ namespace connectivity
sal_uInt32 nPagePos; // Position in the index file
public:
- ONDXPagePtr() : mpPage(nullptr), nPagePos(0) {}
- ONDXPagePtr(const ONDXPagePtr& rRef);
+ ONDXPagePtr();
+ ONDXPagePtr(ONDXPagePtr&& rObj);
+ ONDXPagePtr(ONDXPagePtr const & rRef);
ONDXPagePtr(ONDXPage* pRefPage);
- inline ~ONDXPagePtr();
+ ~ONDXPagePtr();
+ void Clear();
+ ONDXPagePtr& operator=(ONDXPagePtr const & rRef);
+ bool Is() const { return mpPage != nullptr; }
+
+ ONDXPage * operator ->() const { assert(mpPage != nullptr); return mpPage; }
+ operator ONDXPage *() const { return mpPage; }
sal_uInt32 GetPagePos() const {return nPagePos;}
bool HasPage() const {return nPagePos != 0;}
-
- operator ONDXPage *() const { return mpPage; }
- ONDXPage * operator ->() const { assert(mpPage != nullptr); return mpPage; }
- bool Is() const { return mpPage != nullptr; }
- inline void Clear();
- ONDXPagePtr& operator=(const ONDXPagePtr& rRef);
};
// Index Page
@@ -202,16 +203,6 @@ namespace connectivity
#endif
};
- inline ONDXPagePtr::~ONDXPagePtr() { if (mpPage != nullptr) mpPage->ReleaseRef(); }
- inline void ONDXPagePtr::Clear()
- {
- if (mpPage != nullptr) {
- ONDXPage * pRefObj = mpPage;
- mpPage = nullptr;
- pRefObj->ReleaseRef();
- }
- }
-
SvStream& WriteONDXPagePtr(SvStream &rStream, const ONDXPagePtr&);
SvStream& operator >> (SvStream &rStream, ONDXPagePtr&);
More information about the Libreoffice-commits
mailing list