Commit 822ae486 authored by Krzysztof Foltman's avatar Krzysztof Foltman Committed by Alexandre Julliard

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.
parent 9b748c8d
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment