rpms/paps/FC-5 paps-formfeed.patch, NONE, 1.1 paps.spec, 1.11, 1.12 paps-0.6.3-formfeed.patch, 1.1, NONE

Akira Tagoh (tagoh) fedora-extras-commits at redhat.com
Fri Sep 1 02:30:02 UTC 2006


Author: tagoh

Update of /cvs/extras/rpms/paps/FC-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27607

Modified Files:
	paps.spec 
Added Files:
	paps-formfeed.patch 
Removed Files:
	paps-0.6.3-formfeed.patch 
Log Message:
* Fri Sep  1 2006 Akira TAGOH <tagoh at redhat.com> - 0.6.6-7
- paps-formfeed.patch: fixed to not insert an extra line in next page.
  (#202638)

paps-formfeed.patch:

--- NEW FILE paps-formfeed.patch ---
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;


Index: paps.spec
===================================================================
RCS file: /cvs/extras/rpms/paps/FC-5/paps.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- paps.spec	29 Aug 2006 12:47:49 -0000	1.11
+++ paps.spec	1 Sep 2006 02:30:02 -0000	1.12
@@ -1,6 +1,6 @@
 Name:		paps
 Version:	0.6.6
-Release:	6%{?dist}
+Release:	7%{?dist}
 
 License:	LGPL
 URL:		http://paps.sourceforge.net/
@@ -9,7 +9,7 @@
 BuildRequires:	pango-devel automake autoconf libtool doxygen
 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
@@ -69,6 +69,10 @@
 
 
 %changelog
+* Fri Sep  1 2006 Akira TAGOH <tagoh at redhat.com> - 0.6.6-7
+- paps-formfeed.patch: fixed to not insert an extra line in next page.
+  (#202638)
+
 * Tue Aug 29 2006 Akira TAGOH <tagoh at redhat.com> - 0.6.6-6
 - paps-0.6.6-wordwrap.patch: applied to do a wordwrap.
 - paps-0.6.6-cpilpi.patch: add --cpi and --lpi option to support the characters


--- paps-0.6.3-formfeed.patch DELETED ---




More information about the scm-commits mailing list