summaryrefslogtreecommitdiff
path: root/src/Fl_Text_Buffer.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2009-04-15 08:35:28 +0000
committerMatthias Melcher <fltk@matthiasm.com>2009-04-15 08:35:28 +0000
commitd3206f01ec18e61e8cd9c7e88b02a6313ab227fa (patch)
treeada81f236fbf8b967f5de8d45b39ad23cbd75d7f /src/Fl_Text_Buffer.cxx
parentb214cef3a8d2d9ecf0df7bef7d10dcdfbca4d9d3 (diff)
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
Diffstat (limited to 'src/Fl_Text_Buffer.cxx')
-rw-r--r--src/Fl_Text_Buffer.cxx27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx
index 391faf7f6..55f82abd8 100644
--- a/src/Fl_Text_Buffer.cxx
+++ b/src/Fl_Text_Buffer.cxx
@@ -83,27 +83,6 @@ static int undocut; // number of characters deleted there
static int undoinsert; // number of characters inserted
static int undoyankcut; // length of valid contents of buffer, even if undocut=0
-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;
-}
-
static void undobuffersize(int n) {
if (n > undobufferlength) {
if (undobuffer) {
@@ -991,7 +970,7 @@ int Fl_Text_Buffer::expand_character(int pos, int indent, char *outStr) {
mTabDist, mNullSubsChar);
if (ret > 1 && (c & 0x80)) {
int i;
- i = utf_len(c);
+ i = fl_utf8len(c);
while (i > 1) {
i--;
pos++;
@@ -1040,7 +1019,7 @@ int Fl_Text_Buffer::expand_character(char c, int indent, char *outStr, int tabDi
return 0;
} else if (c & 0x80) {
*outStr = c;
- return utf_len(c);
+ return fl_utf8len(c);
}
/* Otherwise, just return the character */
@@ -1068,7 +1047,7 @@ int Fl_Text_Buffer::character_width(char c, int indent, int tabDist, char nullSu
else if ((c & 0x80) && !(c & 0x40))
return 0;
else if (c & 0x80) {
- return utf_len(c);
+ return fl_utf8len(c);
}
return 1;
}