user: edit.c make sure our vlc (vertical line count) is at least 1 even if there is an oversized font in the edit control

Aric Stewart aric at codeweavers.com
Tue Oct 14 12:31:21 CDT 2008


Great idea,  patch resubmitted.
-aric

Juan Lang wrote:
> Hi Aric,
> 
> Just a suggestion:
> 
> @@ -1818,6 +1818,7 @@ static void EDIT_ML_InvalidateText(EDITSTATE
> *es, INT start, INT end)
>  	RECT rcUpdate;
>  	INT l;
> 
> +	if (vlc == 0) vlc = 1;
>  	if ((el < es->y_offset) || (sl > es->y_offset + vlc))
>  		return;
> 
> @@ -2235,6 +2236,7 @@ static void EDIT_PaintLine(EDITSTATE *es, HDC
> dc, INT line, BOOL rev)
> 
>  	if (es->style & ES_MULTILINE) {
>  		INT vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
> +		if (vlc == 0) vlc = 1;
> 
> 
> rather than having to introduce the correction in every place it's
> used, replacing the initialization of vlc with a call to an inline
> function would reduce the new lines of code (and the probability of
> future error.)
> --Juan
> 



More information about the wine-devel mailing list