From eb773e0dea25138c9fc197962b9c64d8ff025525 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 17 Apr 2013 12:56:38 +0100 Subject: [PATCH] riched20: Use PointFromCharContext now that we can specify logical ordering. --- dlls/riched20/editor.h | 1 - dlls/riched20/run.c | 13 ------------- dlls/riched20/wrap.c | 9 ++------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index d34fbd0fbbf..8c78447de59 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -150,7 +150,6 @@ ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_Cursor *cursor) DECL void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run) DECLSPEC_HIDDEN; SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx, int *pAscent, int *pDescent) DECLSPEC_HIDDEN; -SIZE ME_GetRunSize(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx) DECLSPEC_HIDDEN; void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor) DECLSPEC_HIDDEN; void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppPara, ME_DisplayItem **ppRun, int *pOfs) DECLSPEC_HIDDEN; int ME_CharOfsFromRunOfs(ME_TextEditor *editor, const ME_DisplayItem *pPara, const ME_DisplayItem *pRun, int nOfs) DECLSPEC_HIDDEN; diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index 4bb1c0b7857..8929fc536cb 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -622,19 +622,6 @@ SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, i } /****************************************************************************** - * ME_GetRunSize - * - * Finds width and height (but not ascent and descent) of a part of the run - * up to given character. - */ -SIZE ME_GetRunSize(ME_Context *c, const ME_Paragraph *para, - ME_Run *run, int nLen, int startx) -{ - int asc, desc; - return ME_GetRunSizeCommon(c, para, run, nLen, startx, &asc, &desc); -} - -/****************************************************************************** * ME_SetSelectionCharFormat * * Applies a style change, either to a current selection, or to insert cursor diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index ebb7b295896..52722dbf403 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -188,7 +188,6 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd) { /* Exclude space characters from run width. * Other whitespace or delimiters are not treated this way. */ - SIZE sz; int len = p->member.run.len; WCHAR *text = get_text( &p->member.run, len - 1 ); @@ -199,13 +198,9 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd) if (len) { if (len == p->member.run.len) - { width += p->member.run.nWidth; - } else { - sz = ME_GetRunSize(wc->context, ¶->member.para, - &p->member.run, len, p->member.run.pt.x); - width += sz.cx; - } + else + width += ME_PointFromCharContext( wc->context, &p->member.run, len, FALSE ); } bSkippingSpaces = !len; } else if (!(p->member.run.nFlags & MERF_ENDPARA)) -- 2.11.4.GIT