Fixed EOL detection in ME_RunOfsFromCharOfs in 1.0 emulation mode

(necessary for a non-workaround version of EM_POSFROMCHAR).
This commit is contained in:
Krzysztof Foltman 2005-10-10 11:18:29 +00:00 committed by Alexandre Julliard
parent b82d94e4f1
commit 24a0f15b29
1 changed files with 5 additions and 1 deletions

View File

@ -145,6 +145,7 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **
if (nCharOfs < pPara->member.para.next_para->member.para.nCharOfs)
{
int eollen = 1;
*ppRun = ME_FindItemFwd(pPara, diRun);
assert(*ppRun);
while (!((*ppRun)->member.run.nFlags & MERF_ENDPARA))
@ -159,7 +160,10 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **
}
*ppRun = pNext;
}
if (nCharOfs == nParaOfs + (*ppRun)->member.run.nCharOfs) {
/* the handling of bEmulateVersion10 may be a source of many bugs, I'm afraid */
eollen = (editor->bEmulateVersion10 ? 2 : 1);
if (nCharOfs >= nParaOfs + (*ppRun)->member.run.nCharOfs &&
nCharOfs < nParaOfs + (*ppRun)->member.run.nCharOfs + eollen) {
*pOfs = 0;
return;
}