[2/2] richedit: Avoid redundant calls to ME_CalcRunExtent.
Dylan Smith
dylan.ah.smith at gmail.com
Thu Jul 29 13:07:50 CDT 2010
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;
}
--
1.7.0.4
More information about the wine-patches
mailing list