Fixed sorting in Fl_Browser - last item would not be sorted (STR #2300)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7103 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2010-02-19 20:25:54 +00:00
parent b416a027cf
commit 0ec12cc9c4
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
CHANGES IN FLTK 1.3.0 CHANGES IN FLTK 1.3.0
- Fixed sorting in Fl_Browser - last item would not
be sorted (STR #2300)
- Fixed window levels in OS X Cocoa (STR #2316) - Fixed window levels in OS X Cocoa (STR #2316)
- Added jpeg support to Fluid image() element - Added jpeg support to Fluid image() element
- Added loading jpeg images from memory - Added loading jpeg images from memory

View File

@ -962,7 +962,7 @@ void Fl_Browser_::sort(int flags) {
a = item_next(a); a = item_next(a);
n++; n++;
} }
for (i=n-1; i>0; i--) { for (i=n; i>0; i--) {
char swapped = 0; char swapped = 0;
a = item_first(); a = item_first();
b = item_next(a); b = item_next(a);
@ -981,6 +981,7 @@ void Fl_Browser_::sort(int flags) {
swapped = 1; swapped = 1;
} }
} }
if (!c) break;
b = c; a = item_prev(b); b = c; a = item_prev(b);
} }
if (!swapped) if (!swapped)