diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:24:29 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:24:29 +0200 |
commit | 92667c8edbaee9a252b1d5d221eb62849f76697c (patch) | |
tree | 8f1d329f2259b7d5bff054bc14d0965637df6961 /connectivity/source/drivers/dbase/DIndexIter.cxx | |
parent | baecdfb578cb7bc992944857ad4d8882ef7e842c (diff) | |
parent | 48b4a99ce2451f1ddf2e8e128bbfcd6683072999 (diff) |
Merge branch 'master' into feature/gnumake4
Conflicts:
connectivity/source/cpool/Zregistration.cxx
connectivity/source/drivers/evoab/LCatalog.cxx
connectivity/source/drivers/evoab/LColumnAlias.cxx
connectivity/source/drivers/evoab/LColumnAlias.hxx
connectivity/source/drivers/evoab/LColumns.cxx
connectivity/source/drivers/evoab/LColumns.hxx
connectivity/source/drivers/evoab/LConfigAccess.cxx
connectivity/source/drivers/evoab/LConfigAccess.hxx
connectivity/source/drivers/evoab/LConnection.cxx
connectivity/source/drivers/evoab/LConnection.hxx
connectivity/source/drivers/evoab/LDatabaseMetaData.cxx
connectivity/source/drivers/evoab/LDatabaseMetaData.hxx
connectivity/source/drivers/evoab/LDriver.cxx
connectivity/source/drivers/evoab/LDriver.hxx
connectivity/source/drivers/evoab/LFolderList.cxx
connectivity/source/drivers/evoab/LFolderList.hxx
connectivity/source/drivers/evoab/LNoException.cxx
connectivity/source/drivers/evoab/LPreparedStatement.cxx
connectivity/source/drivers/evoab/LPreparedStatement.hxx
connectivity/source/drivers/evoab/LResultSet.cxx
connectivity/source/drivers/evoab/LResultSet.hxx
connectivity/source/drivers/evoab/LServices.cxx
connectivity/source/drivers/evoab/LStatement.cxx
connectivity/source/drivers/evoab/LStatement.hxx
connectivity/source/drivers/evoab/LTable.cxx
connectivity/source/drivers/evoab/LTable.hxx
connectivity/source/drivers/evoab/LTables.cxx
connectivity/source/drivers/evoab/LTables.hxx
connectivity/source/drivers/evoab/evoab.xml
connectivity/source/drivers/evoab/makefile.mk
editeng/Library_editeng.mk
framework/Library_fwe.mk
framework/test/test.cxx
idl/prj/d.lst
idl/util/idlpch.cxx
linguistic/Makefile
linguistic/Module_linguistic.mk
linguistic/inc/linguistic/lngdllapi.h
linguistic/inc/linguistic/lngprophelp.hxx
linguistic/inc/linguistic/misc.hxx
linguistic/prj/build.lst
linguistic/prj/d.lst
linguistic/qa/unoapi/Test.java
linguistic/source/grammarchecker.cxx
linguistic/source/grammarchecker.hxx
linguistic/source/hyphdta.cxx
linguistic/source/lngprophelp.cxx
linguistic/source/makefile.mk
linguistic/source/spelldta.cxx
sfx2/Library_qstart.mk
sfx2/Library_sfx.mk
sfx2/inc/sfx2/qswin32.h
sfx2/prj/build.lst
sfx2/qa/cppunit/makefile.mk
xmlscript/inc/xmlscript/xcrdllapi.h
xmlscript/prj/d.lst
xmlscript/util/makefile.mk
Diffstat (limited to 'connectivity/source/drivers/dbase/DIndexIter.cxx')
-rw-r--r-- | connectivity/source/drivers/dbase/DIndexIter.cxx | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/connectivity/source/drivers/dbase/DIndexIter.cxx b/connectivity/source/drivers/dbase/DIndexIter.cxx index b35caa0a3da1..22bcd43da980 100644 --- a/connectivity/source/drivers/dbase/DIndexIter.cxx +++ b/connectivity/source/drivers/dbase/DIndexIter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,7 +42,6 @@ using namespace ::com::sun::star::sdb; //------------------------------------------------------------------ OIndexIterator::~OIndexIterator() { - // m_pIndex->UnLock(); m_pIndex->release(); } @@ -59,11 +59,7 @@ sal_uIntPtr OIndexIterator::Next() //------------------------------------------------------------------ sal_uIntPtr OIndexIterator::Find(sal_Bool bFirst) { - // ONDXIndex* m_pIndex = GetNDXIndex(); - sal_uIntPtr nRes = STRING_NOTFOUND; -// if (!m_pIndex->IsOpen()) -// return nRes; if (bFirst) { @@ -73,7 +69,7 @@ sal_uIntPtr OIndexIterator::Find(sal_Bool bFirst) if (!m_pOperator) { - // Vorbereitung , auf kleinstes Element positionieren + // Preparation, position on the smallest element if (bFirst) { ONDXPage* pPage = m_aRoot; @@ -101,18 +97,17 @@ sal_uIntPtr OIndexIterator::Find(sal_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); 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++; } @@ -124,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; @@ -149,12 +144,11 @@ ONDXKey* OIndexIterator::GetFirstKey(ONDXPage* pPage, const OOperand& rKey) sal_uIntPtr OIndexIterator::GetCompare(sal_Bool bFirst) { ONDXKey* pKey = NULL; - // ONDXIndex* m_pIndex = GetNDXIndex(); 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) { @@ -219,7 +213,6 @@ sal_uIntPtr OIndexIterator::GetCompare(sal_Bool bFirst) //------------------------------------------------------------------ sal_uIntPtr OIndexIterator::GetLike(sal_Bool bFirst) { - // ONDXIndex* m_pIndex = GetNDXIndex(); if (bFirst) { ONDXPage* pPage = m_aRoot; @@ -240,7 +233,6 @@ sal_uIntPtr OIndexIterator::GetLike(sal_Bool bFirst) //------------------------------------------------------------------ sal_uIntPtr OIndexIterator::GetNull(sal_Bool bFirst) { - // ONDXIndex* m_pIndex = GetNDXIndex(); if (bFirst) { ONDXPage* pPage = m_aRoot; @@ -264,7 +256,6 @@ sal_uIntPtr OIndexIterator::GetNull(sal_Bool bFirst) sal_uIntPtr OIndexIterator::GetNotNull(sal_Bool bFirst) { ONDXKey* pKey; - // ONDXIndex* m_pIndex = GetNDXIndex(); if (bFirst) { // erst alle NULL werte abklappern @@ -283,11 +274,10 @@ sal_uIntPtr OIndexIterator::GetNotNull(sal_Bool bFirst) //------------------------------------------------------------------ ONDXKey* OIndexIterator::GetNextKey() { - // ONDXIndex* m_pIndex = GetNDXIndex(); 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(); @@ -295,7 +285,7 @@ ONDXKey* OIndexIterator::GetNextKey() { sal_uInt16 nPos = pParentPage->Search(pPage); if (nPos != pParentPage->Count() - 1) - { // Seite gefunden + { // page found pPage = (*pParentPage)[nPos+1].GetChild(m_pIndex,pParentPage); break; } @@ -303,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); @@ -313,3 +303,4 @@ ONDXKey* OIndexIterator::GetNextKey() return m_aCurLeaf.Is() ? &(*m_aCurLeaf)[m_nCurNode].GetKey() : NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |