Module: wine Branch: master Commit: c0ee555e8f2684317ecf5baddd87cd966d59cbbe URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0ee555e8f2684317ecf5baddd...
Author: Dylan Smith dylan.ah.smith@gmail.com Date: Thu Jul 29 14:07:50 2010 -0400
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.
---
dlls/riched20/run.c | 1 - dlls/riched20/wrap.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index 09cad59..3682d13 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -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; diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index a7c7fd3..2ec67ab 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -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; }