mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
libgimp: gimp_image_take_selected_layers() with boolean return.
Since it can fail, we should return the success value.
This commit is contained in:
parent
1cab305231
commit
3f1cae4d6b
2 changed files with 9 additions and 4 deletions
|
@ -296,23 +296,28 @@ gimp_image_list_selected_layers (GimpImage *image)
|
||||||
* existing floating selection, in which case this procedure will return an
|
* existing floating selection, in which case this procedure will return an
|
||||||
* execution error.
|
* execution error.
|
||||||
*
|
*
|
||||||
|
* Returns: TRUE on success.
|
||||||
|
*
|
||||||
* Since: 3.0
|
* Since: 3.0
|
||||||
**/
|
**/
|
||||||
void
|
gboolean
|
||||||
gimp_image_take_selected_layers (GimpImage *image,
|
gimp_image_take_selected_layers (GimpImage *image,
|
||||||
GList *layers)
|
GList *layers)
|
||||||
{
|
{
|
||||||
GimpLayer **sel_layers;
|
GimpLayer **sel_layers;
|
||||||
GList *list;
|
GList *list;
|
||||||
|
gboolean success;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
sel_layers = g_new0 (GimpLayer *, g_list_length (layers));
|
sel_layers = g_new0 (GimpLayer *, g_list_length (layers));
|
||||||
for (list = layers, i = 0; list; list = list->next, i++)
|
for (list = layers, i = 0; list; list = list->next, i++)
|
||||||
sel_layers[i] = list->data;
|
sel_layers[i] = list->data;
|
||||||
|
|
||||||
gimp_image_set_selected_layers (image, g_list_length (layers),
|
success = gimp_image_set_selected_layers (image, g_list_length (layers),
|
||||||
(const GimpLayer **) sel_layers);
|
(const GimpLayer **) sel_layers);
|
||||||
g_list_free (layers);
|
g_list_free (layers);
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -78,7 +78,7 @@ GList * gimp_image_list_channels (GimpImage *image);
|
||||||
GList * gimp_image_list_vectors (GimpImage *image);
|
GList * gimp_image_list_vectors (GimpImage *image);
|
||||||
|
|
||||||
GList * gimp_image_list_selected_layers (GimpImage *image);
|
GList * gimp_image_list_selected_layers (GimpImage *image);
|
||||||
void gimp_image_take_selected_layers (GimpImage *image,
|
gboolean gimp_image_take_selected_layers (GimpImage *image,
|
||||||
GList *layers);
|
GList *layers);
|
||||||
|
|
||||||
guchar * gimp_image_get_colormap (GimpImage *image,
|
guchar * gimp_image_get_colormap (GimpImage *image,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue