[2/5] richedit: Got rid of useless function ME_VPosToPos.

Dylan Smith dylan.ah.smith at gmail.com
Sat Feb 7 12:21:10 CST 2009


The function was just returning the second parameter.  It had some
commented out code that indicated that previously backslashes weren't
included in the length.  Native wordpad doesn't handle backspaces in a
special way, so this must have been an internal representation that
complicated finding the position of characters.
---
 dlls/riched20/editor.h |    1 -
 dlls/riched20/run.c    |    3 +--
 dlls/riched20/string.c |   19 -------------------
 3 files changed, 1 insertions(+), 22 deletions(-)
-------------- next part --------------
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index 1312363..6cd7ad1 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -109,7 +109,6 @@ int ME_GetCharFwd(const ME_String *s, int nPos); /* get char starting from start
 int ME_GetCharBack(const ME_String *s, int nPos); /* get char starting from \0  */
 int ME_StrRelPos(const ME_String *s, int nVChar, int *pRelChars);
 int ME_StrRelPos2(const ME_String *s, int nVChar, int nRelChars);
-int ME_VPosToPos(ME_String *s, int nVPos);
 int ME_PosToVPos(const ME_String *s, int nPos);
 void ME_StrDeleteV(ME_String *s, int nVChar, int nChars);
 /* smart helpers for A<->W conversions, they reserve/free memory and call MultiByte<->WideChar functions */
diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c
index fae7603..265c0ab 100644
--- a/dlls/riched20/run.c
+++ b/dlls/riched20/run.c
@@ -310,8 +310,7 @@ ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_DisplayItem *item, i
   item2 = ME_MakeRun(run->style,
       ME_VSplitString(run->strText, nVChar), run->nFlags&MERF_SPLITMASK);
 
-  item2->member.run.nCharOfs = item->member.run.nCharOfs+
-    ME_VPosToPos(item->member.run.strText, nVChar);
+  item2->member.run.nCharOfs = item->member.run.nCharOfs + nVChar;
 
   run2 = &item2->member.run;
   ME_InsertBefore(item->next, item2);
diff --git a/dlls/riched20/string.c b/dlls/riched20/string.c
index 0bd751c..fe4c1a4 100644
--- a/dlls/riched20/string.c
+++ b/dlls/riched20/string.c
@@ -206,25 +206,6 @@ int ME_StrRelPos2(const ME_String *s, int nVChar, int nRelChars)
   return ME_StrRelPos(s, nVChar, &nRelChars);
 }
 
-int ME_VPosToPos(ME_String *s, int nVPos)
-{
-  return nVPos;
-  /*
-  int i = 0, len = 0;
-  if (!nVPos)
-    return 0;
-  while (i < s->nLen)
-  {
-    if (i == nVPos)
-      return len;
-    if (s->szData[i]=='\\') i++;
-    i++;
-    len++;
-  }
-  return len;
-  */
-}
-
 int ME_PosToVPos(const ME_String *s, int nPos)
 {
   if (!nPos)


More information about the wine-patches mailing list