Fl_Widget::copy_label(NULL) didn't work (STR #707)

src/Fl_Widget.cxx:
    - Check for NULL in Fl_Widget::copy_label()


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4032 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2005-02-06 01:29:54 +00:00
parent 9290da74b7
commit b32fefd1c5
2 changed files with 12 additions and 4 deletions
+3
View File
@@ -1,6 +1,9 @@
CHANGES IN FLTK 1.1.7 CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692) - Documentation fixes (STR #648, STR #692)
- Fl_Widget::copy_label(NULL) didn't work (STR #707)
- Fl_Choice now allows click selection like
Fl_Menu_Button and Fl_Menubar (STR #706)
- Updated cmake support (STR #645) - Updated cmake support (STR #645)
- Fl_Check_Browser didn't draw properly when inactive - Fl_Check_Browser didn't draw properly when inactive
(STR #681) (STR #681)
+9 -4
View File
@@ -1,5 +1,5 @@
// //
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.26 2004/11/23 19:51:03 easysw Exp $" // "$Id$"
// //
// Base widget class for the Fast Light Tool Kit (FLTK). // Base widget class for the Fast Light Tool Kit (FLTK).
// //
@@ -262,12 +262,17 @@ Fl_Widget::label(const char *a) {
void void
Fl_Widget::copy_label(const char *a) { Fl_Widget::copy_label(const char *a) {
if (flags() & COPIED_LABEL) free((void *)(label_.value)); if (flags() & COPIED_LABEL) free((void *)(label_.value));
set_flag(COPIED_LABEL); if (a) {
label_.value=strdup(a); set_flag(COPIED_LABEL);
label_.value=strdup(a);
} else {
clear_flag(COPIED_LABEL);
label_.value=(char *)0;
}
redraw_label(); redraw_label();
} }
// //
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.26 2004/11/23 19:51:03 easysw Exp $". // End of "$Id$".
// //