2001-10-26 15:21 GMT-3 Horacio Roldan <harbour_ar@yahoo.com.ar>

* source/rdd/dbfcdx/dbfcdx1.c
     * OrderListAdd now reorder the Tag List of the opened CDX by its
       position in the CDX instead of its tag name. (for Clipper
       compatibility)
This commit is contained in:
Horacio Dario Roldan Kasimatis
2001-10-26 19:04:12 +00:00
parent 72156bd2fd
commit f94630effc
2 changed files with 47 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
2001-10-26 15:21 GMT-3 Horacio Roldan <harbour_ar@yahoo.com.ar>
* source/rdd/dbfcdx/dbfcdx1.c
* OrderListAdd now reorder the Tag List of the opened CDX by its
position in the CDX instead of its tag name. (for Clipper
compatibility)
2001-10-26 13:15 GMT-3 Horacio Roldan <harbour_ar@yahoo.com.ar>
* source/rdd/dbfcdx/dbfcdx1.c
* Re-disabled temporally SUPER call to ignore unsupported ordinfo items

View File

@@ -4079,6 +4079,8 @@ ERRCODE hb_cdxOrderListAdd( CDXAREAP pAreaCdx, LPDBORDERINFO pOrderInfo )
PHB_ITEM pError = NULL;
BOOL bRetry;
LPCDXTAG pTag, pLastTag;
LPCDXTAG TagList, pTag1, pTag2, pTagTmp;
HB_TRACE(HB_TR_DEBUG, ("cdxOrderListAdd(%p, %p)", pArea, pOrderInfo));
@@ -4154,22 +4156,58 @@ ERRCODE hb_cdxOrderListAdd( CDXAREAP pAreaCdx, LPDBORDERINFO pOrderInfo )
pIndex->pCompound->OptFlags = 0xE0;
hb_cdxIndexResetAvailPage( pIndex );
hb_cdxTagTagOpen( pIndex->pCompound, 0 );
TagList = NULL;
while( !pIndex->pCompound->TagEOF )
{
pTag = hb_cdxTagNew( pIndex,
pIndex->pCompound->CurKeyInfo->Value,
pIndex->pCompound->CurKeyInfo->Tag );
if( pIndex->TagList == NULL )
pIndex->TagList = pTag;
if( TagList == NULL )
TagList = pTag;
else
{
pLastTag = pIndex->TagList;
pLastTag = TagList;
while( pLastTag->pNext )
pLastTag = pLastTag->pNext;
pLastTag->pNext = pTag;
}
hb_cdxTagKeyRead( pIndex->pCompound, NEXT_RECORD );
}
/* Reorder the Tag list to be compatible with Clipper */
pTag1 = TagList;
while (pTag1->pNext)
{
if (pTag1->TagBlock < pTag1->pNext->TagBlock)
pTag1 = pTag1->pNext;
else
{
if ( TagList->TagBlock > pTag1->pNext->TagBlock)
{
pTagTmp = TagList;
TagList = pTag1->pNext;
pTag1->pNext = pTagTmp;
}
else
{
pTag2 = TagList;
while (pTag2->pNext && (pTag2->pNext->TagBlock < pTag1->pNext->TagBlock) )
pTag2 = pTag2->pNext;
pTagTmp = pTag2->pNext;
pTag2->pNext = pTag1->pNext;
pTag1->pNext = pTagTmp;
}
}
}
if( pIndex->TagList == NULL )
pIndex->TagList = TagList;
else
{
pLastTag = pIndex->TagList;
while( pLastTag->pNext )
pLastTag = pLastTag->pNext;
pLastTag->pNext = TagList;
}
/*missing: ordSetFocus(1) if there was no other open index in the area*/
pIndex->uiTag = 1;
SELF_GOTOP( ( AREAP ) pArea );