diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2004-03-01 02:05:02 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2004-03-01 02:05:02 +0000 |
| commit | c5d30baf60c5b8acd81a6fa5dd5ea0b2392de10e (patch) | |
| tree | 2d2e8de45c1b2c2e8a08acb7fe41b85d2c911c4d /src/Fl_Text_Display.cxx | |
| parent | 2cbbe8180d5a986f69c94f22fc1fa966985b7527 (diff) | |
Documentation updates (STR #245, STR #250, STR #277, STR #281)
Fl_Preferences incorrectly created the preferences directory
before necessary (STR #247)
The WIN32 project files still defined the (obsolete) FL_STATIC
constant (STR #279)
Fl_Text_Display::buffer() did not support NULL values, making it
impossible to clean up text buffers from a subclass (STR #295)
Fl_Text_Display did not support a NULL unfinishedStyleCB
function (STR #241)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3219 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index aec0a1f4d..9ec01939d 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Display.cxx,v 1.12.2.48 2003/11/01 01:32:40 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.49 2004/03/01 02:05:02 easysw Exp $" // // Copyright 2001-2003 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -163,11 +163,13 @@ void Fl_Text_Display::buffer( Fl_Text_Buffer *buf ) { /* Add the buffer to the display, and attach a callback to the buffer for receiving modification information when the buffer contents change */ mBuffer = buf; - mBuffer->add_modify_callback( buffer_modified_cb, this ); - mBuffer->add_predelete_callback( buffer_predelete_cb, this ); + if (mBuffer) { + mBuffer->add_modify_callback( buffer_modified_cb, this ); + mBuffer->add_predelete_callback( buffer_predelete_cb, this ); - /* Update the display */ - buffer_modified_cb( 0, buf->length(), 0, 0, 0, this ); + /* Update the display */ + buffer_modified_cb( 0, buf->length(), 0, 0, 0, this ); + } /* Resize the widget to update the screen... */ resize(x(), y(), w(), h()); @@ -1745,7 +1747,7 @@ int Fl_Text_Display::position_style( int lineStartPos, style = FILL_MASK; else if ( styleBuf != NULL ) { style = ( unsigned char ) styleBuf->character( pos ); - if (style == mUnfinishedStyle) { + if (style == mUnfinishedStyle && mUnfinishedHighlightCB) { /* encountered "unfinished" style, trigger parsing */ (mUnfinishedHighlightCB)( pos, mHighlightCBArg); style = (unsigned char) styleBuf->character( pos); @@ -2701,7 +2703,7 @@ int Fl_Text_Display::measure_proportional_character(char c, int colNum, int pos) style = 0; } else { style = (unsigned char)styleBuf->character(pos); - if (style == mUnfinishedStyle) { + if (style == mUnfinishedStyle && mUnfinishedHighlightCB) { /* encountered "unfinished" style, trigger parsing */ (mUnfinishedHighlightCB)(pos, mHighlightCBArg); style = (unsigned char)styleBuf->character(pos); @@ -3059,5 +3061,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.48 2003/11/01 01:32:40 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.49 2004/03/01 02:05:02 easysw Exp $". // |
