[2/2] richedit: Fixed centering and right align with word wrap disabled. (Fixes Bug 15352)

Dylan Smith dylan.ah.smith at gmail.com
Fri Oct 10 16:50:44 CDT 2008

Previously the centering and right alignment was done using based on an
available width which was set to the largest possible integer when word
wrapping is disabled.  This caused centered and right aligned text to be
drawn with an extremely large x value when word wrap was disabled.

This patch fixes the issue by calculating the same available width for
word wrap and without word wrap, then using a seperate variable to
indicating whether the line can wrap.  This allows the non-wrapped text
to be aligned to the visible window when scrolled to the left.  If the
text is larger than this smaller available width, then the text will
appear left aligned.

This behaviour is consistent with native msftedit.dll, but not
completely consistent with riched20.dll which left aligns centered or
right aligned text when word wrap is disabled using EM_SETTARGETDEVICE.
This should be acceptable since riched20.dll already conforms to
 dlls/riched20/editstr.h |    2 +-
 dlls/riched20/wrap.c    |   14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-richedit-Fixed-centering-and-right-align-with-wo.diff.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20081010/ed61c992/attachment-0001.txt 

More information about the wine-patches mailing list