From 2b6f6caa62dffdb3cce8fd0db48027f531ffddc7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sat, 8 Apr 2006 00:51:27 +0000 Subject: [PATCH] 2006-04-07 15:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh * support for detecting startup function in C++ mode * harbour/include/hbapi.h * some few #defines to translate some xHarbour functions names to Harbour * harbour/include/hbxvm.h * harbour/source/compiler/gencc.c * harbour/source/vm/hvm.c * harbour/source/vm/itemapi.c * harbour/source/common/hbdate.c + added optimizations for add and div by integer value * changed code generated for double values to avoid limitation in some C compilers like MSC and possible differ conversion inside C RTL then the one which uses Harbour RTL * some minor optimizations, cleanups and code formating * harbour/source/compiler/hbfix.c * optimize usage of HB_P_NOT PCODE - remove repeated NOT operations or revert conditional jumps if they are just after NOT. * harbour/source/rdd/dbf1.c * added support for NULL value set in memo fields by ACCESS * harbour/source/rdd/dbfcdx/dbfcdx1.c * fixed ordKeyPos() - for records out of scope * harbour/source/rtl/padc.c * harbour/source/rtl/padl.c * harbour/source/rtl/padr.c * harbour/source/rtl/substr.c * some minor optimizations to avoid new string item creation when it's not necessary * harbour/source/vm/classes.c * harbour/source/vm/extend.c * minor code formatting and optimizations --- harbour/ChangeLog | 8 ++++++++ harbour/source/rdd/dbfcdx/dbfcdx1.c | 7 ++++++- harbour/source/rdd/dbfntx/dbfntx1.c | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a897bf4ea8..38693cc55d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ + dos not exist in index + * xharbour/source/rdd/dbfcdx/dbfcdx1.c + * harbour/source/vm/classes.c + * use hb_itemClone() - it will save us modifications in the + * xharbour/source/rdd/dbfntx/dbfntx1.c + parameters like arrays (f.e. hashes) + * some source code formatting + 2006-04-09 14:55 UTC+0300 Alexander Kresin * contrib/rdd_ads/ads1.c * Added possibility to save memo fields > 64K diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index 2ceb71c3aa..8e41e675ba 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -7567,6 +7567,7 @@ static ERRCODE hb_cdxOrderDestroy( CDXAREAP pArea, LPDBORDERINFO pOrderInfo ) { LPCDXINDEX pIndex, pIndexTmp; LPCDXTAG pTag; + USHORT uiTag; HB_TRACE(HB_TR_DEBUG, ("hb_cdxOrderDestroy(%p, %p)", pArea, pOrderInfo)); @@ -7578,7 +7579,7 @@ static ERRCODE hb_cdxOrderDestroy( CDXAREAP pArea, LPDBORDERINFO pOrderInfo ) if ( pOrderInfo->itmOrder ) { - pTag = hb_cdxFindTag( pArea, pOrderInfo->itmOrder, pOrderInfo->atomBagName, NULL ); + pTag = hb_cdxFindTag( pArea, pOrderInfo->itmOrder, pOrderInfo->atomBagName, &uiTag ); if ( pTag ) { pIndex = pTag->pIndex; @@ -7619,6 +7620,10 @@ static ERRCODE hb_cdxOrderDestroy( CDXAREAP pArea, LPDBORDERINFO pOrderInfo ) pIndex->fDelete = TRUE; hb_cdxIndexFree( pIndex ); } + if( uiTag < pArea->uiTag ) + pArea->uiTag--; + else if( uiTag == pArea->uiTag ) + pArea->uiTag = 0; } else { diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index 2a08b5b2ca..05bf102393 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -3809,14 +3809,30 @@ static ULONG hb_ntxOrdKeyNo( LPTAGINFO pTag ) */ static BOOL hb_ntxOrdKeyGoto( LPTAGINFO pTag, ULONG ulKeyNo ) { + NTXAREAP pArea = pTag->Owner->Owner; + if( ! ulKeyNo || ! hb_ntxTagLockRead( pTag ) ) return FALSE; + hb_ntxTagRefreshScope( pTag ); hb_ntxTagGoTop( pTag ); while( !pTag->TagEOF && --ulKeyNo ) { hb_ntxTagSkipNext( pTag ); } + + if( pTag->TagEOF ) + { + SELF_GOTO( ( AREAP ) pArea, 0 ); + } + else + { + LPTAGINFO pSavedTag = pArea->lpCurTag; + pArea->lpCurTag = pTag; + SELF_GOTO( ( AREAP ) pArea, pTag->CurKeyInfo->Xtra ); + SELF_SKIPFILTER( ( AREAP ) pArea, 1 ); + pArea->lpCurTag = pSavedTag; + } hb_ntxTagUnLockRead( pTag ); return TRUE; }