Commit d132009a authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Maintain a ptr to the end-of-paragraph run.

parent 1abe4cc7
...@@ -201,6 +201,7 @@ typedef struct tagME_Paragraph ...@@ -201,6 +201,7 @@ typedef struct tagME_Paragraph
POINT pt; POINT pt;
int nHeight, nWidth; int nHeight, nWidth;
int nRows; int nRows;
ME_Run *eop_run; /* ptr to the end-of-para run */
struct tagME_DisplayItem *prev_para, *next_para; struct tagME_DisplayItem *prev_para, *next_para;
} ME_Paragraph; } ME_Paragraph;
......
...@@ -81,6 +81,8 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) ...@@ -81,6 +81,8 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
run->member.run.len = eol_len; run->member.run.len = eol_len;
run->member.run.para = &para->member.para; run->member.run.para = &para->member.para;
para->member.para.eop_run = &run->member.run;
ME_InsertBefore(text->pLast, para); ME_InsertBefore(text->pLast, para);
ME_InsertBefore(text->pLast, run); ME_InsertBefore(text->pLast, run);
para->member.para.prev_para = text->pFirst; para->member.para.prev_para = text->pFirst;
...@@ -272,6 +274,10 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ...@@ -272,6 +274,10 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run,
ME_InsertBefore(run, new_para); ME_InsertBefore(run, new_para);
ME_InsertBefore(new_para, end_run); ME_InsertBefore(new_para, end_run);
/* Fix up the paras' eop_run ptrs */
new_para->member.para.eop_run = run_para->member.para.eop_run;
run_para->member.para.eop_run = &end_run->member.run;
if (!editor->bEmulateVersion10) { /* v4.1 */ if (!editor->bEmulateVersion10) { /* v4.1 */
if (paraFlags & (MEPF_ROWSTART|MEPF_CELL)) if (paraFlags & (MEPF_ROWSTART|MEPF_CELL))
{ {
...@@ -429,6 +435,9 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp, ...@@ -429,6 +435,9 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp,
pTmp->member.run.para = &tp->member.para; pTmp->member.run.para = &tp->member.para;
} while(1); } while(1);
/* Fix up the para's eop_run ptr */
tp->member.para.eop_run = pNext->member.para.eop_run;
ME_Remove(pRun); ME_Remove(pRun);
ME_DestroyDisplayItem(pRun); ME_DestroyDisplayItem(pRun);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment