2012-11-14 04:49 UTC+0100 Viktor Szakats (harbour syenar.net)

* src/rtl/achoice.prg
  * src/rtl/alert.prg
  * src/rtl/hbfilehi.prg
  * src/rtl/hbi18n2.prg
  * src/rtl/hbini.prg
  * src/rtl/listbox.prg
  * src/rtl/memoedit.prg
  * src/rtl/memvarhb.prg
  * src/rtl/menuto.prg
  * src/rtl/objfunc.prg
  * src/rtl/profiler.prg
  * src/rtl/radiobtn.prg
  * src/rtl/tbrowse.prg
  * src/rtl/teditor.prg
  * src/rtl/tgetlist.prg
  * src/rtl/tmenuitm.prg
  * src/rtl/tobject.prg
  * src/rtl/typefile.prg
    * use HB_DEFAULT() instead of 'IF ! HB_IS*()'

  * include/harbour.hbx
    ! fixed one casing being wrong

  * contrib/hbmisc/stringp.prg
  * contrib/xhb/ttable.prg
  * contrib/xhb/xcstr.prg
  * tests/debugtst.prg
    ! fixed above casing where it got wrongly formatted
This commit is contained in:
Viktor Szakats
2012-11-14 03:52:53 +00:00
parent 60f5dfecfb
commit fb3e0e9490
24 changed files with 105 additions and 157 deletions

View File

@@ -16,6 +16,36 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-11-14 04:49 UTC+0100 Viktor Szakats (harbour syenar.net)
* src/rtl/achoice.prg
* src/rtl/alert.prg
* src/rtl/hbfilehi.prg
* src/rtl/hbi18n2.prg
* src/rtl/hbini.prg
* src/rtl/listbox.prg
* src/rtl/memoedit.prg
* src/rtl/memvarhb.prg
* src/rtl/menuto.prg
* src/rtl/objfunc.prg
* src/rtl/profiler.prg
* src/rtl/radiobtn.prg
* src/rtl/tbrowse.prg
* src/rtl/teditor.prg
* src/rtl/tgetlist.prg
* src/rtl/tmenuitm.prg
* src/rtl/tobject.prg
* src/rtl/typefile.prg
* use HB_DEFAULT() instead of 'IF ! HB_IS*()'
* include/harbour.hbx
! fixed one casing being wrong
* contrib/hbmisc/stringp.prg
* contrib/xhb/ttable.prg
* contrib/xhb/xcstr.prg
* tests/debugtst.prg
! fixed above casing where it got wrongly formatted
2012-11-14 03:11 UTC+0100 Viktor Szakats (harbour syenar.net)
* src/rtl/hbdef.c
! HB_DEFAULT(): consider date and timestamp types

View File

@@ -143,7 +143,7 @@ FUNCTION ToChar( xTxt, cSeparator, lDebug )
CASE cValTxt == "O" // Object
IF lDebug
cOut := xTxt:ClassName() + "(#" + ToChar( xTxt:ClassH() ) + "):{"
aData := __objGetValueLIST( xTxt )
aData := __objGetValueList( xTxt )
nLen := Len( aData )
FOR n := 1 TO nLen // For each item : Recurse !
cOut += aData[ n ][ HB_OO_DATA_SYMBOL ] + ":" + ;

View File

@@ -996,7 +996,7 @@ METHOD Write( lKeepBuffer ) CLASS HBTable
LOCAL aOldBuffer := Array( ( ::Alias )->( FCount() ) )
LOCAL nSel := Select( ::Alias )
LOCAL nOrd := ( ::Alias )->( ordSetFocus() )
LOCAL aData := __objGetValueLIST( Self )
LOCAL aData := __objGetValueList( Self )
LOCAL xBuffer
LOCAL n

View File

@@ -236,7 +236,7 @@ FUNCTION ValToPrg( xVal, cName, nPad, aObjs )
nPad += 3
cPad := Space( nPad )
FOR EACH aVar IN __objGetValueLIST( xVal )
FOR EACH aVar IN __objGetValueList( xVal )
cRet += cPad + cName + ":" + aVar[ 1 ] + " := " + ValToPrg( aVar[ 2 ], cName + ":" + aVar[ 1 ], nPad, aObjs ) + CRLF
NEXT

View File

@@ -1447,7 +1447,7 @@ DYNAMIC __objGetClsName
DYNAMIC __objGetMethodList
DYNAMIC __objGetMsgList
DYNAMIC __objGetProperties
DYNAMIC __objGetValueLIST
DYNAMIC __objGetValueList
DYNAMIC __objHasData
DYNAMIC __objHasMethod
DYNAMIC __objHasMsg

View File

@@ -53,18 +53,10 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo
LOCAL cKey
LOCAL nAux
IF ! HB_ISNUMERIC( nTop )
nTop := 0
ENDIF
IF ! HB_ISNUMERIC( nLeft )
nLeft := 0
ENDIF
IF ! HB_ISNUMERIC( nBottom )
nBottom := 0
ENDIF
IF ! HB_ISNUMERIC( nRight )
nRight := 0
ENDIF
hb_default( @nTop, 0 )
hb_default( @nLeft, 0 )
hb_default( @nBottom, 0 )
hb_default( @nRight, 0 )
IF nRight > MaxCol()
nRight := MaxCol()
@@ -98,12 +90,9 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo
IF ! HB_ISARRAY( xSelect ) .AND. ! HB_ISLOGICAL( xSelect )
xSelect := .T. // Array or logical, what is selectable
ENDIF
IF ! HB_ISNUMERIC( nPos )
nPos := 1 // The number of the selected item
ENDIF
IF ! HB_ISNUMERIC( nHiLiteRow )
nHiLiteRow := 0 // The row to be highlighted
ENDIF
hb_default( @nPos, 1 ) // The number of the selected item
hb_default( @nHiLiteRow, 0 ) // The row to be highlighted
nNumCols := nRight - nLeft + 1
nNumRows := nBottom - nTop + 1

View File

@@ -64,9 +64,7 @@ FUNCTION Alert( cMessage, aOptions, cColorNorm )
cMessage := StrTran( cMessage, ";", Chr( 10 ) )
IF ! HB_ISARRAY( aOptions )
aOptions := {}
ENDIF
hb_default( @aOptions, {} )
IF ! HB_ISSTRING( cColorNorm ) .OR. Empty( cColorNorm )
cColorNorm := "W+/R" // first pair color (Box line and Text)
@@ -131,9 +129,7 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay )
cMessage := hb_CStr( xMessage )
ENDIF
IF ! HB_ISARRAY( aOptions )
aOptions := {}
ENDIF
hb_default( @aOptions, {} )
IF ! HB_ISSTRING( cColorNorm ) .OR. Empty( cColorNorm )
cColorNorm := "W+/R" // first pair color (Box line and Text)

View File

@@ -146,9 +146,7 @@ FUNCTION hb_PathRelativize( cPathBase, cPathTarget, lForceRelative )
RETURN ""
ENDIF
IF ! HB_ISLOGICAL( lForceRelative )
lForceRelative := .T.
ENDIF
hb_default( @lForceRelative, .T. )
cPathBase := hb_PathJoin( hb_DirBase(), hb_DirSepAdd( cPathBase ) )
cPathTarget := hb_PathJoin( hb_DirBase(), cPathTarget )

View File

@@ -323,12 +323,8 @@ FUNCTION __i18n_potArraySave( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef )
LOCAL cEol, cPOT, cFlg
LOCAL msg
IF ! HB_ISLOGICAL( lVersionNo )
lVersionNo := .T.
ENDIF
IF ! HB_ISLOGICAL( lSourceRef )
lSourceRef := .T.
ENDIF
hb_default( @lVersionNo, .T. )
hb_default( @lSourceRef, .T. )
lRet := .F.
cEol := hb_eol()
@@ -392,9 +388,7 @@ FUNCTION __i18n_potArrayToHash( aTrans, lEmpty, hI18N )
LOCAL cContext
LOCAL hTrans, hContext
IF ! HB_ISLOGICAL( lEmpty )
lEmpty := .F.
ENDIF
hb_default( @lEmpty, .F. )
IF ! HB_ISHASH( hI18N )
hI18N := { "CONTEXT" => { "" => { => } } }
ENDIF

View File

@@ -97,9 +97,7 @@ FUNCTION hb_iniNew( lAutoMain )
hb_HKeepOrder( hIni, .T. )
IF ! HB_ISLOGICAL( lAutoMain )
lAutoMain := .T.
ENDIF
hb_default( @lAutoMain, .T. )
IF lAutoMain
hIni[ "MAIN" ] := { => }
@@ -119,18 +117,10 @@ FUNCTION hb_iniReadStr( cData, lKeyCaseSens, cSplitters, lAutoMain )
hb_HKeepOrder( hIni, .T. )
/* Default case sensitiveness for keys */
IF ! HB_ISLOGICAL( lKeyCaseSens )
lKeyCaseSens := .T.
ENDIF
IF ! HB_ISSTRING( cSplitters )
cSplitters := "="
ENDIF
IF ! HB_ISLOGICAL( lAutoMain )
lAutoMain := .T.
ENDIF
IF ! HB_ISSTRING( cData )
cData := ""
ENDIF
hb_default( @lKeyCaseSens, .T. )
hb_default( @cSplitters, "=" )
hb_default( @lAutoMain, .T. )
hb_default( @cData, "" )
hb_HCaseMatch( hIni, lKeyCaseSens )
@@ -346,9 +336,7 @@ FUNCTION hb_iniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain )
cBuffer += cCommentBegin + cNewLine
ENDIF
IF ! HB_ISLOGICAL( lAutoMain )
lAutoMain := .T.
ENDIF
hb_default( @lAutoMain, .T. )
// Fix if lAutoMain is .T. but I haven't a MAIN section
IF lAutoMain .AND. ! hb_HHasKey( hIni, "MAIN" )

View File

@@ -323,12 +323,9 @@ METHOD findText( cText, nPos, lCaseSensitive, lExact ) CLASS LISTBOX
IF ! HB_ISSTRING( cText ) .OR. Len( cText ) == 0
RETURN 0
ENDIF
IF ! HB_ISNUMERIC( nPos )
nPos := 1
ENDIF
IF ! HB_ISLOGICAL( lCaseSensitive )
lCaseSensitive := .T.
ENDIF
hb_default( @nPos, 1 )
hb_default( @lCaseSensitive, .T. )
IF ! HB_ISLOGICAL( lExact )
lExact := Set( _SET_EXACT )
ENDIF
@@ -367,12 +364,9 @@ METHOD findData( cData, nPos, lCaseSensitive, lExact ) CLASS LISTBOX
IF ! HB_ISSTRING( cData )
RETURN 0
ENDIF
IF ! HB_ISNUMERIC( nPos )
nPos := 1
ENDIF
IF ! HB_ISLOGICAL( lCaseSensitive )
lCaseSensitive := .T.
ENDIF
hb_default( @nPos, 1 )
hb_default( @lCaseSensitive, .T. )
IF ! HB_ISLOGICAL( lExact )
lExact := Set( _SET_EXACT )
ENDIF
@@ -1065,9 +1059,7 @@ METHOD New( nTop, nLeft, nBottom, nRight, lDropDown )
RETURN NIL
ENDIF
IF ! HB_ISLOGICAL( lDropDown )
lDropDown := .F.
ENDIF
hb_default( @lDropDown, .F. )
::nBottom := nBottom
::nRight := nRight

View File

@@ -249,9 +249,7 @@ METHOD xDo( nStatus ) CLASS HBMemoEditor
LOCAL xResult := Do( ::xUserFunction, nStatus, ::nRow, ::nCol - 1 )
IF ! HB_ISNUMERIC( xResult )
xResult := ME_DEFAULT
ENDIF
hb_default( @xResult, ME_DEFAULT )
::SetPos( nOldRow, nOldCol )
SetCursor( nOldCur )
@@ -292,18 +290,18 @@ FUNCTION MemoEdit( ;
LOCAL nOldCursor
IF ! HB_ISNUMERIC( nTop ) ; nTop := 0 ; ENDIF
IF ! HB_ISNUMERIC( nLeft ) ; nLeft := 0 ; ENDIF
IF ! HB_ISNUMERIC( nBottom ) ; nBottom := MaxRow() ; ENDIF
IF ! HB_ISNUMERIC( nRight ) ; nRight := MaxCol() ; ENDIF
IF ! HB_ISLOGICAL( lEditMode ) ; lEditMode := .T. ; ENDIF
IF ! HB_ISNUMERIC( nLineLength ) ; nLineLength := nRight - nLeft + 1 ; ENDIF
IF ! HB_ISNUMERIC( nTabSize ) ; nTabSize := 4 ; ENDIF
IF ! HB_ISNUMERIC( nTextBuffRow ) ; nTextBuffRow := 1 ; ENDIF
IF ! HB_ISNUMERIC( nTextBuffColumn ) ; nTextBuffColumn := 0 ; ENDIF
IF ! HB_ISNUMERIC( nWindowRow ) ; nWindowRow := 0 ; ENDIF
IF ! HB_ISNUMERIC( nWindowColumn ) ; nWindowColumn := nTextBuffColumn ; ENDIF
IF ! HB_ISSTRING( cString ) ; cString := "" ; ENDIF
hb_default( @nTop , 0 )
hb_default( @nLeft , 0 )
hb_default( @nBottom , MaxRow() )
hb_default( @nRight , MaxCol() )
hb_default( @lEditMode , .T. )
hb_default( @nLineLength , nRight - nLeft + 1 )
hb_default( @nTabSize , 4 )
hb_default( @nTextBuffRow , 1 )
hb_default( @nTextBuffColumn , 0 )
hb_default( @nWindowRow , 0 )
hb_default( @nWindowColumn , nTextBuffColumn )
hb_default( @cString , "" )
// Original MemoEdit() converts Tabs into spaces;
oEd := HBMemoEditor():New( StrTran( cString, Chr( 9 ), Space( 1 ) ), nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize, nTextBuffRow, nTextBuffColumn, nWindowRow, nWindowColumn )

View File

@@ -104,9 +104,7 @@ FUNCTION hb_mvSave( cFileName, cMask, lIncludeMask )
cMask := "*"
ENDIF
IF ! HB_ISLOGICAL( lIncludeMask )
lIncludeMask := .T.
ENDIF
hb_default( @lIncludeMask, .T. )
aVars := {}
@@ -187,9 +185,7 @@ FUNCTION hb_mvRestore( cFileName, lAdditive, cMask, lIncludeMask )
IF HB_ISSTRING( cFileName )
IF ! HB_ISLOGICAL( lAdditive )
lAdditive := .T.
ENDIF
hb_default( @lAdditive, .T. )
IF ! lAdditive
__mvClear()
@@ -204,9 +200,7 @@ FUNCTION hb_mvRestore( cFileName, lAdditive, cMask, lIncludeMask )
cMask := "*"
ENDIF
IF ! HB_ISLOGICAL( lIncludeMask )
lIncludeMask := .T.
ENDIF
hb_default( @lIncludeMask, .T. )
nRetries := 0
DO WHILE .T.

View File

@@ -130,9 +130,7 @@ FUNCTION __MenuTo( bBlock, cVariable )
xMsg := Eval( xMsg )
ENDIF
IF ! HB_ISSTRING( xMsg )
xMsg := ""
ENDIF
hb_default( @xMsg, "" )
IF lMsgCenter
nMsgCol := Int( ( MaxCol() - Len( xMsg ) ) / 2 )

View File

@@ -100,13 +100,8 @@ FUNCTION __objGetMsgList( oObject, lDataMethod, nClassType )
__errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) )
ENDIF
IF ! HB_ISLOGICAL( lDataMethod )
lDataMethod := .T.
ENDIF
IF ! HB_ISNUMERIC( nClassType )
nClasstype := HB_MSGLISTALL
ENDIF
hb_default( @lDataMethod, .T. )
hb_default( @nClasstype, HB_MSGLISTALL )
aInfo := ASort( oObject:ClassSel( nClassType ) )
aData := {}
@@ -141,7 +136,7 @@ FUNCTION __objGetMethodList( oObject )
RETURN __objGetMsgList( oObject, .F. )
FUNCTION __objGetValueLIST( oObject, aExcept )
FUNCTION __objGetValueList( oObject, aExcept )
LOCAL aDataSymbol
LOCAL nLen
@@ -153,9 +148,7 @@ FUNCTION __objGetValueLIST( oObject, aExcept )
__errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) )
ENDIF
IF ! HB_ISARRAY( aExcept )
aExcept := {}
ENDIF
hb_default( @aExcept, {} )
aDataSymbol := __objGetMsgList( oObject )
nLen := Len( aDataSymbol )

View File

@@ -535,9 +535,7 @@ METHOD generate( bFilter ) CLASS HBProfileReport
LOCAL lProfile := __SetProfiler( .F. )
IF ! HB_ISBLOCK( bFilter )
bFilter := {|| .T. }
ENDIF
hb_default( @bFilter, {|| .T. } )
::emitHeader():oProfile:forEach( {| o | iif( Eval( bFilter, o ), ::emitLine( o ), NIL ) } )
@@ -576,9 +574,7 @@ METHOD generate( bFilter, cFile ) CLASS HBProfileReportToFile
LOCAL lProfile := __SetProfiler( .F. )
IF ! HB_ISSTRING( cFile )
cFile := "hbprof.txt"
ENDIF
hb_default( @cFile, "hbprof.txt" )
IF ( ::hFile := FCreate( cFile ) ) != F_ERROR
::super:generate( bFilter )

View File

@@ -329,9 +329,7 @@ METHOD New( nRow, nCol, cCaption, cData ) CLASS RADIOBUTTN
RETURN NIL
ENDIF
IF ! HB_ISSTRING( cCaption )
cCaption := ""
ENDIF
hb_default( @cCaption, "" )
::nCapRow := nRow
::nCapCol := nCol + 3 + 1

View File

@@ -1311,16 +1311,12 @@ METHOD doConfigure() CLASS TBROWSE
cHeadSep := oCol:headSep
IF ! HB_ISSTRING( cHeadSep ) .OR. cHeadSep == ""
cHeadSep := ::cHeadSep
IF ! HB_ISSTRING( cHeadSep )
cHeadSep := ""
ENDIF
hb_default( @cHeadSep, "" )
ENDIF
cFootSep := oCol:footSep
IF ! HB_ISSTRING( cFootSep ) .OR. cFootSep == ""
cFootSep := ::cFootSep
IF ! HB_ISSTRING( cFootSep )
cFootSep := ""
ENDIF
hb_default( @cFootSep, "" )
ENDIF
aCol := Array( _TBCI_SIZE )
aCol[ _TBCI_COLOBJECT ] := oCol

View File

@@ -1006,18 +1006,18 @@ METHOD BrowseText( nPassedKey )
METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize, nTextRow, nTextCol, nWndRow, nWndCol ) CLASS HBEditor
IF ! HB_ISSTRING( cString ) ; cString := "" ; ENDIF
IF ! HB_ISNUMERIC( nTop ) ; nTop := 0 ; ENDIF
IF ! HB_ISNUMERIC( nLeft ) ; nLeft := 0 ; ENDIF
IF ! HB_ISNUMERIC( nBottom ) ; nBottom := MaxRow() ; ENDIF
IF ! HB_ISNUMERIC( nRight ) ; nRight := MaxCol() ; ENDIF
IF ! HB_ISLOGICAL( lEditMode ) ; lEditMode := .T. ; ENDIF
IF ! HB_ISNUMERIC( nLineLength ) ; nLineLength := NIL ; ENDIF
IF ! HB_ISNUMERIC( nTabSize ) ; nTabSize := NIL ; ENDIF
IF ! HB_ISNUMERIC( nTextRow ) ; nTextRow := 1 ; ENDIF
IF ! HB_ISNUMERIC( nTextCol ) ; nTextCol := 0 ; ENDIF
IF ! HB_ISNUMERIC( nWndRow ) ; nWndRow := 0 ; ENDIF
IF ! HB_ISNUMERIC( nWndCol ) ; nWndCol := 0 ; ENDIF
hb_default( @cString , "" )
hb_default( @nTop , 0 )
hb_default( @nLeft , 0 )
hb_default( @nBottom , MaxRow() )
hb_default( @nRight , MaxCol() )
hb_default( @lEditMode , .T. )
hb_default( @nLineLength , NIL )
hb_default( @nTabSize , NIL )
hb_default( @nTextRow , 1 )
hb_default( @nTextCol , 0 )
hb_default( @nWndRow , 0 )
hb_default( @nWndCol , 0 )
::aText := Text2Array( cString, nLineLength )
::naTextLen := Len( ::aText )

View File

@@ -656,9 +656,7 @@ METHOD GetDoSetKey( bKeyBlock, oGet ) CLASS HBGetList
lSetKey := Eval( bKeyBlock, ::cReadProcName, ::nReadProcLine, ::ReadVar() )
IF ! HB_ISLOGICAL( lSetKey )
lSetKey := .T.
ENDIF
hb_default( @lSetKey, .T. )
::ShowScoreboard()
oGet:updateBuffer()

View File

@@ -180,15 +180,9 @@ METHOD isPopUp() CLASS MENUITEM
METHOD New( cCaption, boData, nShortcut, cMessage, nID ) CLASS MENUITEM
IF ! HB_ISNUMERIC( nShortcut )
nShortcut := 0
ENDIF
IF ! HB_ISSTRING( cMessage )
cMessage := ""
ENDIF
IF ! HB_ISNUMERIC( nID )
nID := 0
ENDIF
hb_default( @nShortcut, 0 )
hb_default( @cMessage, "" )
hb_default( @nID, 0 )
::data := boData
::nID := nID

View File

@@ -149,8 +149,6 @@ STATIC FUNCTION HBObject_Dftonerror( ... )
STATIC FUNCTION HBObject_Error( cDesc, cClass, cMsg, nCode )
IF ! HB_ISNUMERIC( nCode )
nCode := 1004
ENDIF
hb_default( @nCode, 1004 )
RETURN __errRT_SBASE( iif( nCode == 1005, EG_NOVARMETHOD, EG_NOMETHOD ), nCode, cDesc, cClass + ":" + cMsg, 1, QSelf() )

View File

@@ -72,9 +72,7 @@ PROCEDURE __TypeFile( cFile, lPrint )
LOCAL cPath
LOCAL i
IF ! HB_ISLOGICAL( lPrint )
lPrint := .F.
ENDIF
hb_default( @lPrint, .F. )
IF ! HB_ISSTRING( cFile )
oErr := ErrorNew()

View File

@@ -233,7 +233,7 @@ STATIC FUNCTION Transfer( x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 ) /* etc */
LOCAL n
IF nLen == 0
xRet := __objGetValueLIST( self, ::aExcept() )
xRet := __objGetValueList( self, ::aExcept() )
ELSE
FOR n := 1 TO nLen