]> Pileus Git - ~andy/gtk/commitdiff
Set hard margins to 0 when printing n-up on unix printers
authorAdrian Johnson <ajohnson@redneon.com>
Sat, 21 Nov 2009 10:40:36 +0000 (21:10 +1030)
committerChristian Persch <chpe@gnome.org>
Tue, 1 Dec 2009 16:40:09 +0000 (17:40 +0100)
gtk/gtkprintoperation-unix.c

index 5940600b76ec48c279e34181fd5a728800743e21..19e5644f1decb886f78f22f34b5b23da125c42ab 100644 (file)
@@ -545,8 +545,12 @@ finish_print (PrintResponseData *rdata,
       gtk_print_operation_set_print_settings (op, settings);
       priv->print_context = _gtk_print_context_new (op);
 
-      if (gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
-        _gtk_print_context_set_hard_margins (priv->print_context, top, bottom, left, right);
+      if (gtk_print_settings_get_number_up (settings) < 2) {
+       if (gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
+         _gtk_print_context_set_hard_margins (priv->print_context, top, bottom, left, right);
+      } else {
+       _gtk_print_context_set_hard_margins (priv->print_context, 0, 0, 0, 0);
+      }
 
       if (page_setup != NULL &&
           (gtk_print_operation_get_default_page_setup (op) == NULL ||