Author: fabien
Date: 2012-04-21 08:16:27 -0700 (Sat, 21 Apr 2012)
New Revision: 9367
Log:
Applied recent 1.3 fix to fltk3.

Modified:
   branches/branch-3.0/include/fltk3/TextBuffer.h
   branches/branch-3.0/src/fltk3/TextBuffer.cxx

Modified: branches/branch-3.0/include/fltk3/TextBuffer.h
===================================================================
--- branches/branch-3.0/include/fltk3/TextBuffer.h      2012-04-21 15:05:00 UTC 
(rev 9366)
+++ branches/branch-3.0/include/fltk3/TextBuffer.h      2012-04-21 15:16:27 UTC 
(rev 9367)
@@ -195,7 +195,7 @@
     
     /**  
      Replaces the entire contents of the text buffer.
-     \param text Text must be valid utf8.
+     \param text Text must be utf8, if null an empty string is substituted.
      */
     void text(const char* text);
     

Modified: branches/branch-3.0/src/fltk3/TextBuffer.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/TextBuffer.cxx        2012-04-21 15:05:00 UTC 
(rev 9366)
+++ branches/branch-3.0/src/fltk3/TextBuffer.cxx        2012-04-21 15:16:27 UTC 
(rev 9367)
@@ -174,7 +174,11 @@
 void fltk3::TextBuffer::text(const char *t)
 {
   IS_UTF8_ALIGNED(t)
-  
+
+  // if t is null then substitute it with an empty string
+  // then don't return so that internal cleanup can happen
+  if (!t) t="";
+
   call_predelete_callbacks(0, length());
   
   /* Save information for redisplay, and get rid of the old buffer */

_______________________________________________
fltk-commit mailing list
fltk-commit@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to