richedit: Avoid redundant calls to ME_CalcRunExtent.

ME_SplitRun is only called by wrapping code. In all but one call the
returned second half of the split run will be returned, get passed back
to ME_WrapHandleRun, then ME_CalcRunExtent will be called at the start of
ME_WrapHandleRun through ME_WrapSizeRun.
This commit is contained in:
Dylan Smith 2010-07-29 14:07:50 -04:00 committed by Alexandre Julliard
parent 8b8e4f89b2
commit c0ee555e8f
2 changed files with 3 additions and 1 deletions

View File

@ -273,7 +273,6 @@ ME_DisplayItem *ME_SplitRun(ME_WrapContext *wc, ME_DisplayItem *item, int nVChar
run2 = &cursor.pRun->member.run;
ME_CalcRunExtent(wc->context, para, wc->nRow ? wc->nLeftMargin : wc->nFirstMargin, run);
ME_CalcRunExtent(wc->context, para, wc->nRow ? wc->nLeftMargin : wc->nFirstMargin, run2);
run2->pt.x = run->pt.x+run->nWidth;
run2->pt.y = run->pt.y;

View File

@ -361,6 +361,9 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p)
if (black) {
wc->bOverflown = FALSE;
pp = ME_SplitRun(wc, p, black);
ME_CalcRunExtent(wc->context, &wc->pPara->member.para,
wc->nRow ? wc->nLeftMargin : wc->nFirstMargin,
&pp->member.run);
ME_InsertRowStart(wc, pp);
return pp;
}