summaryrefslogtreecommitdiff
path: root/FL/Fl_Text_Buffer.H
diff options
context:
space:
mode:
authorengelsman <engelsman>2010-04-18 14:33:33 +0000
committerengelsman <engelsman>2010-04-18 14:33:33 +0000
commit9545e033bbce1283d33325eb8710773adcffd52e (patch)
tree83a6382eb66510bfb9c13fc9828162ecdcd29637 /FL/Fl_Text_Buffer.H
parent1cd104557200738017190ed273ac3cf83ced1a30 (diff)
Fl_Text_Buffer/Display fixes for UTF-8 / STR-2158 (part 1)
fixes to handle incorrect counting of UTF-8 characters by checking for complete UTF-8 encodings in char* rather than char by char. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7527 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Text_Buffer.H')
-rw-r--r--FL/Fl_Text_Buffer.H25
1 files changed, 13 insertions, 12 deletions
diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H
index c23a4a4e7..d74582deb 100644
--- a/FL/Fl_Text_Buffer.H
+++ b/FL/Fl_Text_Buffer.H
@@ -248,6 +248,18 @@ public:
*/
unsigned int character(int pos) const;
+ /**
+ Convert a byte offset in buffer into a memory address.
+ */
+ const char *address(int pos) const
+ { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; }
+
+ /**
+ Convert a byte offset in buffer into a memory address.
+ */
+ char *address(int pos)
+ { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; }
+
/**
Returns the text from the given rectangle. When you are done
with the text, free it using the free() function.
@@ -681,6 +693,7 @@ public:
\return number of byte in substitution
*/
static int character_width(const char *src, int indent, int tabDist);
+ static int character_width(const char c, int indent, int tabDist);
/**
Count the number of displayed characters between buffer position
@@ -934,18 +947,6 @@ protected:
*/
void update_selections(int pos, int nDeleted, int nInserted);
- /**
- Convert a byte offset in buffer into a memory address.
- */
- const char *address(int pos) const
- { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; }
-
- /**
- Convert a byte offset in buffer into a memory address.
- */
- char *address(int pos)
- { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; }
-
Fl_Text_Selection mPrimary; /**< highlighted areas */
Fl_Text_Selection mSecondary; /**< highlighted areas */
Fl_Text_Selection mHighlight; /**< highlighted areas */