richedit: Count graphics towards line width.

Images that are inserted into richedit controls store a space for the
text, since that is the character returned when getting the plain text
from the control.

When calculating the width of a line, the space character is skipped,
but images should not be skipped.  This can be seen by inserting an
image into wordpad on a line by it's own, then centering the line.  The
image will start from the center rather than being centered in the
control.
This commit is contained in:
Dylan Smith 2009-03-10 19:01:09 -04:00 committed by Alexandre Julliard
parent 782ea74acc
commit 1a2ccfe9c7
1 changed files with 2 additions and 1 deletions

View File

@ -115,7 +115,8 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
WCHAR *text = p->member.run.strText->szData + len - 1;
assert (len);
while (len && *(text--) == ' ')
if (~p->member.run.nFlags & MERF_GRAPHICS)
while (len && *(text--) == ' ')
len--;
if (len)
{