2013-01-19 00:01 UTC+0100 Viktor Szakats (harbour syenar.net)

* src/rtl/tget.prg
    ! fixed RTE in ::OverStrike()/::Insert() when a non-string
      parameter was passed
    ! fixed Clipper incompatibility when passing certain
      multichar strings to ::OverStrike()/::Insert(). (f.e. "12", "23")
      Clipper always uses the first char only.
    ! fixed ::unTransform() missing the leading decimal
      point in number picture masks (f.e. ".9", "-.9", ".-9")

  * tests/rto_get.prg
    + added regression tests for cases fixed above

  * tests/rto_get.prg
  * tests/rto_tb.prg
    * minor modification to make them work as hbrun scripts
This commit is contained in:
Viktor Szakats
2013-01-18 23:02:57 +00:00
parent 54c7958b7d
commit 0eeb528a56
4 changed files with 83 additions and 4 deletions

View File

@@ -10,6 +10,23 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2013-01-19 00:01 UTC+0100 Viktor Szakats (harbour syenar.net)
* src/rtl/tget.prg
! fixed RTE in ::OverStrike()/::Insert() when a non-string
parameter was passed
! fixed Clipper incompatibility when passing certain
multichar strings to ::OverStrike()/::Insert(). (f.e. "12", "23")
Clipper always uses the first char only.
! fixed ::unTransform() missing the leading decimal
point in number picture masks (f.e. ".9", "-.9", ".-9")
* tests/rto_get.prg
+ added regression tests for cases fixed above
* tests/rto_get.prg
* tests/rto_tb.prg
* minor modification to make them work as hbrun scripts
2013-01-18 04:31 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbmzip/3rd/minizip/minizip.dif
* contrib/hbmzip/3rd/minizip/zip.c

View File

@@ -565,7 +565,7 @@ METHOD varGet() CLASS Get
METHOD overStrike( cChar ) CLASS Get
IF ::hasFocus
IF ::hasFocus .AND. HB_ISSTRING( cChar )
IF ::cType == "N" .AND. ! ::lEdit .AND. ::lClear
::pos := ::FirstEditable()
@@ -573,7 +573,7 @@ METHOD overStrike( cChar ) CLASS Get
IF ::pos <= ::nMaxEdit
cChar := ::Input( cChar )
cChar := ::Input( Left( cChar, 1 ) )
IF cChar == ""
::rejected := .T.
@@ -619,7 +619,7 @@ METHOD insert( cChar ) CLASS Get
LOCAL nFor
LOCAL nMaxEdit
IF ::hasFocus
IF ::hasFocus .AND. HB_ISSTRING( cChar )
nMaxEdit := ::nMaxEdit
@@ -629,7 +629,7 @@ METHOD insert( cChar ) CLASS Get
IF ::nPos <= ::nMaxEdit
cChar := ::Input( cChar )
cChar := ::Input( Left( cChar, 1 ) )
IF cChar == ""
::rejected := .T.
@@ -1285,6 +1285,11 @@ METHOD unTransform() CLASS Get
ENDIF
cBuffer := Space( ::FirstEditable() - 1 ) + SubStr( cBuffer, ::FirstEditable(), ::LastEditable() - ::FirstEditable() + 1 )
/* Readd leading decimal point, if any */
IF ::decPos <= ::FirstEditable() - 1
cBuffer := Left( cBuffer, ::decPos - 1 ) + "." + SubStr( cBuffer, ::decPos + 1 )
ENDIF
IF "D" $ ::cPicFunc .OR. ;
"T" $ ::cPicFunc
FOR nFor := ::FirstEditable() TO ::LastEditable()

View File

@@ -105,6 +105,7 @@ PROCEDURE Main( cArg01, cArg02, cArg03, cArg04 )
ENDIF
SET DATE ANSI
SET CENTURY OFF
// ;
@@ -420,6 +421,61 @@ PROCEDURE Main( cArg01, cArg02, cArg03, cArg04 )
TEST_LINE( o:setFocus() )
TEST_LINE( o:display() )
// ; Mauricio and variations
nInt02 := 0
SetPos( 14, 16 ) ; o := _GET_( nInt02, "nInt02", ".99",, )
o:display()
o:setFocus()
TGetTOVS( o, { "12" } )
TEST_LINE( o:Assign() )
nInt02 := 0
SetPos( 14, 16 ) ; o := _GET_( nInt02, "nInt02", "-.99",, )
o:display()
o:setFocus()
TGetTOVS( o, { "12" } )
TEST_LINE( o:Assign() )
nInt02 := 0
SetPos( 14, 16 ) ; o := _GET_( nInt02, "nInt02", ".-99",, )
o:display()
o:setFocus()
TGetTOVS( o, { "12" } )
TEST_LINE( o:Assign() )
// ; Overstrike/Insert
nInt02 := 0
SetPos( 14, 16 ) ; o := _GET_( nInt02, "nInt02", "9999999999",, )
o:display()
o:setFocus()
TEST_LINE( o:OverStrike( "12" ) )
TEST_LINE( o:OverStrike( "9" ) )
TEST_LINE( o:OverStrike( "13" ) )
TEST_LINE( o:OverStrike( "9" ) )
TEST_LINE( o:OverStrike( NIL ) )
TEST_LINE( o:OverStrike( "9" ) )
TEST_LINE( o:OverStrike( 1 ) )
TEST_LINE( o:OverStrike( "9" ) )
TEST_LINE( o:OverStrike( "" ) )
TEST_LINE( o:Assign() )
nInt02 := 0
SetPos( 14, 16 ) ; o := _GET_( nInt02, "nInt02", "9999999999",, )
o:display()
o:setFocus()
TEST_LINE( o:Insert( "12" ) )
TEST_LINE( o:Insert( "9" ) )
TEST_LINE( o:Insert( "13" ) )
TEST_LINE( o:Insert( "9" ) )
TEST_LINE( o:Insert( NIL ) )
TEST_LINE( o:Insert( "9" ) )
TEST_LINE( o:Insert( 1 ) )
TEST_LINE( o:Insert( "9" ) )
TEST_LINE( o:Insert( "" ) )
TEST_LINE( o:Assign() )
// ; Buffer
s_xVar := "abcdefg"

View File

@@ -111,6 +111,7 @@ PROCEDURE Main( cArg01, cArg02, cArg03, cArg04 )
ENDIF
SET DATE ANSI
SET CENTURY OFF
// ;