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.
This commit is contained in:
Krzysztof Foltman 2005-10-10 18:00:52 +00:00 committed by Alexandre Julliard
parent 9b748c8de2
commit 822ae486cd
1 changed files with 6 additions and 1 deletions

View File

@ -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) {