FW: Edit Paste operation does not behave same as MS Windows

Krishna Murthy Krishna.Murthy at guptaworldwide.com
Thu May 27 20:31:52 CDT 2004


This means it is sufficient to return FALSE in EDIT_MakeFit if the honor
limit is not set and size exceeds the buffer limit? 

static BOOL EDIT_MakeFit(EDITSTATE *es, UINT size, BOOL honor_limit)
{
	HLOCAL hNew32W;

	if ((!honor_limit) && (es->buffer_limit > 0) && (size >
es->buffer_limit)) {
		EDIT_NOTIFY_PARENT(es, EN_MAXTEXT, "EN_MAXTEXT");
		return FALSE;
	}
... 
}

I will verify with this change and if works in all condition, will submit
the patch.
Thanks for your help,
Krishna


-----Original Message-----
From: Alexandre Julliard [mailto:julliard at winehq.org] 
Sent: Thursday, May 27, 2004 5:12 PM
To: Krishna Murthy
Cc: wine-devel at winehq.org
Subject: Re: FW: Edit Paste operation does not behave same as MS Windows

Krishna Murthy <Krishna.Murthy at guptaworldwide.com> writes:

> Actually the logic truncates the data which exceeded the buffer. If 
> the honor limit is set and the size exceeded, the EDIT_MakeFit will return
TRUE.
> The following code after the EDIT_MakeFit will try to take limit to 
> the buffer size.
>
> +	/* Only replace or insert that many characters that can fit into the
> +	edit control. Do this only if honor_limit is TRUE */
> +	if(honor_limit && strl > es->buffer_limit)
> +		strl = es->buffer_limit - (tl - (e-s));

That only takes into account the limit, not the current buffer size. It's
very possible that you need to grow the buffer even when the limit is not
exceeded. Also you only check the length of the inserted string against the
limit, you should check the total resulting length instead.

--
Alexandre Julliard
julliard at winehq.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-devel/attachments/20040527/9c49472b/attachment.html


More information about the wine-devel mailing list