From 30a9218f0ae0c3a176680ea7e3757dacfe504e7e Mon Sep 17 00:00:00 2001 From: Horacio Dario Roldan Kasimatis Date: Tue, 5 Mar 2002 02:54:37 +0000 Subject: [PATCH] =?UTF-8?q?2002-03-04=2011:48=20UTC-0300=20Horacio=20Rolda?= =?UTF-8?q?n=20=20=20=20=20*=20source/rdd/dbfcd?= =?UTF-8?q?x/dbfcdx1.c=20=20=20=20=20=20!=20fixed=20bug=20seek=20and=20set?= =?UTF-8?q?=20deleted=20on,=20reported=20by=20Lorenzo=20Fiorini=20=20=20?= =?UTF-8?q?=20=20=20=20=20also=20fix=20bug=20with=20set=20filter=20=20=20?= =?UTF-8?q?=20=20=20!=20fixed=20bug=20with=20ordkeyno()=20and=20ordkeycoun?= =?UTF-8?q?t(),=20=20=20=20=20=20=20=20reported=20by=20Manuel=20Mercado=20?= =?UTF-8?q?G=C3=B3mez?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- harbour/source/rdd/dbfcdx/dbfcdx1.c | 41 +++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index ff64d51cb6..c869e765f3 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -4686,7 +4686,7 @@ ERRCODE hb_cdxSeek( CDXAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFindLas lRecno = hb_cdxTagKeyFind( pTag, pKey2 ); pArea->fEof = pTag->TagEOF; pArea->fBof = pTag->TagBOF; - hb_cdxKeyFree( pKey2 ); + /* hb_cdxKeyFree( pKey2 ); */ if( lRecno > 0 ) { @@ -4715,15 +4715,46 @@ ERRCODE hb_cdxSeek( CDXAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFindLas { retvalue = SELF_GOTO( ( AREAP ) pArea, pTag->CurKeyInfo->Tag ); pArea->fFound = TRUE; + if( retvalue != FAILURE ) + if ( hb_set.HB_SET_DELETED || pArea->dbfi.itmCobExpr != NULL ) + { + USHORT endPos; + int k; + retvalue = SELF_SKIPFILTER( ( AREAP ) pArea, 1 ); + k = hb_cdxKeyCompare( pKey2, pTag->CurKeyInfo, &endPos, FALSE ); + if ( k == 0) + { + pArea->fFound = TRUE; + } + else + { + pArea->fFound = FALSE; + if( !bSoftSeek ) + { + //retvalue = SELF_GOTO( ( AREAP ) pArea, 0 ); + SELF_GOBOTTOM( ( AREAP ) pArea ); + retvalue = SELF_SKIP( ( AREAP ) pArea, 1 ); + } + } + } + hb_cdxKeyFree( pKey2 ); return retvalue; } else { + hb_cdxKeyFree( pKey2 ); pArea->fFound = FALSE; if( bSoftSeek && !pTag->TagEOF ) { - return SELF_GOTO( ( AREAP ) pArea, pTag->CurKeyInfo->Tag ); + //return SELF_GOTO( ( AREAP ) pArea, pTag->CurKeyInfo->Tag ); + retvalue = SELF_GOTO( ( AREAP ) pArea, pTag->CurKeyInfo->Tag ); + if( retvalue != FAILURE ) + if ( hb_set.HB_SET_DELETED || pArea->dbfi.itmCobExpr != NULL ) + { + retvalue = SELF_SKIPFILTER( ( AREAP ) pArea, 1 ); + } + return retvalue; } else { @@ -5072,7 +5103,7 @@ static long hb_cdxDBOIKeyCount( CDXAREAP pArea ) hb_cdxPageFree( pPage2 ); } hb_cdxTagKeyFind( pTag, pCurKey ); - hb_cdxTagTagClose( pTag ); + /* hb_cdxTagTagClose( pTag ); */ hb_cdxKeyFree( pCurKey ); return lKeyCount; } @@ -5142,8 +5173,8 @@ static long hb_cdxDBOIKeyNo( CDXAREAP pArea ) } } hb_cdxTagKeyFind( pTag, pCurKey ); - hb_cdxTagTagClose( pTag ); + /*hb_cdxTagTagClose( pTag ); */ hb_cdxKeyFree( pCurKey ); } return lKeyNo; -} +} \ No newline at end of file