]> Pileus Git - ~andy/gtk/commitdiff
printing: Add "Custom." prefix only once to paper size
authorMarek Kasik <mkasik@redhat.com>
Tue, 18 Sep 2012 12:18:15 +0000 (14:18 +0200)
committerMarek Kasik <mkasik@redhat.com>
Wed, 19 Sep 2012 16:03:41 +0000 (18:03 +0200)
Check whether "Custom." prefix is already present in the name
of selected paper size. (#679883)

modules/printbackends/cups/gtkprintbackendcups.c

index c79fe9da21aee10d25b5ab75b2ec090670029c5e..3c28a849fde2a04ee211b0ac4e89a41d5a27c985 100644 (file)
@@ -562,8 +562,8 @@ add_cups_options (const gchar *key,
         }
     }
 
-  /* Add "Custom." prefix to custom values. */
-  if (custom_value)
+  /* Add "Custom." prefix to custom values if not already added. */
+  if (custom_value && !g_str_has_prefix (value, "Custom."))
     {
       new_value = g_strdup_printf ("Custom.%s", value);
       gtk_cups_request_encode_option (request, key, new_value);