1
1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
2
## hpgl-regression.dpatch by Martin Pitt <mpitt@debian.org>
4
## DP: Revert the SP_select_pen() enumeration change introduced in STR #2911,
5
## DP: because it changes the color mapping (e. g. "SP1" would now select a
6
## DP: white pen instead of a black one, and "SP0" would not be valid at all
7
## DP: any more). Also fix a remaining off-by-one loop. (STR #2966)
4
## DP: Fix HPGL pen selection regression introduced in STR #2911.
5
## DP: Also fix a remaining off-by-one loop. (STR #2966)
9
7
diff -urNad trunk~/filter/hpgl-attr.c trunk/filter/hpgl-attr.c
10
8
--- trunk~/filter/hpgl-attr.c 2008-10-09 22:12:03.000000000 +0200
11
+++ trunk/filter/hpgl-attr.c 2008-10-10 10:55:46.000000000 +0200
9
+++ trunk/filter/hpgl-attr.c 2008-11-13 11:26:46.000000000 +0100
12
* HP-GL/2 attribute processing for the Common UNIX Printing System (CUPS).
14
- * Copyright 2007 by Apple Inc.
15
+ * Copyright 2007-2008 by Apple Inc.
16
* Copyright 1993-2007 by Easy Software Products.
18
* These coded instructions, statements, and computer programs are the
12
19
@@ -214,7 +214,7 @@
13
20
"DEBUG: HP-GL/2 \'NP\' command with invalid number of "
14
21
"parameters (%d)!\n", num_params);
18
25
Pens[i].width = PenWidth;
20
27
PC_pen_color(0, NULL);
22
fprintf(stderr, "DEBUG: HP-GL/2 \'SP\' command with invalid pen (%d)!\n",
23
(int)params[0].value.number);
25
- PenNumber = (int)params[0].value.number - 1;
26
+ PenNumber = (int)params[0].value.number;
29
printf("%.3f %.3f %.3f %.2f SP\n", Pens[PenNumber].rgb[0],
29
int i; /* Looping var */
30
static float standard_colors[8][3] = /* Standard colors for first 8 pens */
32
- { 1.0, 1.0, 1.0 }, /* White */
33
{ 0.0, 0.0, 0.0 }, /* Black */
34
{ 1.0, 0.0, 0.0 }, /* Red */
35
{ 0.0, 1.0, 0.0 }, /* Green */
36
{ 1.0, 1.0, 0.0 }, /* Yellow */
37
{ 0.0, 0.0, 1.0 }, /* Blue */
38
{ 1.0, 0.0, 1.0 }, /* Magenta */
39
- { 0.0, 1.0, 1.0 } /* Cyan */
40
+ { 0.0, 1.0, 1.0 }, /* Cyan */
41
+ { 1.0, 1.0, 1.0 } /* White */
45
diff -urNad trunk~/filter/hpgl-vector.c trunk/filter/hpgl-vector.c
46
--- trunk~/filter/hpgl-vector.c 2008-07-12 00:48:49.000000000 +0200
47
+++ trunk/filter/hpgl-vector.c 2008-11-13 11:26:03.000000000 +0100
50
* HP-GL/2 vector routines for the Common UNIX Printing System (CUPS).
52
- * Copyright 2007 by Apple Inc.
53
+ * Copyright 2007-2008 by Apple Inc.
54
* Copyright 1993-2007 by Easy Software Products.
56
* These coded instructions, statements, and computer programs are the
59
case ':' : /* Select pen */
61
- PenNumber = (int)decode_number(&s, base_bits, 1.0);
62
+ temp = (int)decode_number(&s, base_bits, 1.0) - 1;
63
+ if (temp < 0 || temp >= PenCount)
65
+ fprintf(stderr, "DEBUG: Bad pen number %d in PE\n", temp + 1);
72
- fprintf(stderr, "DEBUG: set pen #%d\n", PenNumber);
73
+ fprintf(stderr, "DEBUG: set pen #%d\n", PenNumber + 1);
76
- Outputf("%% PE: set pen #%d\n", PenNumber);
77
+ Outputf("%% PE: set pen #%d\n", PenNumber + 1);
80
printf("%.3f %.3f %.3f %.2f SP\n", Pens[PenNumber].rgb[0],