Commit 791d000f authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

riched20: Simplify ME_PrepareParagraphForWrapping.

parent f3a3ce8a
...@@ -481,38 +481,28 @@ static int ME_GetParaLineSpace(ME_Context* c, ME_Paragraph* para) ...@@ -481,38 +481,28 @@ static int ME_GetParaLineSpace(ME_Context* c, ME_Paragraph* para)
} }
static void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp) { static void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp) {
ME_DisplayItem *p, *pRow; ME_DisplayItem *p;
tp->member.para.nWidth = 0; tp->member.para.nWidth = 0;
/* remove all items that will be reinserted by paragraph wrapper anyway */ /* remove row start items as they will be reinserted by the
* paragraph wrapper anyway */
tp->member.para.nRows = 0; tp->member.para.nRows = 0;
for (p = tp->next; p!=tp->member.para.next_para; p = p->next) { for (p = tp->next; p != tp->member.para.next_para; p = p->next) {
switch(p->type) { if (p->type == diStartRow) {
case diStartRow: ME_DisplayItem *pRow = p;
pRow = p; p = p->prev;
p = p->prev; ME_Remove(pRow);
ME_Remove(pRow); ME_DestroyDisplayItem(pRow);
ME_DestroyDisplayItem(pRow);
break;
default:
break;
} }
} }
/* join runs that can be joined, set up flags */ /* join runs that can be joined */
for (p = tp->next; p!=tp->member.para.next_para; p = p->next) { for (p = tp->next; p != tp->member.para.next_para; p = p->next) {
switch(p->type) { assert(p->type != diStartRow); /* should have been deleted above */
case diStartRow: assert(0); break; /* should have deleted it */ if (p->type == diRun) {
case diRun: while (p->next->type == diRun && /* FIXME */
while (p->next->type == diRun) { /* FIXME */ ME_CanJoinRuns(&p->member.run, &p->next->member.run)) {
if (ME_CanJoinRuns(&p->member.run, &p->next->member.run)) { ME_JoinRuns(c->editor, p);
ME_JoinRuns(c->editor, p); }
}
else
break;
}
break;
default:
break;
} }
} }
} }
......
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