riched20: do not return incorrect values from ME_CharFromPoint[Cursor]

Thomas Faber thfabba at gmx.de
Sat Oct 22 15:45:42 CDT 2011


This is the correct fix for the problem I previously described [1].
ME_CharFromPoint is called with cx < 0 if the richedit control has zero or
otherwise very small width.
Windows's version of GetTextExtentExPointW, which is called in that function,
returns a value of 1 in this case (Wine's does not, which would appear to be
a bug), leading to the "i<len" assertion failure if there is no text in the
control.
The patch fixes riched20 to correctly handle either behavior by
adding a fast path for cx <= 0 (the function obviously needs to return 0 in
the cx == 0 case too, so it can skip the calculation).

[1] http://www.winehq.org/pipermail/wine-patches/2011-October/107895.html

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0006-riched20-do-not-return-incorrect-values-from-ME_Char.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20111022/8e48d7b7/attachment.ksh>


More information about the wine-patches mailing list