Module: wine
Branch: master
Commit: a86d7bdcea5c038d63e9fd8798d79f1412ad0dc1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a86d7bdcea5c038d63e9fd879…
Author: Eric Pouech <eric.pouech(a)orange.fr>
Date: Sun Mar 16 21:47:08 2008 +0100
richedit: Pass left margin around when computing the size of a run, so that a tab will get a correct size.
---
dlls/riched20/caret.c | 7 +++++--
dlls/riched20/editor.h | 6 +++---
dlls/riched20/run.c | 26 ++++++++++++++------------
dlls/riched20/wrap.c | 23 +++++++++++++++--------
4 files changed, 37 insertions(+), 25 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=a86d7bdcea5c038d63e9f…
Module: wine
Branch: master
Commit: 4fb2dfc9f016d4ad5d1e476925eea12b3aceddfd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4fb2dfc9f016d4ad5d1e47692…
Author: Eric Pouech <eric.pouech(a)orange.fr>
Date: Sun Mar 16 21:46:36 2008 +0100
richedit: Added support for end of line inside paragraphs.
---
dlls/riched20/editstr.h | 14 ++++++++------
dlls/riched20/wrap.c | 7 +++++++
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h
index 92dbab4..7c1fe7f 100644
--- a/dlls/riched20/editstr.h
+++ b/dlls/riched20/editstr.h
@@ -92,11 +92,11 @@ typedef enum {
/******************************** run flags *************************/
#define MERF_STYLEFLAGS 0x0FFF
/* run contains non-text content, which has its own rules for wrapping, sizing etc */
-#define MERF_GRAPHICS 1
+#define MERF_GRAPHICS 0x001
/* run is a tab (or, in future, any kind of content whose size is dependent on run position) */
-#define MERF_TAB 2
+#define MERF_TAB 0x002
/* run is a cell boundary */
-#define MERF_CELL 4
+#define MERF_CELL 0x004
#define MERF_NONTEXT (MERF_GRAPHICS | MERF_TAB | MERF_CELL)
@@ -114,13 +114,15 @@ typedef enum {
#define MERF_CALCBYWRAP 0x0F0000
/* the "end of paragraph" run, contains 1 character */
#define MERF_ENDPARA 0x100000
+/* forcing the "end of row" run, contains 1 character */
+#define MERF_ENDROW 0x200000
/* run is hidden */
-#define MERF_HIDDEN 0x200000
+#define MERF_HIDDEN 0x400000
/* runs with any of these flags set cannot be joined */
-#define MERF_NOJOIN (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA)
+#define MERF_NOJOIN (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA|MERF_ENDROW)
/* runs that don't contain real text */
-#define MERF_NOTEXT (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA)
+#define MERF_NOTEXT (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA|MERF_ENDROW)
/* those flags are kept when the row is split */
#define MERF_SPLITMASK (~(0))
diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c
index 1037cec..cd1f325 100644
--- a/dlls/riched20/wrap.c
+++ b/dlls/riched20/wrap.c
@@ -282,6 +282,13 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p)
ME_InsertRowStart(wc, p);
return p;
}
+ /* simply end the current row and move on to next one */
+ if (run->nFlags & MERF_ENDROW)
+ {
+ p = p->next;
+ ME_InsertRowStart(wc, p);
+ return p;
+ }
/* we're not at the end of the row */
/* will current run fit? */
if (wc->pt.x + run->nWidth > wc->nAvailWidth)