From 822ae486cdbfc9fb6ffb2df9870cb471470c2f8f Mon Sep 17 00:00:00 2001 From: Krzysztof Foltman Date: Mon, 10 Oct 2005 18:00:52 +0000 Subject: [PATCH] The previous implementation was a workaround for off-by-one bug in ME_RunOfsFromCharOfs, this one relies on correct behavior of that function introduced by the previous patch. --- dlls/riched20/editor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 180fda9391b..c8de84d4ff1 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1724,10 +1724,15 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP nCharOfs = lParam; nLength = ME_GetTextLength(editor); - if (nCharOfs < nLength-1) { + if (nCharOfs < nLength) { ME_RunOfsFromCharOfs(editor, nCharOfs, &pRun, &nOffset); + assert(pRun->type == diRun); pt.y = pRun->member.run.pt.y; pt.x = pRun->member.run.pt.x + ME_PointFromChar(editor, &pRun->member.run, nOffset); + pt.y += ME_GetParagraph(pRun)->member.para.nYPos; + } else { + pt.x = 0; + pt.y = editor->pBuffer->pLast->member.para.nYPos; } pt.y += ME_GetParagraph(pRun)->member.para.nYPos; if (wParam >= 0x40000) {