richedit: Added support for end of line inside paragraphs.

This commit is contained in:
Eric Pouech 2008-03-16 21:46:36 +01:00 committed by Alexandre Julliard
parent 513fcfe48f
commit 4fb2dfc9f0
2 changed files with 15 additions and 6 deletions

View File

@ -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))

View File

@ -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)