<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: FW: Edit Paste operation does not behave same as MS Windows</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>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.</FONT></P>

<P><FONT SIZE=2>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Only replace or insert that many characters that can fit into the</FONT>
<BR><FONT SIZE=2>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edit control. Do this only if honor_limit is TRUE */</FONT>
<BR><FONT SIZE=2>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(honor_limit &amp;&amp; strl &gt; es-&gt;buffer_limit)</FONT>
<BR><FONT SIZE=2>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strl = es-&gt;buffer_limit - (tl - (e-s));</FONT>
<BR><FONT SIZE=2>&nbsp;</FONT>
<BR><FONT SIZE=2>Krishna</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Alexandre Julliard [<A HREF="mailto:julliard@winehq.org">mailto:julliard@winehq.org</A>] </FONT>
<BR><FONT SIZE=2>Sent: Thursday, May 27, 2004 2:30 PM</FONT>
<BR><FONT SIZE=2>To: Krishna Murthy</FONT>
<BR><FONT SIZE=2>Cc: wine-devel@winehq.org</FONT>
<BR><FONT SIZE=2>Subject: Re: FW: Edit Paste operation does not behave same as MS Windows</FONT>
</P>

<P><FONT SIZE=2>Krishna Murthy &lt;Krishna.Murthy@guptaworldwide.com&gt; writes:</FONT>
</P>

<P><FONT SIZE=2>&gt; - Change log Entry:</FONT>
<BR><FONT SIZE=2>&gt; EDIT_MakeFit should return TRUE when the honor_limit is set and paste </FONT>
<BR><FONT SIZE=2>&gt; buffer exceeds the limit. Also EDIT_EM_ReplaceSel should compute size </FONT>
<BR><FONT SIZE=2>&gt; which could fit in the edit control by truncating the extra characters </FONT>
<BR><FONT SIZE=2>&gt; to behave similar to MS Windows paste operation.</FONT>
</P>

<P><FONT SIZE=2>You are bypassing the reallocation of the buffer when the limit is exceeded, but still adding the data to the buffer. I don't think this will work right.</FONT></P>

<P><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>Alexandre Julliard</FONT>
<BR><FONT SIZE=2>julliard@winehq.org</FONT>
</P>

</BODY>
</HTML>