diff --git a/ChangeLog.txt b/ChangeLog.txt index 13cbc24cc3..4375b72cba 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,17 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-10-28 17:18 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rdd/wafunc.c + * minor cleanup + + * src/rtl/gtos2/gtos2.c + * src/rtl/gttrm/gttrm.c + * added protection against wrong SetMode() parameters + + * src/rtl/gtxwc/gtxwc.h + * changed minim console window size from 3 x 6 to 1 x 1 + 2013-10-25 12:10 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbfship/hbfship.hbx ! removed not longer used FieldDeci() reference diff --git a/contrib/hbfship/hbfship.hbx b/contrib/hbfship/hbfship.hbx index 8e071a0c4f..ef07413dfd 100644 --- a/contrib/hbfship/hbfship.hbx +++ b/contrib/hbfship/hbfship.hbx @@ -25,6 +25,7 @@ DYNAMIC dbSetLocate DYNAMIC dbSetLocateBlock DYNAMIC ExecName DYNAMIC ExecPIDNum +DYNAMIC FIELDDECI DYNAMIC FieldGetArr DYNAMIC FieldPutArr DYNAMIC IndexCount diff --git a/src/rdd/wafunc.c b/src/rdd/wafunc.c index c3f4d3d968..cce974cf94 100644 --- a/src/rdd/wafunc.c +++ b/src/rdd/wafunc.c @@ -1039,12 +1039,12 @@ HB_ERRCODE hb_dbTransStruct( AREAP lpaSource, AREAP lpaDest, uiSize = 0; break; } -#endif if( hb_itemGetNL( pSrcItm ) != hb_itemGetNL( pDstItm ) ) { fAll = HB_FALSE; break; } +#endif } hb_itemRelease( pSrcItm ); hb_itemRelease( pDstItm ); diff --git a/src/rtl/gtos2/gtos2.c b/src/rtl/gtos2/gtos2.c index cfffe6f717..ec90f30813 100644 --- a/src/rtl/gtos2/gtos2.c +++ b/src/rtl/gtos2/gtos2.c @@ -739,29 +739,32 @@ static HB_BOOL hb_gt_os2_Resize( PHB_GT pGT, int iRows, int iCols ) static HB_BOOL hb_gt_os2_SetMode( PHB_GT pGT, int iRows, int iCols ) { - HB_BOOL fResult; + HB_BOOL fResult = HB_FALSE; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_SetMode(%p,%d,%d)", pGT, iRows, iCols ) ); - s_vi.cb = sizeof( VIOMODEINFO ); - VioGetMode( &s_vi, 0 ); /* fill structure with current settings */ - s_vi.row = iRows; - s_vi.col = iCols; - fResult = VioSetMode( &s_vi, 0 ) == 0; /* 0 = Ok, other = Fail */ - - if( ! fResult ) + if( iRows > 0 && iCols > 0 ) { s_vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &s_vi, 0 ); /* fill structure with current settings */ - } + s_vi.row = iRows; + s_vi.col = iCols; + fResult = VioSetMode( &s_vi, 0 ) == 0; /* 0 = Ok, other = Fail */ - hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol ); - s_iCursorStyle = hb_gt_os2_GetCursorStyle(); - HB_GTSELF_RESIZE( pGT, s_vi.row, s_vi.col ); - HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); - if( s_iCursorStyle > 0 ) - HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); - hb_gt_os2_GetScreenContents( pGT ); + if( ! fResult ) + { + s_vi.cb = sizeof( VIOMODEINFO ); + VioGetMode( &s_vi, 0 ); /* fill structure with current settings */ + } + + hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol ); + s_iCursorStyle = hb_gt_os2_GetCursorStyle(); + HB_GTSELF_RESIZE( pGT, s_vi.row, s_vi.col ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); + if( s_iCursorStyle > 0 ) + HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); + hb_gt_os2_GetScreenContents( pGT ); + } return fResult; } diff --git a/src/rtl/gttrm/gttrm.c b/src/rtl/gttrm/gttrm.c index c052702413..34b5c0504a 100644 --- a/src/rtl/gttrm/gttrm.c +++ b/src/rtl/gttrm/gttrm.c @@ -3433,15 +3433,16 @@ static void hb_gt_trm_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int static HB_BOOL hb_gt_trm_SetMode( PHB_GT pGT, int iRows, int iCols ) { - PHB_GTTRM pTerm; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetMode(%p,%d,%d)", pGT, iRows, iCols ) ); - pTerm = HB_GTTRM_GET( pGT ); - if( pTerm->SetMode( pTerm, &iRows, &iCols ) ) + if( iRows > 0 && iCols > 0 ) { - HB_GTSELF_RESIZE( pGT, iRows, iCols ); - return HB_TRUE; + PHB_GTTRM pTerm = HB_GTTRM_GET( pGT ); + if( pTerm->SetMode( pTerm, &iRows, &iCols ) ) + { + HB_GTSELF_RESIZE( pGT, iRows, iCols ); + return HB_TRUE; + } } return HB_FALSE; } diff --git a/src/rtl/gtxwc/gtxwc.h b/src/rtl/gtxwc/gtxwc.h index 5242a97059..e0c74b631b 100644 --- a/src/rtl/gtxwc/gtxwc.h +++ b/src/rtl/gtxwc/gtxwc.h @@ -84,8 +84,8 @@ typedef HB_USHORT HB_GT_CELLTYPE; #define XWC_CHAR_QUEUE_SIZE 128 #define XWC_CHAR_BUFFER 1024 -#define XWC_MIN_ROWS 3 -#define XWC_MIN_COLS 6 +#define XWC_MIN_ROWS 1 +#define XWC_MIN_COLS 1 #define XWC_MAX_ROWS 256 #define XWC_MAX_COLS 256 #define XWC_DEFAULT_ROWS 25