diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Preferences.cxx | 9 | ||||
| -rw-r--r-- | src/Fl_Text_Display.cxx | 18 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 54cbbb804..c6fa4b982 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Preferences.cxx,v 1.1.2.25 2003/05/04 21:45:46 easysw Exp $" +// "$Id: Fl_Preferences.cxx,v 1.1.2.26 2004/03/01 02:05:01 easysw Exp $" // // Preferences methods for the Fast Light Tool Kit (FLTK). // @@ -671,8 +671,6 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char "%s/%s.prefs", vendor, application); #endif - makePathForFile(filename); - prefs_ = prefs; filename_ = strdup(filename); vendor_ = strdup(vendor); @@ -689,8 +687,6 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, const char *path, con snprintf(filename, sizeof(filename), "%s/%s.prefs", path, application); - makePathForFile(filename); - prefs_ = prefs; filename_ = strdup(filename); vendor_ = strdup(vendor); @@ -758,6 +754,7 @@ int Fl_Preferences::RootNode::read() // write the group tree and all entry leafs int Fl_Preferences::RootNode::write() { + makePathForFile(filename_); FILE *f = fopen( filename_, "wb" ); if ( !f ) return 1; fprintf( f, "; FLTK preferences file format 1.0\n" ); @@ -1116,5 +1113,5 @@ char Fl_Preferences::Node::remove() // -// End of "$Id: Fl_Preferences.cxx,v 1.1.2.25 2003/05/04 21:45:46 easysw Exp $". +// End of "$Id: Fl_Preferences.cxx,v 1.1.2.26 2004/03/01 02:05:01 easysw Exp $". // 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 $". // |
