diff --git a/ChangeLog b/ChangeLog index b136478ac0..a34be75dc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-03-06 Manish Sing + + * tools/pdbgen/pdb/guides.pdb: fix find_next_guide to return 0 on + the last guide as documented, instead of failing. + + * app/pdb/guides_cmds.c: regenerated + 2003-03-06 Michael Natterer * themes/Default/images/stock-delete-16.png diff --git a/app/pdb/guides_cmds.c b/app/pdb/guides_cmds.c index 6b0d9aee00..a50c118690 100644 --- a/app/pdb/guides_cmds.c +++ b/app/pdb/guides_cmds.c @@ -298,36 +298,39 @@ image_find_next_guide_invoker (Gimp *gimp, if (success) { - success = (gimage->guides == NULL); - guide_found = FALSE; - - for (guides = gimage->guides; guides; guides = g_list_next (guides)) + if (gimage->guides != NULL) { - GimpGuide *g = (GimpGuide *) guides->data; + success = FALSE; + guide_found = FALSE; - if (g->position < 0) - continue; - - if (guide == 0) /* init - Return first guide ID in list */ + for (guides = gimage->guides; guides; guides = g_list_next (guides)) { - next_guide = g->guide_ID; + GimpGuide *g = (GimpGuide *) guides->data; - success = TRUE; - break; + if (g->position < 0) + continue; + + if (guide == 0) /* init - Return first guide ID in list */ + { + next_guide = g->guide_ID; + + guide_found = TRUE; + break; + } + + if (! guide_found) + { + if (g->guide_ID == guide) + guide_found = TRUE; + } + else + { + next_guide = g->guide_ID; + } } - if (! guide_found) - { - if (g->guide_ID == guide) - guide_found = TRUE; - } - else - { - next_guide = g->guide_ID; - - success = TRUE; - break; - } + if (guide_found) + success = TRUE; } } diff --git a/tools/pdbgen/pdb/guides.pdb b/tools/pdbgen/pdb/guides.pdb index a94115ebf6..fdbb6821a5 100644 --- a/tools/pdbgen/pdb/guides.pdb +++ b/tools/pdbgen/pdb/guides.pdb @@ -143,36 +143,39 @@ HELP vars => [ 'GList *guides', 'gboolean guide_found' ], code => <<'CODE' { - success = (gimage->guides == NULL); - guide_found = FALSE; - - for (guides = gimage->guides; guides; guides = g_list_next (guides)) + if (gimage->guides != NULL) { - GimpGuide *g = (GimpGuide *) guides->data; + success = FALSE; + guide_found = FALSE; - if (g->position < 0) - continue; - - if (guide == 0) /* init - Return first guide ID in list */ + for (guides = gimage->guides; guides; guides = g_list_next (guides)) { - next_guide = g->guide_ID; + GimpGuide *g = (GimpGuide *) guides->data; - success = TRUE; - break; + if (g->position < 0) + continue; + + if (guide == 0) /* init - Return first guide ID in list */ + { + next_guide = g->guide_ID; + + guide_found = TRUE; + break; + } + + if (! guide_found) + { + if (g->guide_ID == guide) + guide_found = TRUE; + } + else + { + next_guide = g->guide_ID; + } } - if (! guide_found) - { - if (g->guide_ID == guide) - guide_found = TRUE; - } - else - { - next_guide = g->guide_ID; - - success = TRUE; - break; - } + if (guide_found) + success = TRUE; } } CODE