[Plib-cvs] plib/src/pui puValue.cxx,1.15,1.16
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-06-04 22:21:22
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv19370 Modified Files: puValue.cxx Log Message: John F. Fay: With numeric valuators, don't modify string value unless necessary Index: puValue.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puValue.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- puValue.cxx 11 May 2002 14:49:31 -0000 1.15 +++ puValue.cxx 4 Jun 2002 22:21:19 -0000 1.16 @@ -31,12 +31,28 @@ if ( res_integer != NULL ) { - floater = (float) *res_integer ; sprintf ( string, "%d", *res_integer ) ; + floater = (float) *res_integer ; + + /* + Needed for puInput / puLargeInput: + Do not modify the string value unless necessary + */ + if ( *res_integer != strtol ( string, NULL, 0 ) ) + sprintf ( string, "%d", *res_integer ) ; + puPostRefresh () ; } else if ( res_floater != NULL ) { - integer = (int) *res_floater ; sprintf ( string, "%g", *res_floater ) ; + integer = (int) *res_floater ; + + /* + Needed for puInput / puLargeInput: + Do not modify the string value unless necessary + */ + if ( *res_floater != strtod ( string, NULL ) ) + sprintf ( string, "%g", *res_floater ) ; + puPostRefresh () ; } else if ( res_string != NULL ) |