Commit d1d56f13 authored by Michael Natterer's avatar Michael Natterer 😴

libgimp: set a procedure's arguments and return values to defaults

We need this for named parameters, and it's cleaner anyway.
parent b511cf34
Pipeline #100699 passed with stages
in 36 minutes and 3 seconds
......@@ -693,8 +693,10 @@ gimp_procedure_new_arguments (GimpProcedure *procedure)
for (i = 0; i < procedure->priv->n_args; i++)
{
g_value_init (&value,
G_PARAM_SPEC_VALUE_TYPE (procedure->priv->args[i]));
GParamSpec *pspec = procedure->priv->args[i];
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
g_param_value_set_default (pspec, &value);
gimp_value_array_append (args, &value);
g_value_unset (&value);
}
......@@ -742,8 +744,10 @@ gimp_procedure_new_return_values (GimpProcedure *procedure,
for (i = 0; i < procedure->priv->n_values; i++)
{
g_value_init (&value,
G_PARAM_SPEC_VALUE_TYPE (procedure->priv->values[i]));
GParamSpec *pspec = procedure->priv->values[i];
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
g_param_value_set_default (pspec, &value);
gimp_value_array_append (args, &value);
g_value_unset (&value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment