[gtk+/composite-templates] printing: Add "Custom." prefix only once to paper size



commit bcba63fc090b22cb11bafc90a3758455c72cdd3d
Author: Marek Kasik <mkasik redhat com>
Date:   Tue Sep 18 14:18:15 2012 +0200

    printing: Add "Custom." prefix only once to paper size
    
    Check whether "Custom." prefix is already present in the name
    of selected paper size. (#679883)

 modules/printbackends/cups/gtkprintbackendcups.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index c79fe9d..3c28a84 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -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);



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