From a99269cbb4528d2bb810feb216ab4fe1203d8769 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Sep 2001 12:44:36 +0000 Subject: [PATCH] 2001-09-27 14:33 UTC+0100 Viktor Szakats --- harbour/ChangeLog | 12 ++++++++++++ harbour/source/rtl/dbedit.prg | 2 +- harbour/source/rtl/memofile.c | 8 ++++---- harbour/source/rtl/tbrowse.prg | 20 ++++++++++---------- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b33b5cec99..733d79e95a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,15 @@ +2001-09-27 14:33 UTC+0100 Viktor Szakats + + * source/rtl/memofile.c + ! MEMOWRIT() - Restored CA-Cl*pper compatibility. + + * source/rtl/dbedit.prg + ! DBEDIT() - Restored CA-Cl*pper compatibility. + + * source/rtl/tbrowse.prg + ! Fixed AutoLite/Hilite/DeHilite() support. Now DBEDIT() works + as expected. + 2001-09-27 01:52 GMT-3 Horacio Roldan * source/rtl/memofile.c * Fixed: MemoWrit added an EOF (0x1A) everytime diff --git a/harbour/source/rtl/dbedit.prg b/harbour/source/rtl/dbedit.prg index 750ea55426..d8573d8720 100644 --- a/harbour/source/rtl/dbedit.prg +++ b/harbour/source/rtl/dbedit.prg @@ -126,7 +126,7 @@ FUNCTION dbEdit(; oBrowse:HeadSep := iif( ISCHARACTER( xHeadingSeparators ), xHeadingSeparators, Chr( 205 ) + Chr( 209 ) + Chr( 205 ) ) oBrowse:ColSep := iif( ISCHARACTER( xColumnSeparators ), xColumnSeparators, " " + Chr( 179 ) + " " ) oBrowse:FootSep := iif( ISCHARACTER( xFootingSeparators ), xFootingSeparators, "" ) - oBrowse:AutoLite := .t. //don't know why it was .F. (if it break something...) + oBrowse:AutoLite := .F. /* Set to .F. just like in CA-Cl*pper. [vszakats] */ // Calculate the number of columns diff --git a/harbour/source/rtl/memofile.c b/harbour/source/rtl/memofile.c index 3bc21239ec..b724b8c93d 100644 --- a/harbour/source/rtl/memofile.c +++ b/harbour/source/rtl/memofile.c @@ -69,6 +69,7 @@ HB_FUNC( MEMOREAD ) if( fhnd != FS_ERROR ) { ULONG ulSize = hb_fsSeek( fhnd, 0, FS_END ); + if( ulSize != 0 ) { BYTE * pbyBuffer; @@ -79,8 +80,7 @@ HB_FUNC( MEMOREAD ) { BYTE byEOF = HB_CHAR_NUL; - hb_fsSeek( fhnd, ulSize-1, FS_SET ); - + hb_fsSeek( fhnd, -1, FS_END ); hb_fsRead( fhnd, &byEOF, sizeof( BYTE ) ); if( byEOF == HB_CHAR_EOF ) @@ -128,8 +128,8 @@ HB_FUNC( MEMOWRIT ) #if ! defined(OS_UNIX_COMPATIBLE) { BYTE byEOF = HB_CHAR_EOF; - if ( (ulSize == 0) || ( (( BYTE * ) hb_itemGetCPtr( pString ))[ulSize-1] != HB_CHAR_EOF) ) - hb_fsWrite( fhnd, &byEOF, sizeof( BYTE ) ); + + hb_fsWrite( fhnd, &byEOF, sizeof( BYTE ) ); } #endif diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index e57c2e9a8b..08581cc65c 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -638,13 +638,7 @@ METHOD Hilite() CLASS TBrowse // Start of cell SetPos( nRow, ::aColumns[ ::ColPos ]:ColPos ) - if ::AutoLite - cType := ::DispCell(::ColPos, CLR_ENHANCED) - - else - cType := ::DispCell(::ColPos, CLR_STANDARD) - - endif + cType := ::DispCell(::ColPos, CLR_ENHANCED) // Put cursor back on first char of cell value SetPos(nRow, ::aColumns[ ::ColPos ]:ColPos + iif(cType == "L", ::aColumns[::ColPos]:Width / 2, 0 )) @@ -1037,7 +1031,9 @@ METHOD Stabilize() CLASS TBrowse ::HitTop := ::lHitTop ::HitBottom := ::lHitBottom - ::Hilite() + if ::AutoLite + ::Hilite() + endif SetCursor(nOldCursor) ::stable := .T. @@ -1046,7 +1042,9 @@ METHOD Stabilize() CLASS TBrowse else /* NOTE: DBU relies upon current cell being reHilited() even if already stable */ - ::Hilite() + if ::AutoLite + ::Hilite() + endif SetCursor(nOldCursor) return .T. @@ -1064,7 +1062,9 @@ METHOD Moved() CLASS TBrowse ::lHitTop := .F. ::lHitBottom := .F. - ::DeHilite() + if ::AutoLite + ::DeHilite() + endif ::stable := .F. endif