http://bugs.winehq.org/show_bug.cgi?id=1486
------- Additional Comments From r.kessel(a)metrodata.de 2004-01-04 06:08 -------
I found a workaround for my own Delphi application. It's a bit ugly, but works fine.
If you hide the complete menu before changing it and display it when it is
updated it will be workable afterwards. Hide the menu by setting the menu
property of the form to nil and restore the pointer later. Maybe we could even
find the problem by looking at the difference between hide and restore and a
rebuild.
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.org/show_bug.cgi?id=2139
Summary: Edit control bug in EDIT_EM_GetLine (multiple lines) for
lines with zero length
Product: Wine
Version: 20040309
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: major
Priority: P2
Component: wine-winelib
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: r.kessel(a)metrodata.de
The EM_GETLINE message handler has a bug in handling multiple line controls when
they contain lines with zero length.
Problem:
Instead of returning an empty line, EDIT_EM_GetLine does nothing and returns the
buffer length as the character count.
Most likely the problem is in the following section:
{
LPSTR dst = (LPSTR)lParam;
INT ret;
ret = WideCharToMultiByte(CP_ACP, 0, src, line_len, dst, dst_len, NULL, NULL);
if(!ret) /* Insufficient buffer size */
return dst_len;
if(ret < dst_len) /* Append 0 if enough space */
dst[ret] = 0;
return ret;
}
In case that line_len is zero WideCharToMultiByte returns correctly zero, but
this is treated as an insufficient buffer size.
Possible solution:
{
LPSTR dst = (LPSTR)lParam;
INT ret;
if(line_len)
{
ret = WideCharToMultiByte(CP_ACP, 0, src, line_len, dst, dst_len, NULL,
NULL);
if(!ret) /* Insufficient buffer size */
return dst_len;
}
else
{
ret = 0;
}
if(ret < dst_len) /* Append 0 if enough space */
dst[ret] = 0;
return ret;
}
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.