# HG changeset patch # User belugas # Date 1213669545 0 # Node ID 02e4a6f1397242f292285f89e1ac31237f0579f8 # Parent ae131ef2cc8f1185f835acb3b474ff6f9bd2eeb9 (svn r13540) -Codechange: Less a magic number and a more adaptable code diff -r ae131ef2cc8f -r 02e4a6f13972 src/toolbar_gui.cpp --- a/src/toolbar_gui.cpp Mon Jun 16 20:16:43 2008 +0000 +++ b/src/toolbar_gui.cpp Tue Jun 17 02:25:45 2008 +0000 @@ -1099,8 +1099,7 @@ } uint extra_spacing_at[] = { 3, 4, 7, 8, 10, 16, 0 }; - /* Yes, it defines about 27 widgets for this toolbar */ - for (uint i = 0, x = 0, j = 0, b = 0; i < 27; i++) { + for (uint i = 0, x = 0, j = 0, b = 0; i < this->widget_count; i++) { switch (i) { case 4: this->widget[i].left = x;