summaryrefslogtreecommitdiff
path: root/src/Fl_Text_Display.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-04-05 20:22:43 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-04-05 20:22:43 +0000
commitfca1c022e7affbd01087acea46b321f1648c3c9a (patch)
treeaa9156dad9991bf489bf02cd8b11b5b1f0d68385 /src/Fl_Text_Display.cxx
parentd5175c0b88db543be968ecc81d94453d0795bc90 (diff)
Holy Gucamole! NEdit was designed with 'C' style strings in mind. Until that is that someone had the great idea to allow <nul> as a valid character in the text editor. The developers jumped through quite some hoops to allow that without rewriting the core. Well, actually they did: they added a parameter to pretty much every internal call that conatined the null-replacement-character. Anyway, since we only handle 'C' strings, I remove all related code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7437 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
-rw-r--r--src/Fl_Text_Display.cxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index d5380c3c3..eb0598cdb 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -629,7 +629,7 @@ void Fl_Text_Display::overstrike(const char* text) {
startIndent = mBuffer->count_displayed_characters( lineStart, startPos );
indent = startIndent;
for ( c = text; *c != '\0'; c++ )
- indent += Fl_Text_Buffer::character_width( *c, indent, buf->tab_distance(), buf->null_substitution_character() );
+ indent += Fl_Text_Buffer::character_width( *c, indent, buf->tab_distance() );
endIndent = indent;
/* find which characters to remove, and if necessary generate additional
@@ -641,7 +641,7 @@ void Fl_Text_Display::overstrike(const char* text) {
ch = buf->character( p );
if ( ch == '\n' )
break;
- indent += Fl_Text_Buffer::character_width( ch, indent, buf->tab_distance(), buf->null_substitution_character() );
+ indent += Fl_Text_Buffer::character_width( ch, indent, buf->tab_distance() );
if ( indent == endIndent ) {
p++;
break;
@@ -724,7 +724,7 @@ int Fl_Text_Display::position_to_xy( int pos, int* X, int* Y ) const {
outIndex = 0;
for ( charIndex = 0; charIndex < lineLen && charIndex < pos - lineStartPos; charIndex++ ) {
charLen = Fl_Text_Buffer::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
- mBuffer->tab_distance(), mBuffer->null_substitution_character() );
+ mBuffer->tab_distance());
if (charLen > 1 && (lineStr[ charIndex ] & 0x80)) {
int i, ii = 0;;
i = fl_utf8len(lineStr[ charIndex ]);
@@ -1478,7 +1478,7 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip,
for ( charIndex = 0; ; charIndex++ ) {
charLen = charIndex >= lineLen ? 1 :
Fl_Text_Buffer::expand_character( lineStr[ charIndex ], outIndex,
- expandedChar, buf->tab_distance(), buf->null_substitution_character() );
+ expandedChar, buf->tab_distance());
if (charIndex < lineLen && charLen > 1 && (lineStr[ charIndex ] & 0x80)) {
int i, ii = 0;;
i = fl_utf8len(lineStr[ charIndex ]);
@@ -1516,7 +1516,7 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip,
for ( charIndex = startIndex; charIndex < rightCharIndex; charIndex++ ) {
charLen = charIndex >= lineLen ? 1 :
Fl_Text_Buffer::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
- buf->tab_distance(), buf->null_substitution_character() );
+ buf->tab_distance());
if (charIndex < lineLen && charLen > 1 && (lineStr[ charIndex ] & 0x80)) {
int i, ii = 0;;
i = fl_utf8len(lineStr[ charIndex ]);
@@ -1563,7 +1563,7 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip,
for ( charIndex = startIndex; charIndex < rightCharIndex; charIndex++ ) {
charLen = charIndex >= lineLen ? 1 :
Fl_Text_Buffer::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
- buf->tab_distance(), buf->null_substitution_character() );
+ buf->tab_distance());
if (charIndex < lineLen && charLen > 1 && (lineStr[ charIndex ] & 0x80)) {
int i, ii = 0;;
i = fl_utf8len(lineStr[ charIndex ]);
@@ -1923,7 +1923,7 @@ int Fl_Text_Display::xy_to_position( int X, int Y, int posType ) const {
outIndex = 0;
for ( charIndex = 0; charIndex < lineLen; charIndex++ ) {
charLen = Fl_Text_Buffer::expand_character( lineStr[ charIndex ], outIndex, expandedChar,
- mBuffer->tab_distance(), mBuffer->null_substitution_character() );
+ mBuffer->tab_distance());
if (charLen > 1 && (lineStr[ charIndex ] & 0x80)) {
int i, ii = 0;;
i = fl_utf8len(lineStr[ charIndex ]);
@@ -2676,7 +2676,6 @@ void Fl_Text_Display::wrapped_line_counter(Fl_Text_Buffer *buf, int startPos,
bool countPixels;
int nLines = 0, tabDist = buffer()->tab_distance();
unsigned char c;
- char nullSubsChar = buffer()->null_substitution_character();
/* If the font is fixed, or there's a wrap margin set, it's more efficient
to measure in columns, than to count pixels. Determine if we can count
@@ -2731,7 +2730,7 @@ void Fl_Text_Display::wrapped_line_counter(Fl_Text_Buffer *buf, int startPos,
colNum = 0;
width = 0;
} else {
- colNum += Fl_Text_Buffer::character_width(c, colNum, tabDist, nullSubsChar);
+ colNum += Fl_Text_Buffer::character_width(c, colNum, tabDist);
if (countPixels)
width += measure_proportional_character(c, colNum, p+styleBufOffset);
}
@@ -2761,7 +2760,7 @@ void Fl_Text_Display::wrapped_line_counter(Fl_Text_Buffer *buf, int startPos,
}
if (!foundBreak) { /* no whitespace, just break at margin */
newLineStart = max(p, lineStart+1);
- colNum = Fl_Text_Buffer::character_width(c, colNum, tabDist, nullSubsChar);
+ colNum = Fl_Text_Buffer::character_width(c, colNum, tabDist);
if (countPixels)
width = measure_proportional_character(c, colNum, p+styleBufOffset);
}
@@ -2813,8 +2812,7 @@ int Fl_Text_Display::measure_proportional_character(char c, int colNum, int pos)
char expChar[ FL_TEXT_MAX_EXP_CHAR_LEN ];
Fl_Text_Buffer *styleBuf = mStyleBuffer;
- charLen = Fl_Text_Buffer::expand_character(c, colNum, expChar,
- buffer()->tab_distance(), buffer()->null_substitution_character());
+ charLen = Fl_Text_Buffer::expand_character(c, colNum, expChar, buffer()->tab_distance());
if (styleBuf == 0) {
style = 0;
} else {