Commit 24a0f15b authored by Krzysztof Foltman's avatar Krzysztof Foltman Committed by Alexandre Julliard

Fixed EOL detection in ME_RunOfsFromCharOfs in 1.0 emulation mode

(necessary for a non-workaround version of EM_POSFROMCHAR).
parent b82d94e4
...@@ -145,6 +145,7 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem ** ...@@ -145,6 +145,7 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **
if (nCharOfs < pPara->member.para.next_para->member.para.nCharOfs) if (nCharOfs < pPara->member.para.next_para->member.para.nCharOfs)
{ {
int eollen = 1;
*ppRun = ME_FindItemFwd(pPara, diRun); *ppRun = ME_FindItemFwd(pPara, diRun);
assert(*ppRun); assert(*ppRun);
while (!((*ppRun)->member.run.nFlags & MERF_ENDPARA)) while (!((*ppRun)->member.run.nFlags & MERF_ENDPARA))
...@@ -159,7 +160,10 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem ** ...@@ -159,7 +160,10 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **
} }
*ppRun = pNext; *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; *pOfs = 0;
return; return;
} }
......
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