From dab98431de2f0b3fa7d01a341b13b6bfd1450246 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 7 May 2007 00:20:30 +0000 Subject: [PATCH] 2007-05-07 02:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rdd/dbcmd.c * initialize lpaParent in DBRELINFO structure to pArea - please note that this initialization is ignored by default SETREL() RDD method * harbour/source/rdd/usrrdd/usrrdd.c ! fixed GPF when NULL lpaParent or lpaChild was used in DBRELINFO structure --- harbour/ChangeLog | 10 ++++++++++ harbour/source/rdd/dbcmd.c | 2 +- harbour/source/rdd/usrrdd/usrrdd.c | 17 +++++------------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ca30896ecd..38359176bc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,16 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-05-07 02:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rdd/dbcmd.c + * initialize lpaParent in DBRELINFO structure to pArea - please + note that this initialization is ignored by default SETREL() + RDD method + + * harbour/source/rdd/usrrdd/usrrdd.c + ! fixed GPF when NULL lpaParent or lpaChild was used in DBRELINFO + structure + 2007-05-06 11:42 UTC+0100 Antonio Linares (alinares@fivetechsoft.com) * contrib/adordd/adordd.ch * New define added diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index 8572646a59..4371850b51 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -2154,7 +2154,7 @@ HB_FUNC( DBSETRELATION ) dbRelations.isScoped = hb_parl( 4 ); dbRelations.isOptimized = FALSE; dbRelations.lpaChild = pChildArea; - dbRelations.lpaParent = NULL; + dbRelations.lpaParent = pArea; dbRelations.lpdbriNext = NULL; SELF_SETREL( pArea, &dbRelations ); diff --git a/harbour/source/rdd/usrrdd/usrrdd.c b/harbour/source/rdd/usrrdd/usrrdd.c index 4cf869dae1..267ba9fe5f 100644 --- a/harbour/source/rdd/usrrdd/usrrdd.c +++ b/harbour/source/rdd/usrrdd/usrrdd.c @@ -166,16 +166,9 @@ static ERRCODE hb_usrEvalAreaFunc( PHB_ITEM pMethods, USHORT uiMethod, AREAP pAr static AREAP hb_usrGetAreaPointer( int iArea ) { if( iArea != 0 ) - { - int iOldArea = hb_rddGetCurrentWorkAreaNumber(); - AREAP pArea; - - hb_rddSelectWorkAreaNumber( iArea ); - pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); - hb_rddSelectWorkAreaNumber( iOldArea ); - return pArea; - } - return NULL; + return ( AREAP ) hb_rddGetWorkAreaPointer( iArea ); + else + return NULL; } @@ -312,8 +305,8 @@ static PHB_ITEM hb_usrRelInfoToItem( LPDBRELINFO pRelInfo ) hb_itemCopy( hb_arrayGetItemPtr( pItem, UR_RI_CEXPR ), pRelInfo->abKey ); hb_itemPutL( hb_arrayGetItemPtr( pItem, UR_RI_SCOPED ), pRelInfo->isScoped ); hb_itemPutL( hb_arrayGetItemPtr( pItem, UR_RI_OPTIMIZED ), pRelInfo->isOptimized ); - hb_itemPutNI( hb_arrayGetItemPtr( pItem, UR_RI_PARENT ), pRelInfo->lpaParent->uiArea ); - hb_itemPutNI( hb_arrayGetItemPtr( pItem, UR_RI_CHILD ), pRelInfo->lpaChild->uiArea ); + hb_itemPutNI( hb_arrayGetItemPtr( pItem, UR_RI_PARENT ), pRelInfo->lpaParent ? pRelInfo->lpaParent->uiArea : 0 ); + hb_itemPutNI( hb_arrayGetItemPtr( pItem, UR_RI_CHILD ), pRelInfo->lpaChild ? pRelInfo->lpaChild->uiArea : 0 ); hb_itemPutPtr( hb_arrayGetItemPtr( pItem, UR_RI_NEXT ), pRelInfo->lpdbriNext ); return pItem;