From d3206f01ec18e61e8cd9c7e88b02a6313ab227fa Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 15 Apr 2009 08:35:28 +0000 Subject: More Fl_Input keyboard fixes / OS X transparency for RGBA data / some utf8 reorganisation git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Editor.cxx | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/Fl_Text_Editor.cxx') diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index d70626b75..bd56eeb6c 100644 --- a/src/Fl_Text_Editor.cxx +++ b/src/Fl_Text_Editor.cxx @@ -34,26 +34,6 @@ #include #include -static int utf_len(char c) -{ - if (!(c & 0x80)) return 1; - if (c & 0x40) { - if (c & 0x20) { - if (c & 0x10) { - if (c & 0x08) { - if (c & 0x04) { - return 6; - } - return 5; - } - return 4; - } - return 3; - } - return 2; - } - return 0; -} /* Keyboard Control Matrix @@ -268,7 +248,7 @@ int Fl_Text_Editor::kf_backspace(int, Fl_Text_Editor* e) { int l = 1; char c = e->buffer()->character(e->insert_position()); if (c & 0x80 && c & 0x40) { - l = utf_len(c); + l = fl_utf8len(c); } e->buffer()->select(e->insert_position(), e->insert_position()+l); } @@ -429,7 +409,7 @@ int Fl_Text_Editor::kf_delete(int, Fl_Text_Editor* e) { int l = 1; char c = e->buffer()->character(e->insert_position()); if (c & 0x80 && c & 0x40) { - l = utf_len(c); + l = fl_utf8len(c); } e->buffer()->select(e->insert_position(), e->insert_position()+l); } -- cgit v1.2.3