Dylan Smith : richedit: Got rid of useless function ME_VPosToPos.
Alexandre Julliard
julliard at winehq.org
Mon Feb 9 10:29:29 CST 2009
Module: wine
Branch: master
Commit: f148d82093fe44d8e405ad4ab9704b185fa3c2ce
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f148d82093fe44d8e405ad4ab9704b185fa3c2ce
Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date: Sat Feb 7 13:21:10 2009 -0500
richedit: Got rid of useless function ME_VPosToPos.
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(-)
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index 90dcd2a..8064450 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -107,7 +107,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 d8852fb..f534d7e 100644
--- a/dlls/riched20/string.c
+++ b/dlls/riched20/string.c
@@ -184,25 +184,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-cvs
mailing list