RICHED20: 1.0 emulation off-by-ones - split - part 3/3: ME_RunOfsFromCharOfs

Krzysztof Foltman wdev at foltman.com
Sat Oct 8 11:53:12 CDT 2005


ChangeLog:
    * Fixed EOL detection in ME_RunOfsFromCharOfs in 1.0 emulation mode 
(necessary for a non-workaround version of EM_POSFROMCHAR)

Krzysztof


-------------- next part --------------
Index: run.c
===================================================================
RCS file: /home/wine/wine/dlls/riched20/run.c,v
retrieving revision 1.12
diff -u -r1.12 run.c
--- run.c	22 Jul 2005 18:27:26 -0000	1.12
+++ run.c	7 Oct 2005 15:21:06 -0000
@@ -143,6 +145,7 @@
 
     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))
@@ -157,7 +160,10 @@
         }
         *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;
       }


More information about the wine-patches mailing list