controls/edit.c not so clean - help please

Carl Sopchak carl.sopchak at cegis123.com
Mon Nov 11 10:37:05 CST 2002


Thanks Vincent.  

At least it make more sense as to how this got this way.  (The line that was 
missing was "size = ((size / GROWLENGTH) + 1) * GROWLENGTH;" for those 
interested...)

I guess that leaves the question, "Is there a case (besides WM_SETTEXT) that 
EDIT_EM_ReplaceSel should not fail if the limit is exceeded?"  What should 
happen if you try to paste (insert) 10 characters into a control with a limit 
of 30, but contents of 25 characters already?

Carl

On Monday, November 11, 2002 11:03 am, Vincent Béron wrote:
> Carl Sopchak a écrit:
> > The following code is in the EDIT_MakeFit() function:
> >
> >         if ((es->buffer_limit > 0) && (size > es->buffer_limit)) {
> >                 EDIT_NOTIFY_PARENT(es, EN_MAXTEXT, "EN_MAXTEXT");
> >                 return FALSE;
> >         }
> >         if ((es->buffer_limit > 0) && (size > es->buffer_limit))
> >                 size = es->buffer_limit;
> >
> >
> > Obviously, the second IF condition is never true, since it's the same as
> > the prior IF, which does a 'return FALSE'.
>
> See
> http://cvs.winehq.org/cvsweb/wine/controls/edit.c.diff?r1=1.56&r2=1.57
> for the a removed line between the two blocks (search for line 1451).
> The rest of the patch was to convert edit to Unicode; I don't know why
> this line was removed. Check also for ROUND_TO_GROW.
>
> Vincent




More information about the wine-devel mailing list