fix find_next_guide to return 0 on the last guide as documented, instead

2003-03-06  Manish Sing  <yosh@gimp.org>

        * 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
This commit is contained in:
Manish Sing 2003-03-07 02:50:08 +00:00 committed by Manish Singh
parent 06aeae86e6
commit 5edae3e6f6
3 changed files with 61 additions and 48 deletions

View File

@ -1,3 +1,10 @@
2003-03-06 Manish Sing <yosh@gimp.org>
* 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 <mitch@gimp.org>
* themes/Default/images/stock-delete-16.png

View File

@ -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;
}
}

View File

@ -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