diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 92dbab4742b..7c1fe7ffaac 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 1037cec6c26..cd1f325a1fa 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)