diff options
author | Marek Kasik <mkasik@redhat.com> | 2009-08-29 21:34:05 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2009-08-29 21:34:05 -0400 |
commit | f117777c20f9ad0447bea9eb8c8d03c1b64d4344 (patch) | |
tree | 2adf1b973ce673080969744633c601fab65adde3 | |
parent | 3b336186ee4d55799f4290c672d6bccd787c70fa (diff) | |
download | gtk+-f117777c20f9ad0447bea9eb8c8d03c1b64d4344.tar.gz |
Return meaningful default values for lpi and resolution
Change default values returned by gtk_print_settings_get_printer_lpi()
and gtk_print_settings_get_resolution{_x, _y}(). New values are 150 for
lpi and 300 for resolution (instead of 0) (#590861).
4 files changed, 3 insertions, 11 deletions
diff --git a/modules/printbackends/file/gtkprintbackendfile.c b/modules/printbackends/file/gtkprintbackendfile.c index 9f14df6ca9..aaf8ce1d90 100644 --- a/modules/printbackends/file/gtkprintbackendfile.c +++ b/modules/printbackends/file/gtkprintbackendfile.c @@ -335,9 +335,6 @@ file_printer_create_cairo_surface (GtkPrinter *printer, break; } - if (gtk_print_settings_get_printer_lpi (settings) == 0.0) - gtk_print_settings_set_printer_lpi (settings, 150.0); - cairo_surface_set_fallback_resolution (surface, 2.0 * gtk_print_settings_get_printer_lpi (settings), 2.0 * gtk_print_settings_get_printer_lpi (settings)); diff --git a/modules/printbackends/lpr/gtkprintbackendlpr.c b/modules/printbackends/lpr/gtkprintbackendlpr.c index a20f0d31a3..6419b07275 100644 --- a/modules/printbackends/lpr/gtkprintbackendlpr.c +++ b/modules/printbackends/lpr/gtkprintbackendlpr.c @@ -211,9 +211,6 @@ lpr_printer_create_cairo_surface (GtkPrinter *printer, surface = cairo_ps_surface_create_for_stream (_cairo_write, cache_io, width, height); - if (gtk_print_settings_get_printer_lpi (settings) == 0.0) - gtk_print_settings_set_printer_lpi (settings, 150.0); - cairo_surface_set_fallback_resolution (surface, 2.0 * gtk_print_settings_get_printer_lpi (settings), 2.0 * gtk_print_settings_get_printer_lpi (settings)); diff --git a/modules/printbackends/papi/gtkprintbackendpapi.c b/modules/printbackends/papi/gtkprintbackendpapi.c index eb16e1553d..7dba533eaa 100644 --- a/modules/printbackends/papi/gtkprintbackendpapi.c +++ b/modules/printbackends/papi/gtkprintbackendpapi.c @@ -234,8 +234,9 @@ papi_printer_create_cairo_surface (GtkPrinter *printer, surface = cairo_ps_surface_create_for_stream (_cairo_write, cache_io, width, height); - /* TODO: DPI from settings object? */ - cairo_surface_set_fallback_resolution (surface, 300, 300); + cairo_surface_set_fallback_resolution (surface, + 2.0 * gtk_print_settings_get_printer_lpi (settings), + 2.0 * gtk_print_settings_get_printer_lpi (settings)); return surface; } diff --git a/modules/printbackends/test/gtkprintbackendtest.c b/modules/printbackends/test/gtkprintbackendtest.c index 47037cbde3..c4a4e23f73 100644 --- a/modules/printbackends/test/gtkprintbackendtest.c +++ b/modules/printbackends/test/gtkprintbackendtest.c @@ -305,9 +305,6 @@ test_printer_create_cairo_surface (GtkPrinter *printer, else surface = cairo_pdf_surface_create_for_stream (_cairo_write, cache_io, width, height); - if (gtk_print_settings_get_printer_lpi (settings) == 0.0) - gtk_print_settings_set_printer_lpi (settings, 150.0); - cairo_surface_set_fallback_resolution (surface, 2.0 * gtk_print_settings_get_printer_lpi (settings), 2.0 * gtk_print_settings_get_printer_lpi (settings)); |