Dylan Smith : richedit: Count graphics towards line width.

Alexandre Julliard julliard at winehq.org
Wed Mar 11 10:04:24 CDT 2009


Module: wine
Branch: master
Commit: 1a2ccfe9c79973f499e38321bd5267a2cddee59b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1a2ccfe9c79973f499e38321bd5267a2cddee59b

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Tue Mar 10 19:01:09 2009 -0400

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.

---

 dlls/riched20/wrap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c
index 54c90eb..579f33a 100644
--- a/dlls/riched20/wrap.c
+++ b/dlls/riched20/wrap.c
@@ -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)
           {




More information about the wine-cvs mailing list