- paps-formfeed.patch: fixed to not insert an extra line in next page.
(#202638)
This commit is contained in:
parent
89669d7759
commit
7187afdd8b
93
paps-formfeed.patch
Normal file
93
paps-formfeed.patch
Normal file
@ -0,0 +1,93 @@
|
||||
diff -ruN -x 'Makefile*' -x autom4te.cache -x 'config*' -x doc -x libtool -x .deps -x .libs -x '*a' -x '*o' -x paps -x '*orig' -x 'stamp*' -x 'test*' paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c
|
||||
--- paps-0.6.6.orig/src/paps.c 2006-05-03 18:09:58.000000000 +0900
|
||||
+++ paps-0.6.6/src/paps.c 2006-08-31 17:57:47.000000000 +0900
|
||||
@@ -88,6 +88,7 @@
|
||||
PangoLayoutLine *pango_line;
|
||||
PangoRectangle logical_rect;
|
||||
PangoRectangle ink_rect;
|
||||
+ int formfeed;
|
||||
} LineLink;
|
||||
|
||||
typedef struct _Paragraph Paragraph;
|
||||
@@ -98,6 +99,7 @@
|
||||
char *text;
|
||||
int length;
|
||||
int height; /* Height, in pixels */
|
||||
+ int formfeed;
|
||||
PangoLayout *layout;
|
||||
};
|
||||
|
||||
@@ -428,7 +430,7 @@
|
||||
fprintf (stderr, "%s: Invalid character in input\n", g_get_prgname ());
|
||||
wc = 0;
|
||||
}
|
||||
- if (!*p || !wc || wc == '\n')
|
||||
+ if (!*p || !wc || wc == '\n' || wc == '\f')
|
||||
{
|
||||
Paragraph *para = g_new (Paragraph, 1);
|
||||
para->text = last_para;
|
||||
@@ -442,6 +444,11 @@
|
||||
pango_layout_set_width (para->layout, paint_width * PANGO_SCALE);
|
||||
para->height = 0;
|
||||
|
||||
+ if (wc == '\f')
|
||||
+ para->formfeed = 1;
|
||||
+ else
|
||||
+ para->formfeed = 0;
|
||||
+
|
||||
last_para = next;
|
||||
|
||||
result = g_list_prepend (result, para);
|
||||
@@ -469,6 +476,7 @@
|
||||
while(par_list)
|
||||
{
|
||||
int para_num_lines, i;
|
||||
+ LineLink *line_link;
|
||||
Paragraph *para = par_list->data;
|
||||
|
||||
para_num_lines = pango_layout_get_line_count(para->layout);
|
||||
@@ -476,12 +484,15 @@
|
||||
for (i=0; i<para_num_lines; i++)
|
||||
{
|
||||
PangoRectangle logical_rect, ink_rect;
|
||||
- LineLink *line_link = g_new(LineLink, 1);
|
||||
|
||||
+ line_link = g_new(LineLink, 1);
|
||||
+ line_link->formfeed = 0;
|
||||
line_link->pango_line = pango_layout_get_line(para->layout, i);
|
||||
pango_layout_line_get_extents(line_link->pango_line,
|
||||
&ink_rect, &logical_rect);
|
||||
line_link->logical_rect = logical_rect;
|
||||
+ if (para->formfeed && i == (para_num_lines - 1))
|
||||
+ line_link->formfeed = 1;
|
||||
line_link->ink_rect = ink_rect;
|
||||
line_list = g_list_prepend(line_list, line_link);
|
||||
}
|
||||
@@ -504,6 +515,7 @@
|
||||
int column_y_pos = 0;
|
||||
int page_idx = 1;
|
||||
int pango_column_height = page_layout->column_height * page_layout->pt_to_pixel * PANGO_SCALE;
|
||||
+ LineLink *prev_line_link = NULL;
|
||||
|
||||
start_page(OUT, page_idx);
|
||||
|
||||
@@ -516,8 +528,9 @@
|
||||
PangoLayoutLine *line = line_link->pango_line;
|
||||
|
||||
/* Check if we need to move to next column */
|
||||
- if (column_y_pos + line_link->logical_rect.height
|
||||
- >= pango_column_height)
|
||||
+ if ((column_y_pos + line_link->logical_rect.height
|
||||
+ >= pango_column_height) ||
|
||||
+ (prev_line_link && prev_line_link->formfeed))
|
||||
{
|
||||
column_idx++;
|
||||
column_y_pos = 0;
|
||||
@@ -547,6 +560,7 @@
|
||||
column_y_pos += line_link->logical_rect.height;
|
||||
|
||||
pango_lines = pango_lines->next;
|
||||
+ prev_line_link = line_link;
|
||||
}
|
||||
eject_page(OUT);
|
||||
return page_idx;
|
@ -9,7 +9,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: pango-devel automake autoconf libtool doxygen cups-devel
|
||||
Patch0: paps-makefile.patch
|
||||
## http://sourceforge.net/mailarchive/forum.php?thread_id=9329194&forum_id=47278
|
||||
Patch2: paps-0.6.3-formfeed.patch
|
||||
Patch2: paps-formfeed.patch
|
||||
## http://sourceforge.net/tracker/index.php?func=detail&aid=1494769&group_id=153049&atid=786242
|
||||
Patch3: paps-0.6.6-encoding.patch
|
||||
## fixed in CVS
|
||||
@ -76,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Aug 31 2006 Akira TAGOH <tagoh@redhat.com> - 0.6.6-13
|
||||
- paps-formfeed.patch: fixed to not insert an extra line in next page.
|
||||
(#202638)
|
||||
|
||||
* Thu Aug 17 2006 Tim Waugh <twaugh@redhat.com> - 0.6.6-12
|
||||
- Map CUPS charset names to real ones (bug #197577).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user