[gimp] app, pdb: set string arguments to "" *after* the GFile.



commit 4b9dc93d087173319514bf2e271ad34276cbd9d8
Author: Jehan <jehan girinstud io>
Date:   Wed Oct 21 20:15:18 2020 +0200

    app, pdb: set string arguments to "" *after* the GFile.
    
    Thanks to Wormnest for pushing me to look further. Since gimp-file-save
    is actually redirecting the call to another procedure (save proc for the
    specific format) which might have more arguments, including string
    arguments. When it finds any, it sets it to an empty string "" (which I
    guess is ok as "default value when we don't know what to put there").
    
    The previous code would not hurt. Starting at the fourth argument
    (GFile), it would just do nothing, then continue with the firth and
    further. Still, starting directly at the fifth arg is the proper code
    for this.

 app/pdb/file-cmds.c | 2 +-
 pdb/groups/file.pdb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app/pdb/file-cmds.c b/app/pdb/file-cmds.c
index 02885bd4e4..8813e1cc27 100644
--- a/app/pdb/file-cmds.c
+++ b/app/pdb/file-cmds.c
@@ -262,7 +262,7 @@ file_save_invoker (GimpProcedure         *procedure,
   g_value_transform (gimp_value_array_index (args, 4),
                      gimp_value_array_index (new_args, 4));
 
-  for (i = 4; i < proc->num_args; i++)
+  for (i = 5; i < proc->num_args; i++)
     if (G_IS_PARAM_SPEC_STRING (proc->args[i]))
       g_value_set_static_string (gimp_value_array_index (new_args, i), "");
 
diff --git a/pdb/groups/file.pdb b/pdb/groups/file.pdb
index 8b14de43db..2bd1f7dc2b 100644
--- a/pdb/groups/file.pdb
+++ b/pdb/groups/file.pdb
@@ -283,7 +283,7 @@ HELP
   g_value_transform (gimp_value_array_index (args, 4),
                      gimp_value_array_index (new_args, 4));
 
-  for (i = 4; i < proc->num_args; i++)
+  for (i = 5; i < proc->num_args; i++)
     if (G_IS_PARAM_SPEC_STRING (proc->args[i]))
       g_value_set_static_string (gimp_value_array_index (new_args, i), "");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]