Dylan Smith : richedit: Removed unused ME_AutoURLDetect function.

Alexandre Julliard julliard at winehq.org
Mon Nov 17 09:14:23 CST 2008


Module: wine
Branch: master
Commit: 1e8df4351dd6854e06bda8438161d570fc3021c9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1e8df4351dd6854e06bda8438161d570fc3021c9

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Mon Nov 17 03:46:29 2008 -0500

richedit: Removed unused ME_AutoURLDetect function.

---

 dlls/riched20/editor.c |   89 ------------------------------------------------
 dlls/riched20/editor.h |    1 -
 2 files changed, 0 insertions(+), 90 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 6ee5fae..33310a1 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -4432,95 +4432,6 @@ LRESULT WINAPI REExtendedRegisterClass(void)
   return result;
 }
 
-int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) 
-{
-  struct prefix_s {
-    const char *text;
-    int length;
-  } prefixes[12] = {
-    {"http:", 5},
-    {"file:", 6},
-    {"mailto:", 8},
-    {"ftp:", 5},
-    {"https:", 7},
-    {"gopher:", 8},
-    {"nntp:", 6},
-    {"prospero:", 10},
-    {"telnet:", 8},
-    {"news:", 6},
-    {"wais:", 6},
-    {"www.", 5}
-  };
-  CHARRANGE ins_pt;
-  int curf_ef, link_ef, def_ef;
-  int cur_prefx, prefx_cnt;
-  int sel_min, sel_max;
-  int car_pos = 0;
-  int text_pos=-1;
-  int URLmin, URLmax = 0;
-  FINDTEXTA ft;
-  CHARFORMAT2W cur_format;
-  CHARFORMAT2W default_format;
-  CHARFORMAT2W link;
-  RichEditANSIWndProc(editor->hWnd, EM_EXGETSEL, (WPARAM) 0, (LPARAM) &ins_pt);
-  sel_min = ins_pt.cpMin;
-  sel_max = ins_pt.cpMax;
-  if (sel_min==sel_max) 
-    car_pos = sel_min;
-  if (sel_min!=sel_max)
-    car_pos = ME_GetTextLength(editor)+1;   
-  cur_format.cbSize = sizeof(cur_format);
-  default_format.cbSize = sizeof(default_format);
-  RichEditANSIWndProc(editor->hWnd, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM) &cur_format);
-  RichEditANSIWndProc(editor->hWnd, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM) &default_format);
-  link.cbSize = sizeof(link);
-  link.dwMask = CFM_LINK;
-  link.dwEffects = CFE_LINK;
-  curf_ef = cur_format.dwEffects & link.dwEffects;
-  def_ef = default_format.dwEffects & link.dwEffects;
-  link_ef = link.dwEffects & link.dwEffects;
-  if (curf_ef == link_ef) 
-  {
-    if( curChar == '\n' || curChar=='\r' || curChar==' ') 
-    {
-      ME_SetSelection(editor, car_pos, car_pos);
-      RichEditANSIWndProc(editor->hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &default_format);
-      text_pos=-1;
-      return 0;
-    }
-  }
-  if (curf_ef == def_ef)
-  {
-    cur_prefx = 0;
-    prefx_cnt = (sizeof(prefixes)/sizeof(struct prefix_s))-1;
-    while (cur_prefx<=prefx_cnt) 
-    {
-      if (text_pos == -1) 
-      {
-        ft.lpstrText = prefixes[cur_prefx].text;
-        URLmin=max(0,(car_pos-prefixes[cur_prefx].length));
-        URLmax=max(0, car_pos);
-        if ((car_pos == 0) && (ME_GetTextLength(editor) != 0))
-        {
-        URLmax = ME_GetTextLength(editor)+1;
-        }
-        ft.chrg.cpMin = URLmin;
-        ft.chrg.cpMax = URLmax;
-        text_pos=RichEditANSIWndProc(editor->hWnd, EM_FINDTEXT, FR_DOWN, (LPARAM)&ft);   
-        cur_prefx++;
-      }
-      if (text_pos != -1) 
-      {
-        ME_SetCharFormat(editor, text_pos, (URLmax-text_pos), &link);
-        ME_RewrapRepaint(editor);
-        break;
-      }
-    }
-  }
-  return 0;
-}
-
-
 static BOOL isurlspecial(WCHAR c)
 {
   static const WCHAR special_chars[] = {'.','/','%','@','*','|','\\','+','#',0};
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index d786e0a..b3918bf 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -280,7 +280,6 @@ void ME_RTFParAttrHook(struct _RTF_Info *info);
 void ME_RTFTblAttrHook(struct _RTF_Info *info);
 void ME_RTFSpecialCharHook(struct _RTF_Info *info);
 void ME_StreamInFill(ME_InStream *stream);
-int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar);
 extern int me_debug;
 extern void DoWrap(ME_TextEditor *editor);
 extern BOOL ME_FindNextURLCandidate(ME_TextEditor *editor, int sel_min, int sel_max,




More information about the wine-cvs mailing list