diff options
Diffstat (limited to 'connectivity/source/drivers/dbase/DIndexIter.cxx')
-rw-r--r-- | connectivity/source/drivers/dbase/DIndexIter.cxx | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/connectivity/source/drivers/dbase/DIndexIter.cxx b/connectivity/source/drivers/dbase/DIndexIter.cxx index 965196f7de..ed3020ba12 100644 --- a/connectivity/source/drivers/dbase/DIndexIter.cxx +++ b/connectivity/source/drivers/dbase/DIndexIter.cxx @@ -46,20 +46,20 @@ OIndexIterator::~OIndexIterator() } //------------------------------------------------------------------ -ULONG OIndexIterator::First() +sal_uIntPtr OIndexIterator::First() { - return Find(TRUE); + return Find(sal_True); } //------------------------------------------------------------------ -ULONG OIndexIterator::Next() +sal_uIntPtr OIndexIterator::Next() { - return Find(FALSE); + return Find(sal_False); } //------------------------------------------------------------------ -ULONG OIndexIterator::Find(BOOL bFirst) +sal_uIntPtr OIndexIterator::Find(sal_Bool bFirst) { - ULONG nRes = STRING_NOTFOUND; + sal_uIntPtr nRes = STRING_NOTFOUND; if (bFirst) { @@ -69,7 +69,7 @@ ULONG OIndexIterator::Find(BOOL bFirst) if (!m_pOperator) { - // Vorbereitung , auf kleinstes Element positionieren + // Preparation, position on the smallest element if (bFirst) { ONDXPage* pPage = m_aRoot; @@ -97,18 +97,17 @@ ULONG OIndexIterator::Find(BOOL bFirst) //------------------------------------------------------------------ ONDXKey* OIndexIterator::GetFirstKey(ONDXPage* pPage, const OOperand& rKey) { - // sucht den vorgegeben key - // Besonderheit: gelangt der Algorithmus ans Ende - // wird immer die aktuelle Seite und die Knotenposition vermerkt - // auf die die Bedingung <= zutrifft - // dieses findet beim Insert besondere Beachtung + // searches a given key + // Speciality: At the end of the algorithm + // the actual page and the position of the node which fulfil the + // '<='-condition are saved. this is considered for inserts. // ONDXIndex* m_pIndex = GetNDXIndex(); OOp_COMPARE aTempOp(SQLFilterOperator::GREATER); - USHORT i = 0; + sal_uInt16 i = 0; if (pPage->IsLeaf()) { - // im blatt wird die eigentliche Operation ausgefuehrt, sonst die temp. (>) + // in the leaf the actual operation is run, otherwise temp. (>) while (i < pPage->Count() && !m_pOperator->operate(&((*pPage)[i]).GetKey(),&rKey)) i++; } @@ -120,7 +119,7 @@ ONDXKey* OIndexIterator::GetFirstKey(ONDXPage* pPage, const OOperand& rKey) ONDXKey* pFoundKey = NULL; if (!pPage->IsLeaf()) { - // weiter absteigen + // descend further ONDXPagePtr aPage = (i==0) ? pPage->GetChild(m_pIndex) : ((*pPage)[i-1]).GetChild(m_pIndex, pPage); pFoundKey = aPage.Is() ? GetFirstKey(aPage, rKey) : NULL; @@ -142,14 +141,14 @@ ONDXKey* OIndexIterator::GetFirstKey(ONDXPage* pPage, const OOperand& rKey) } //------------------------------------------------------------------ -ULONG OIndexIterator::GetCompare(BOOL bFirst) +sal_uIntPtr OIndexIterator::GetCompare(sal_Bool bFirst) { ONDXKey* pKey = NULL; sal_Int32 ePredicateType = PTR_CAST(file::OOp_COMPARE,m_pOperator)->getPredicateType(); if (bFirst) { - // Vorbereitung , auf kleinstes Element positionieren + // Preparation, position on the smallest element ONDXPage* pPage = m_aRoot; switch (ePredicateType) { @@ -212,7 +211,7 @@ ULONG OIndexIterator::GetCompare(BOOL bFirst) } //------------------------------------------------------------------ -ULONG OIndexIterator::GetLike(BOOL bFirst) +sal_uIntPtr OIndexIterator::GetLike(sal_Bool bFirst) { if (bFirst) { @@ -232,7 +231,7 @@ ULONG OIndexIterator::GetLike(BOOL bFirst) } //------------------------------------------------------------------ -ULONG OIndexIterator::GetNull(BOOL bFirst) +sal_uIntPtr OIndexIterator::GetNull(sal_Bool bFirst) { if (bFirst) { @@ -254,15 +253,15 @@ ULONG OIndexIterator::GetNull(BOOL bFirst) } //------------------------------------------------------------------ -ULONG OIndexIterator::GetNotNull(BOOL bFirst) +sal_uIntPtr OIndexIterator::GetNotNull(sal_Bool bFirst) { ONDXKey* pKey; if (bFirst) { // erst alle NULL werte abklappern - for (ULONG nRec = GetNull(bFirst); + for (sal_uIntPtr nRec = GetNull(bFirst); nRec != STRING_NOTFOUND; - nRec = GetNull(FALSE)) + nRec = GetNull(sal_False)) ; pKey = m_aCurLeaf.Is() ? &(*m_aCurLeaf)[m_nCurNode].GetKey() : NULL; } @@ -278,15 +277,15 @@ ONDXKey* OIndexIterator::GetNextKey() if (m_aCurLeaf.Is() && ((++m_nCurNode) >= m_aCurLeaf->Count())) { ONDXPage* pPage = m_aCurLeaf; - // naechste Seite suchen + // search next page while (pPage) { ONDXPage* pParentPage = pPage->GetParent(); if (pParentPage) { - USHORT nPos = pParentPage->Search(pPage); + sal_uInt16 nPos = pParentPage->Search(pPage); if (nPos != pParentPage->Count() - 1) - { // Seite gefunden + { // page found pPage = (*pParentPage)[nPos+1].GetChild(m_pIndex,pParentPage); break; } @@ -294,7 +293,7 @@ ONDXKey* OIndexIterator::GetNextKey() pPage = pParentPage; } - // jetzt wieder zum Blatt + // now go on with leaf while (pPage && !pPage->IsLeaf()) pPage = pPage->GetChild(m_pIndex); |