G'day all, Found the cause of my problems with Delphi programs and MaskEdit fields.
In an edit component which has a length set with EM_LIMITTEXT, any text added with EM_REPLACESTR was not respecting the text length value.
This patch fixes it for me, can I have some feeback from someone in the know please before I submit it to win-patches.. Watch the wrapping.. Mozilla is set to desecrate patches :p)
Index: controls/edit.c =================================================================== RCS file: /home/wine/wine/controls/edit.c,v retrieving revision 1.110 diff -u -r1.110 edit.c --- controls/edit.c 27 Feb 2003 21:09:46 -0000 1.110 +++ controls/edit.c 6 Apr 2003 16:04:41 -0000 @@ -2945,6 +2945,10 @@ } else EDIT_EM_EmptyUndoBuffer(es);
+ /* respect buffer_limit */ + if ((s+strl) > es->buffer_limit) + strl = (es->buffer_limit-s); + /* now insert */ tl = strlenW(es->text); TRACE("inserting stuff (tl %d, strl %d, selstart %d ('%s'), text '%s')\n", tl, strl, s, debugstr_w(es->text + s), debugstr_w(es->text));
Looks OK to me, just send it to wine-patches in the form of an attachment and the wrapping shouldn't be a problem. Don't put the patch inline as well... (ie there should only be one copy in the email)
Umm, oh, and a changelog entry :)
On Mon, 2003-04-07 at 04:02, Brad Campbell wrote:
G'day all, Found the cause of my problems with Delphi programs and MaskEdit fields.
In an edit component which has a length set with EM_LIMITTEXT, any text added with EM_REPLACESTR was not respecting the text length value.
This patch fixes it for me, can I have some feeback from someone in the know please before I submit it to win-patches.. Watch the wrapping.. Mozilla is set to desecrate patches :p)
Index: controls/edit.c
RCS file: /home/wine/wine/controls/edit.c,v retrieving revision 1.110 diff -u -r1.110 edit.c --- controls/edit.c 27 Feb 2003 21:09:46 -0000 1.110 +++ controls/edit.c 6 Apr 2003 16:04:41 -0000 @@ -2945,6 +2945,10 @@ } else EDIT_EM_EmptyUndoBuffer(es);
/* respect buffer_limit */
if ((s+strl) > es->buffer_limit)
strl = (es->buffer_limit-s);
/* now insert */ tl = strlenW(es->text); TRACE("inserting stuff (tl %d, strl %d, selstart %d
('%s'), text '%s')\n", tl, strl, s, debugstr_w(es->text + s), debugstr_w(es->text));