summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-06-06 14:04:53 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-06-06 14:04:53 +0000
commita4cd699340c05a2c9525c1c5deadeee4d786ef24 (patch)
treeb6f8ade11e5a46e4b15b017d6f8539c888b577bb
parent9c4a8a4ed24667a0d12bc06cc89a777a449d763f (diff)
Fl_Text_Display::draw_vline() needed to check nVisLine >= num lines.
Fl_Menu_::remove() added 1 to the size() value, but it didn't need to. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2282 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES5
-rw-r--r--src/Fl_Menu_add.cxx7
-rw-r--r--src/Fl_Text_Display.cxx6
3 files changed, 10 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index 8109f73a0..913608335 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,9 @@
CHANGES IN FLTK 1.1.0rc3
- Documentation updates.
- - Did some testing against Valgrind and fixed some
- uninitialized memory problems in Fl_Help_View.
+ - Did some testing with Valgrind and fixed some memory
+ problems in Fl_Help_View::Fl_HelpView,
+ Fl_Menu_::remove(), and Fl_Text_Display::draw_vline().
- Fixed some redraw() bugs, and now redraw portions of
the parent widget when the label appears outside the
widget.
diff --git a/src/Fl_Menu_add.cxx b/src/Fl_Menu_add.cxx
index 4e4770463..19c2ce349 100644
--- a/src/Fl_Menu_add.cxx
+++ b/src/Fl_Menu_add.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.2 2002/04/11 11:52:41 easysw Exp $"
+// "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.3 2002/06/06 14:04:53 easysw Exp $"
//
// Menu utilities for the Fast Light Tool Kit (FLTK).
//
@@ -257,9 +257,10 @@ void Fl_Menu_::remove(int i) {
for (Fl_Menu_Item* m = item; m < next_item; m++)
if (m->text) free((void*)(m->text));
}
- memmove(item, next_item, ((menu_+n+1)-next_item)*sizeof(Fl_Menu_Item));
+ // MRS: "n" is the menu size(), which includes the trailing NULL entry...
+ memmove(item, next_item, (menu_+n-next_item)*sizeof(Fl_Menu_Item));
}
//
-// End of "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.2 2002/04/11 11:52:41 easysw Exp $".
+// End of "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.3 2002/06/06 14:04:53 easysw Exp $".
//
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 6548c1787..7a493dda9 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.15 2002/05/24 14:19:19 easysw Exp $"
+// "$Id: Fl_Text_Display.cxx,v 1.12.2.16 2002/06/06 14:04:53 easysw Exp $"
//
// Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@@ -888,7 +888,7 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip,
const char *lineStr;
/* If line is not displayed, skip it */
- if ( visLineNum < 0 || visLineNum > mNVisibleLines )
+ if ( visLineNum < 0 || visLineNum >= mNVisibleLines )
return;
/* Calculate Y coordinate of the string to draw */
@@ -1948,5 +1948,5 @@ int Fl_Text_Display::handle(int event) {
//
-// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.15 2002/05/24 14:19:19 easysw Exp $".
+// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.16 2002/06/06 14:04:53 easysw Exp $".
//