diff options
Diffstat (limited to 'debian/patches/07_print_ps_imageable_area_rounding.dpatch')
-rw-r--r-- | debian/patches/07_print_ps_imageable_area_rounding.dpatch | 174 |
1 files changed, 0 insertions, 174 deletions
diff --git a/debian/patches/07_print_ps_imageable_area_rounding.dpatch b/debian/patches/07_print_ps_imageable_area_rounding.dpatch deleted file mode 100644 index c7bfc0e..0000000 --- a/debian/patches/07_print_ps_imageable_area_rounding.dpatch +++ /dev/null @@ -1,174 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 7_print_ps_imageable_area_rounding.dpatch by <rleigh@debian.org> -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Round ImageableArea towards the centre of the page - -@DPATCH@ - -diff -urN gutenprint-4.3.99+cvs20060521.original/src/main/print-ps.c gutenprint-4.3.99+cvs20060521/src/main/print-ps.c ---- gutenprint-4.3.99+cvs20060521.original/src/main/print-ps.c 2006-04-17 03:08:21.000000000 +0100 -+++ gutenprint-4.3.99+cvs20060521/src/main/print-ps.c 2006-06-05 10:42:01.194455852 +0100 -@@ -1,5 +1,5 @@ - /* -- * "$Id: print-ps.c,v 1.84 2006/04/17 02:06:19 rlk Exp $" -+ * "$Id: print-ps.c,v 1.87 2006/06/04 18:06:34 rleigh Exp $" - * - * Print plug-in Adobe PostScript driver for the GIMP. - * -@@ -34,6 +34,7 @@ - #include "gutenprint-internal.h" - #include <time.h> - #include <string.h> -+#include <math.h> - #ifdef HAVE_LIMITS_H - #include <limits.h> - #endif -@@ -159,6 +160,8 @@ - stp_fill_parameter_settings(description, &(the_parameters[i])); - break; - } -+ if (strcmp(name, "PPDFile") == 0) -+ return; - - if (strcmp(name, "PrintingMode") == 0) - { -@@ -183,7 +186,7 @@ - const stp_papersize_t *pt = stp_get_papersize_by_index(i); - if (strlen(pt->name) > 0) - stp_string_list_add_string -- (description->bounds.str, pt->name, pt->text); -+ (description->bounds.str, pt->name, gettext(pt->text)); - } - description->deflt.str = - stp_string_list_param(description->bounds.str, 0)->name; -@@ -230,9 +233,9 @@ - ps_parameters(const stp_vars_t *v, const char *name, - stp_parameter_t *description) - { -- setlocale(LC_ALL, "C"); -+ char *locale = setlocale(LC_ALL, "C"); - ps_parameters_internal(v, name, description); -- setlocale(LC_ALL, ""); -+ setlocale(LC_ALL, locale); - } - - /* -@@ -260,8 +263,8 @@ - != NULL) - { - sscanf(dimensions, "%f%f", &fwidth, &fheight); -- *width = fwidth; -- *height = fheight; -+ *width = (int) fwidth; -+ *height = (int) fheight; - stp_dprintf(STP_DBG_PS, v, "dimensions '%s' %f %f %d %d\n", - dimensions, fwidth, fheight, *width, *height); - } -@@ -272,9 +275,9 @@ - static void - ps_media_size(const stp_vars_t *v, int *width, int *height) - { -- setlocale(LC_ALL, "C"); -+ char *locale = setlocale(LC_ALL, "C"); - ps_media_size_internal(v, width, height); -- setlocale(LC_ALL, ""); -+ setlocale(LC_ALL, locale); - } - - /* -@@ -304,13 +307,16 @@ - "ImageableArea", pagesize, NULL)) - != NULL) - { -- stp_dprintf(STP_DBG_PS, v, "area = \'%s\'\n", area); -- if (sscanf(area, "%f%f%f%f", &fleft, &fbottom, &fright, &ftop) == 4) -+ int status = sscanf(area, "%f%f%f%f", &fleft, &fbottom, &fright, &ftop); -+ stp_dprintf(STP_DBG_PS, v, -+ "area = \'%s\' status = %d l %f r %f b %f t %f h %d w %d\n", -+ area, status, fleft, fright, fbottom, ftop, width, height); -+ if (status) - { -- *left = (int)fleft; -- *right = (int)fright; -- *bottom = height - (int)fbottom; -- *top = height - (int)ftop; -+ *left = (int) ceil((double) fleft); -+ *right = (int) floor((double) fright); -+ *bottom = (int) floor((double) height - fbottom); -+ *top = (int) ceil((double) height - ftop); - if (use_max_area) - { - if (*left > 0) -@@ -344,9 +350,9 @@ - int *bottom, /* O - Bottom position in points */ - int *top) /* O - Top position in points */ - { -- setlocale(LC_ALL, "C"); -+ char *locale = setlocale(LC_ALL, "C"); - ps_imageable_area_internal(v, 0, left, right, bottom, top); -- setlocale(LC_ALL, ""); -+ setlocale(LC_ALL, locale); - } - - static void -@@ -356,9 +362,9 @@ - int *bottom, /* O - Bottom position in points */ - int *top) /* O - Top position in points */ - { -- setlocale(LC_ALL, "C"); -+ char *locale = setlocale(LC_ALL, "C"); - ps_imageable_area_internal(v, 1, left, right, bottom, top); -- setlocale(LC_ALL, ""); -+ setlocale(LC_ALL, locale); - } - - static void -@@ -391,9 +397,9 @@ - static void - ps_describe_resolution(const stp_vars_t *v, int *x, int *y) - { -- setlocale(LC_ALL, "C"); -+ char *locale = setlocale(LC_ALL, "C"); - ps_describe_resolution_internal(v, x, y); -- setlocale(LC_ALL, ""); -+ setlocale(LC_ALL, locale); - } - - static const char * -@@ -454,6 +460,7 @@ - int image_height, - image_width; - stp_vars_t *nv = stp_vars_create_copy(v); -+ char *locale; - if (!resolution) - resolution = ""; - if (!media_size) -@@ -638,11 +645,11 @@ - always be printed with a decimal point rather than the - locale-specific setting. */ - -- setlocale(LC_ALL, "C"); -+ locale = setlocale(LC_ALL, "C"); - stp_zprintf(v, "%.3f %.3f scale\n", - (double)out_width / ((double)image_width), - (double)out_height / ((double)image_height)); -- setlocale(LC_ALL, ""); -+ setlocale(LC_ALL, locale); - - stp_channel_reset(nv); - stp_channel_add(nv, 0, 0, 1.0); -@@ -766,10 +773,9 @@ - static int - ps_print(const stp_vars_t *v, stp_image_t *image) - { -- int status; -- setlocale(LC_ALL, "C"); -- status = ps_print_internal(v, image); -- setlocale(LC_ALL, ""); -+ char *locale = setlocale(LC_ALL, "C"); -+ int status = ps_print_internal(v, image); -+ setlocale(LC_ALL, locale); - return status; - } - |