diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7a454f1b7d..42feee6cc0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +2001-11-06 19:28 GMT-3 Horacio Roldan + * source/rdd/dbfcdx/dbfcdx2.h + * source/rdd/dbfcdx/dbfcdx1.c + ! fixed bug in OrdListAdd from previous change (now should work!) + + added hb_cdxGetTagByNumber helper function + 2001-11-06 09:50 GMT Dave Pearson * tests/Makefile * testprof.prg was missing. Added. diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index fec7f6003a..4fe11ba331 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -2505,6 +2505,24 @@ static LPCDXTAG hb_cdxGetActiveTag( LPCDXINDEX PIF ) return pTag; } +static LPCDXTAG hb_cdxGetTagByNumber(CDXAREAP pArea, USHORT uiTag ) +{ + LPCDXTAG pTag; + + if ( ! uiTag ) + return NULL; + + pTag = pArea->lpIndexes->TagList; + --uiTag; + while( uiTag && pTag ) + { + pTag = pTag->pNext; + --uiTag; + } + + return pTag; +} + /* end hb_cdxTagxxx */ @@ -4068,6 +4086,7 @@ ERRCODE hb_cdxOrderCreate( CDXAREAP pAreaCdx, LPDBORDERCREATEINFO pOrderInfo ) return SELF_GOTOP( ( AREAP ) pArea ); } + ERRCODE hb_cdxOrderListAdd( CDXAREAP pAreaCdx, LPDBORDERINFO pOrderInfo ) { USHORT uiFlags; @@ -4185,7 +4204,8 @@ ERRCODE hb_cdxOrderListAdd( CDXAREAP pAreaCdx, LPDBORDERINFO pOrderInfo ) { pTagTmp = TagList; TagList = pTag1->pNext; - pTag1->pNext = pTagTmp; + pTag1->pNext = pTag1->pNext->pNext; + TagList->pNext = pTagTmp; } else { @@ -4194,7 +4214,8 @@ ERRCODE hb_cdxOrderListAdd( CDXAREAP pAreaCdx, LPDBORDERINFO pOrderInfo ) pTag2 = pTag2->pNext; pTagTmp = pTag2->pNext; pTag2->pNext = pTag1->pNext; - pTag1->pNext = pTagTmp; + pTag1->pNext = pTag1->pNext->pNext; + pTag2->pNext->pNext = pTagTmp; } } } diff --git a/harbour/source/rdd/dbfcdx/dbfcdx2.h b/harbour/source/rdd/dbfcdx/dbfcdx2.h index e83210bfb1..4753e60995 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx2.h +++ b/harbour/source/rdd/dbfcdx/dbfcdx2.h @@ -135,3 +135,4 @@ static void hb_cdxSortAddInternal( LPSORTINFO pSort, USHORT Lvl, LONG Tag, LONG LPKEYINFO Value ); static LPCDXTAG hb_cdxGetActiveTag( LPCDXINDEX PIF ); static USHORT hb_cdxFindTag( CDXAREAP pArea, LPDBORDERINFO pOrderInfo ); +static LPCDXTAG hb_cdxGetTagByNumber(CDXAREAP pArea, USHORT uiTag );