From d16c818422319cd8193fef273d48a15b3ba926c9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 5 Oct 2012 17:26:37 +0000 Subject: [PATCH] 2012-10-05 19:22 UTC+0200 Viktor Szakats (vszakats syenar.net) * contrib/gtwvg/syswnd.prg * contrib/gtwvg/tests/tbrowser.prg * contrib/gtwvg/treeview.prg * contrib/hbct/doc/en/dattime3.txt * contrib/hbtip/tests/tiptest.prg * contrib/xhb/trpc.prg * contrib/xhb/xhbtedit.prg * extras/gfspell/spell.prg * src/rdd/dbjoin.prg * src/rtl/tpopup.prg * tests/testrdd2.prg * TRIM() -> RTRIM() --- harbour/ChangeLog | 14 ++++++++++++++ harbour/contrib/gtwvg/syswnd.prg | 2 +- harbour/contrib/gtwvg/tests/tbrowser.prg | 4 ++-- harbour/contrib/gtwvg/treeview.prg | 4 ++-- harbour/contrib/hbct/doc/en/dattime3.txt | 2 +- harbour/contrib/hbtip/tests/tiptest.prg | 2 +- harbour/contrib/xhb/trpc.prg | 2 +- harbour/contrib/xhb/xhbtedit.prg | 8 ++++---- harbour/extras/gfspell/spell.prg | 16 ++++++++-------- harbour/src/rdd/dbjoin.prg | 2 +- harbour/src/rtl/tpopup.prg | 2 +- harbour/tests/testrdd2.prg | 4 ++-- 12 files changed, 38 insertions(+), 24 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6ead5570a1..1185d8f449 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,20 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-05 19:22 UTC+0200 Viktor Szakats (vszakats syenar.net) + * contrib/gtwvg/syswnd.prg + * contrib/gtwvg/tests/tbrowser.prg + * contrib/gtwvg/treeview.prg + * contrib/hbct/doc/en/dattime3.txt + * contrib/hbtip/tests/tiptest.prg + * contrib/xhb/trpc.prg + * contrib/xhb/xhbtedit.prg + * extras/gfspell/spell.prg + * src/rdd/dbjoin.prg + * src/rtl/tpopup.prg + * tests/testrdd2.prg + * TRIM() -> RTRIM() + 2012-10-05 18:56 UTC+0200 Viktor Szakats (harbour syenar.net) * tests/tb1.prg ! fixed unicode for some cases diff --git a/harbour/contrib/gtwvg/syswnd.prg b/harbour/contrib/gtwvg/syswnd.prg index e95c7af931..9ffae5ec48 100644 --- a/harbour/contrib/gtwvg/syswnd.prg +++ b/harbour/contrib/gtwvg/syswnd.prg @@ -473,7 +473,7 @@ METHOD GetWvgFont( aFont ) CLASS WvgFontDialog oWvgFont:underscore := aFont[ 6 ] oWvgFont:strikeOut := aFont[ 7 ] oWvgFont:codePage := aFont[ 8 ] - oWvgFont:setCompoundName( Trim( aFont[ 1 ] + " " + iif( oWvgFont:bold, "Bold ", "" ) + ; + oWvgFont:setCompoundName( RTrim( aFont[ 1 ] + " " + iif( oWvgFont:bold, "Bold ", "" ) + ; iif( oWvgFont:italic, "Italic", "" ) ) ) oWvgFont:create() diff --git a/harbour/contrib/gtwvg/tests/tbrowser.prg b/harbour/contrib/gtwvg/tests/tbrowser.prg index 9a0f23ffa5..9e224e3dcb 100644 --- a/harbour/contrib/gtwvg/tests/tbrowser.prg +++ b/harbour/contrib/gtwvg/tests/tbrowser.prg @@ -426,7 +426,7 @@ STATIC FUNCTION BrwBuildSLE( oCrt, oBrw ) oXbp:create( , , { -16, -1 }, { -1, -10 } ) oXbp:setColorFG( "N" ) oXbp:setColorBG( "BG+" ) - oXbp:returnPressed := {| m1, m2, o | m1 := m1, m2 := m2, BrwShowColumn( oBrw, Upper( Trim( o:getData() ) ) ) } + oXbp:returnPressed := {| m1, m2, o | m1 := m1, m2 := m2, BrwShowColumn( oBrw, Upper( RTrim( o:getData() ) ) ) } oXbp:tooltipText := "Type in a field name and press ENTER" RETURN oXbp @@ -452,7 +452,7 @@ STATIC FUNCTION BrwBuildNvg( oCrt, oBrw, oCom ) oXbp:create( , , { -23, -19 }, { -1, {|| -( MaxCol() - 1 - 19 ) } }, , .F. ) oXbp:setColorFG( "N" ) oXbp:setColorBG( "BG+" ) - oXbp:returnPressed := {| m1, m2, o | m1 := m2, oCom:navigate( Trim( o:getData() ) ) } + oXbp:returnPressed := {| m1, m2, o | m1 := m2, oCom:navigate( RTrim( o:getData() ) ) } oXbp:tooltipText := "Type-in a http:// address and press ENTER" oXbp:setData( "http://hbide.vouch.info/" ) diff --git a/harbour/contrib/gtwvg/treeview.prg b/harbour/contrib/gtwvg/treeview.prg index 50cf914c77..f3bc5960ef 100644 --- a/harbour/contrib/gtwvg/treeview.prg +++ b/harbour/contrib/gtwvg/treeview.prg @@ -294,8 +294,8 @@ METHOD WvgTreeView:getSelectionInfo( nlParam ) ::hParentSelected := hParentOfSelected ::hItemSelected := hItemSelected - ::textParentSelected := Trim( cParent ) - ::textItemSelected := Trim( cText ) + ::textParentSelected := RTrim( cParent ) + ::textItemSelected := RTrim( cText ) IF ( n := AScan( ::aItems, {| o | o:hItem == hItemSelected } ) ) > 0 ::oItemSelected := ::aItems[ n ] diff --git a/harbour/contrib/hbct/doc/en/dattime3.txt b/harbour/contrib/hbct/doc/en/dattime3.txt index 4b9eaed349..15cdd57c46 100644 --- a/harbour/contrib/hbct/doc/en/dattime3.txt +++ b/harbour/contrib/hbct/doc/en/dattime3.txt @@ -91,7 +91,7 @@ * * cBegin := SPACE( 11 ) * @ 5, 10 SAY "Please input time for beginning work:"; - * GET cBegin VALID TIMEVALID( TRIM( cBegin ) ) + * GET cBegin VALID TIMEVALID( RTRIM( cBegin ) ) * READ * * Using a VALID clause without TRIM, hours and minutes must be diff --git a/harbour/contrib/hbtip/tests/tiptest.prg b/harbour/contrib/hbtip/tests/tiptest.prg index 5e82cc5239..351694f5bf 100644 --- a/harbour/contrib/hbtip/tests/tiptest.prg +++ b/harbour/contrib/hbtip/tests/tiptest.prg @@ -123,7 +123,7 @@ PROCEDURE Main( cUrl, cFile ) cData := oClient:Read() IF ! Empty( cData ) @ 7, 5 SAY "First 80 characters:" - ? Trim( SubStr( cData, 1, 80 ) ) + ? RTrim( SubStr( cData, 1, 80 ) ) ELSE @ 7, 5 SAY "ERROR - file can't be retrieved " + oClient:lastErrorMessage() ENDIF diff --git a/harbour/contrib/xhb/trpc.prg b/harbour/contrib/xhb/trpc.prg index 6d1636e75b..4506fa03a3 100644 --- a/harbour/contrib/xhb/trpc.prg +++ b/harbour/contrib/xhb/trpc.prg @@ -245,7 +245,7 @@ METHOD New( cFname, cSerial, nAuthLevel, oExec, oMeth ) CLASS tRPCFunction ::cReturn := iif( Len( aFuncDef ) == 4, aFuncDef[4], aFuncDef[5] ) // analyze parameter list - IF Len( Trim( cParam ) ) > 0 + IF Len( RTrim( cParam ) ) > 0 aParams := hb_ATokens( cParam, "," ) ::aParameters := {} FOR EACH cParam IN aParams diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index 4bdc2c251c..524189ec41 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -2211,10 +2211,10 @@ METHOD SplitLine( nRow ) CLASS XHBEditor // IF nStartRow + 1 <= ::LastRow() IF ::LineLen( nStartRow + 1 ) == 0 .OR. Len( AllTrim( cLine ) ) > 0 - ::InsertLine( Trim( cLine ), .F. , nStartRow ) + ::InsertLine( RTrim( cLine ), .F. , nStartRow ) ENDIF ELSE - ::InsertLine( Trim( cLine ), .F. , nStartRow ) + ::InsertLine( RTrim( cLine ), .F. , nStartRow ) ENDIF // re-count words and see where current word has gone. @@ -2775,7 +2775,7 @@ METHOD DelTextSelection() CLASS XHBEditor IF Empty( ::aText ) ::DelText() ELSE - ::GoToPos( Max( 1,nRowSelStart ) , 1 ) + ::GoToPos( Max( 1, nRowSelStart ), 1 ) ENDIF ::ClrTextSelection() @@ -2789,7 +2789,7 @@ METHOD DelTextSelection() CLASS XHBEditor cText := ::aText[ ::nRow ]:cText ::aText[::nRow]:cText := Stuff( cText, ::nColSelStart, ::nColSelEnd - ::nColSelStart + 1, "" ) ::RefreshLine() - ::GoToPos( ::nRow, Max( 1,::nColSelStart ) ) + ::GoToPos( ::nRow, Max( 1, ::nColSelStart ) ) ::nColSelStart := ::nColSelEnd := 0 ::lChanged := .T. IF Empty( ::aText ) diff --git a/harbour/extras/gfspell/spell.prg b/harbour/extras/gfspell/spell.prg index 1610ea2872..7884927d6e 100644 --- a/harbour/extras/gfspell/spell.prg +++ b/harbour/extras/gfspell/spell.prg @@ -201,7 +201,7 @@ STATIC nBuffCount := 0 LOCAL ok := .T. -LOCAL cLookup := upper(trim(cWord)) +LOCAL cLookup := upper(rtrim(cWord)) LOCAL nRow LOCAL nCol LOCAL x @@ -489,7 +489,7 @@ LOCAL arr_ **DEBUG** @24,30 SAY "At SP_suggest" -cWord := upper(trim(cWord)) +cWord := upper(rtrim(cWord)) zz := len(cWord) if zz =1 // Don't offer suggestions for @@ -614,7 +614,7 @@ if SUGGEST_PREFERENCE $ "AB" // for jj := 1 to nSugg - cHold := trim(substr(aRet_[jj],5)) // Extract the word + cHold := rtrim(substr(aRet_[jj],5)) // Extract the word zz := len(cHold) // // Check suffixes @@ -841,7 +841,7 @@ LOCAL cHold,ll,cTemp **DEBUG** @24,30 SAY "At SP_quick" -cWord := upper(trim(cWord)) +cWord := upper(rtrim(cWord)) if zz < 3 && Don't offer suggestions for return {} && one or two letter words @@ -1256,12 +1256,12 @@ if nH >= 0 skip +1 enddo do while substr(DICT->word,2,1)==chr(j+64) .and. !eof() - if len(trim(DICT->word))=3 + if len(rtrim(DICT->word))=3 Bit(cBits,asc(substr(DICT->word,3,1))-64,.T.) - elseif len(trim(DICT->word))==2 + elseif len(rtrim(DICT->word))==2 Bit(cBits,27,.T.) else - temp += StoreWord(trim(DICT->word)) + temp += StoreWord(rtrim(DICT->word)) endif skip +1 if lTalk @@ -1604,7 +1604,7 @@ return lMatch #ifndef CLIP52 function aWords(cLine) LOCAL aWords_ := {} -LOCAL nSize := len(trim(cLine)) +LOCAL nSize := len(rtrim(cLine)) LOCAL x,y,z LOCAL cWord := "" LOCAL nOffset diff --git a/harbour/src/rdd/dbjoin.prg b/harbour/src/rdd/dbjoin.prg index f360acd788..6024d8b295 100644 --- a/harbour/src/rdd/dbjoin.prg +++ b/harbour/src/rdd/dbjoin.prg @@ -125,7 +125,7 @@ STATIC FUNCTION __FieldTwo( cAlias, aFields ) ENDIF aFldTemp := {} - AEval( aFields, {| cFld | AAdd( aFldTemp, Trim( Upper( cFld ) ) ) } ) + AEval( aFields, {| cFld | AAdd( aFldTemp, RTrim( Upper( cFld ) ) ) } ) aFields := aFldTemp diff --git a/harbour/src/rtl/tpopup.prg b/harbour/src/rtl/tpopup.prg index b2e749a4d5..3c501334b4 100644 --- a/harbour/src/rtl/tpopup.prg +++ b/harbour/src/rtl/tpopup.prg @@ -260,7 +260,7 @@ METHOD display() CLASS POPUPMENU ELSE cCaption := SubStr( cCaption, 1, Len( cCaption ) - 1 ) ENDIF - ELSEIF nHotKeyPos == Len( Trim( cCaption ) ) + ELSEIF nHotKeyPos == Len( RTrim( cCaption ) ) cCaption := SubStr( cCaption, 1, Len( cCaption ) - 1 ) nHotKeyPos := 0 ELSE diff --git a/harbour/tests/testrdd2.prg b/harbour/tests/testrdd2.prg index ddadde3cb7..3791dfa9f2 100644 --- a/harbour/tests/testrdd2.prg +++ b/harbour/tests/testrdd2.prg @@ -191,7 +191,7 @@ PROCEDURE Main( cRDDType, cAdsMode ) // TEST: Field access - IF ! Trim( FIELD->CHAR ) == Chr( 65 + Val( SubStr( LTrim( Str( RecNo() ) ), 2, 1 ) ) ) + ; + IF ! RTrim( FIELD->CHAR ) == Chr( 65 + Val( SubStr( LTrim( Str( RecNo() ) ), 2, 1 ) ) ) + ; " RECORD " + LTrim( Str( RecNo() ) ) .OR. ; ! FIELD->NUM == ( iif( RecNo() % 2 > 0, - 1, 1 ) * RecNo() ) + ( RecNo() / 1000 ) .OR. ; ! FIELD->DATE == Date() + Int( FIELD->NUM ) .OR. ; @@ -300,7 +300,7 @@ PROCEDURE Main( cRDDType, cAdsMode ) SET EXACT ON SET ORDER TO 0 - COUNT for Trim( FIELD->CHAR ) = "A RECORD 1" TO xTemp // Get proper count + COUNT FOR RTrim( FIELD->CHAR ) = "A RECORD 1" TO xTemp // Get proper count INDEX ON CHAR TO test_e.idx FOR RTrim( FIELD->CHAR ) = "A RECORD 1" ADDITIVE IF ! dbOrderInfo( DBOI_KEYCOUNT ) == xTemp NotifyUser( "Bad conditional index count with EXACT ON" )