Re: [Plib-devel] [PATCH] puAuxLargeInput: fix selection bug, make not needed sliders disappear
Brought to you by:
sjbaker
From: Fay, J. F Dr C. U. A. 46 S. <joh...@eg...> - 2009-01-20 21:05:46
|
Very good. On building it I get two compiler warnings in puAuxLargeInput.c, one on line 1262 and the other on line 1299. They flag a conversion from "int" to "float" and vice versa. Have I missed something? I tried fixing them by changing "float maxw" to "int maxw" on line 1241. Is this appropriate? John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294 -----Original Message----- From: Melchior FRANZ [mailto:mf...@us...] Sent: Tuesday, January 20, 2009 2:19 PM To: pli...@li... Subject: Re: [Plib-devel] [PATCH] puAuxLargeInput: fix selection bug,make not needed sliders disappear * Fay, John F Dr CTR USAF AFMC 46 SK -- Tuesday 20 January 2009: > As I am making the changes, I find that the default value of the > puAuxLargeInput text is being changed from a "\n" to an empty string. setValue() does this: void puaLargeInput::setValue ( const char *s ) { if (!s || !*s) { puValue::setValue ( "\n" ) ; cursor_position = select_start_position = select_end_position = 0 ; } else { int len = strlen(s); if (s[len - 1] == '\n') { puValue::setValue ( s ) ; } else { char *buf = new char [ len + 2 ] ; strcpy ( buf, s ) ; strcat ( buf, "\n" ) ; puValue::setValue ( buf ) ; delete [] buf ; } } ... so for an empty string, "\n" is set automatically. But this branch also sets the selection variables, which I kept from the old code, and it's a tad faster. So, yes. It's intentional. m. ------------------------------------------------------------------------ ------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ plib-devel mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-devel |