diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 10a4bda15f..fcb9615a82 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,33 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-02-21 07:39 UTC+0100 Viktor Szakats + + * source/rtl/memoread.c + * Previous change reverted. hb_retc( NULL ) was intentional + and is an optimized version of hb_retc( "" ). Both will return + an empty string. + % hb_fsClose() calls reduced. + + * src/rtl/tbcolumn.prg + * src/rtl/tbrowse.prg + ! :SetColumn() retval made compatible. + ! :ColWidth() retval made compatible. + % Using array functions to speed up a few things. + % Got rid of the predefined 4096 long array in every + columns plus the browse object. + ; More and more incompatibilities are popping up, some + of them quite strange, and only coming up in a large + app's sophisticated browse stressing environment. + - Removing rightmost column while active will do RTE, + - If headsep is initialized after the columns and cargo, + browse will sometimes behave strangely (headsep value + disappears??) + - Moving columns off the visible area will screw up + internals. + - Modifying columns is slow because of the unconditional + :configure() calls. + 2004-02-20 8:55 UTC-0800 Luis Krause Mantilla * contrib/mysql/mysql.c ! Fixed declaration for filelength() from int to long to match io.h diff --git a/harbour/source/rtl/memofile.c b/harbour/source/rtl/memofile.c index 6e0bfb4b67..33a8843d1e 100644 --- a/harbour/source/rtl/memofile.c +++ b/harbour/source/rtl/memofile.c @@ -93,21 +93,18 @@ HB_FUNC( MEMOREAD ) hb_fsSeek( fhnd, 0, FS_SET ); hb_fsReadLarge( fhnd, pbyBuffer, ulSize ); - hb_fsClose( fhnd ); - hb_retclen_buffer( ( char * ) pbyBuffer, ulSize ); } else - { - hb_fsClose( fhnd ); - hb_retc( "" ); - } + hb_retc( NULL ); + + hb_fsClose( fhnd ); } else - hb_retc( "" ); + hb_retc( NULL ); } else - hb_retc( "" ); + hb_retc( NULL ); } HB_FUNC( MEMOWRIT ) diff --git a/harbour/source/rtl/tbcolumn.prg b/harbour/source/rtl/tbcolumn.prg index 77dce13135..5ef9764a29 100644 --- a/harbour/source/rtl/tbcolumn.prg +++ b/harbour/source/rtl/tbcolumn.prg @@ -84,7 +84,7 @@ CLASS TBColumn HIDDEN: /* H I D D E N */ DATA nWidth - METHOD SetWidth(n) + METHOD SetWidth( n ) #ifdef HB_COMPAT_C53 DATA aSetStyle @@ -111,13 +111,15 @@ METHOD New( cHeading, bBlock ) CLASS TBColumn ::Footing := "" ::block := bBlock -#ifdef HB_COMPAT_C53 - ::aSetStyle := ARRAY( 4096 ) + #ifdef HB_COMPAT_C53 - ::aSetStyle[ TBC_READWRITE ] := .f. - ::aSetStyle[ TBC_MOVE ] := .f. - ::aSetStyle[ TBC_SIZE ] := .f. -#endif + ::aSetStyle := Array( TBC_CUSTOM - 1 ) + + ::aSetStyle[ TBC_READWRITE ] := .f. + ::aSetStyle[ TBC_MOVE ] := .f. + ::aSetStyle[ TBC_SIZE ] := .f. + + #endif return Self @@ -134,11 +136,13 @@ return n #ifdef HB_COMPAT_C53 + METHOD SetStyle( nMode, lSetting ) CLASS TBColumn LOCAL lRet := .F. IF nMode > LEN( ::aSetStyle ) - RETURN .F. + ASize( ::aSetStyle, nMode ) + ::aSetStyle[ nMode ] := .F. ENDIF lRet := ::aSetStyle[ nMode ] @@ -148,6 +152,7 @@ METHOD SetStyle( nMode, lSetting ) CLASS TBColumn ENDIF RETURN lRet + #endif diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index 1405e9aebb..71a2acefb6 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -268,12 +268,12 @@ METHOD New(nTop, nLeft, nBottom, nRight) CLASS TBrowse ::mColPos := 0 ::mRowPos := 0 - ::rect :={nTop,nLeft,nBottom,nRight} - ::aVisibleCols :={} - ::message :='' + ::rect := {nTop,nLeft,nBottom,nRight} + ::aVisibleCols := {} + ::message := '' ::nRow := 0 ::nCol := 0 - ::aSetStyle := ARRAY( 4096 ) + ::aSetStyle := Array( TBR_CUSTOM - 1 ) ::aSetStyle[ TBR_APPEND ] := .f. ::aSetStyle[ TBR_APPENDING ] := .f. @@ -363,12 +363,12 @@ METHOD Configure(nMode) CLASS TBrowse // 20/nov/2000 - maurilio.longo@libero.it // If I add (or remove) header or footer (separator) I have to change number // of available rows - ::RowCount := ::nBottom - ::nTop + 1 - iif( ::lHeaders, ::nHeaderHeight, 0 ) - ; - iif( ::lFooters, ::nFooterHeight, 0 ) - iif( Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1 ) - ; - iif( Empty( ::FootSep ) .OR. !::lFooters, 0, 1 ) + ::RowCount := ::nBottom - ::nTop + 1 - ; + iif( ::lHeaders, ::nHeaderHeight + iif( Empty( ::HeadSep ), 0, 1 ), 0 ) - ; + iif( ::lFooters, ::nFooterHeight + iif( Empty( ::FootSep ), 0, 1 ), 0 ) if Len(::aRedraw) <> ::RowCount - ::aRedraw := Array(::RowCount) + ASize(::aRedraw, ::RowCount) endif ::Invalidate() @@ -427,33 +427,29 @@ return iif( 0 < nColumn .AND. nColumn <= ::nColumns, ::aColumns[ nColumn ], NIL // Replaces one TBColumn object with another METHOD SetColumn( nColumn, oCol ) - LOCAL oOldCol - - if 0 < nColumn .AND. nColumn <= ::nColumns - oOldCol := ::aColumns[ nColumn ] + if 0 < nColumn .AND. nColumn <= ::nColumns ::aColumns[ nColumn ] := oCol - ::aColsWidth[nColumn] := ::SetColumnWidth(oCol) + ::aColsWidth[ nColumn ] := ::SetColumnWidth( oCol ) ::Configure( 2 ) endif -return oOldCol +return oCol // Returns the display width of a particular column METHOD ColWidth( nColumn ) -return iif( 0 < nColumn .AND. nColumn <= ::nColumns, ::aColsWidth[ nColumn ], NIL ) +return iif( 0 < nColumn .AND. nColumn <= ::nColumns, ::aColsWidth[ nColumn ], 0 ) METHOD DelColumn( nPos ) CLASS TBrowse local oCol := ::aColumns[ nPos ] - local n ADel( ::aColumns, nPos ) - ADel( ::aColsWidth, nPos) - ASize( ::aColumns, --::nColumns) - ASize( ::aColsWidth, ::nColumns) + ASize( ::aColumns, --::nColumns ) + ADel( ::aColsWidth, nPos ) + ASize( ::aColsWidth, ::nColumns ) ::Configure( 2 ) @@ -1129,15 +1125,9 @@ METHOD Stabilize() CLASS TBrowse // I've scrolled on screen rows, now I need to scroll ::aRedraw array as well! if nRecsSkipped > 0 - /*for nRow := 2 to Len(::aRedraw) - ::aRedraw[nRow - 1] := ::aRedraw[nRow] - next*/ - ACopy(::aRedraw, ::aRedraw, 2,, 1) + ADel(::aRedraw, 1) else - // Cannot use ACopy() here - for nRow := ::RowCount - 1 to 1 step -1 - ::aRedraw[nRow + 1] := ::aRedraw[nRow] - next + AIns(::aRedraw, 1) endif ::aRedraw[::nNewRowPos] := .T. @@ -1607,7 +1597,8 @@ METHOD SetStyle( nMode, lSetting ) CLASS TBROWSE LOCAL lRet := .F. IF nMode > LEN( ::aSetStyle ) - RETURN .F. + ASize( ::aSetStyle, nMode ) + ::aSetStyle[ nMode ] := .F. ENDIF lRet := ::aSetStyle[ nMode ]