[gs-cvs] rev 8310 - trunk/gs/lib

alexcher at ghostscript.com alexcher at ghostscript.com
Sun Oct 21 13:49:30 PDT 2007


Author: alexcher
Date: 2007-10-21 13:49:29 -0700 (Sun, 21 Oct 2007)
New Revision: 8310

Modified:
   trunk/gs/lib/pdf_main.ps
   trunk/gs/lib/pdf_rbld.ps
Log:
Process duplicate entries in PDF 1.5 context stream the same way as
the entries from regular streams: the first entry found (i.e. the last
in the xref chain) takes efferct. Keep rebuilding logic intact, where
the last entry wins. Bug 689513, customer 700.

DIFFERENCES:
None.


Modified: trunk/gs/lib/pdf_main.ps
===================================================================
--- trunk/gs/lib/pdf_main.ps	2007-10-20 23:31:00 UTC (rev 8309)
+++ trunk/gs/lib/pdf_main.ps	2007-10-21 20:49:29 UTC (rev 8310)
@@ -277,11 +277,9 @@
        pop			% Stack: <err count> <obj#> <loc> <gen#> <tag>
        dup /n eq {		% xref line tag is /n
 	 pop			% pop dup of line tag
-         Objects 3 index lget null eq {	% later update might have set it
-	   0 3 1 roll		% Set ObjectStream object number = 0
-	   setxrefentry		% Save xref entry
-	   3 -1 roll pop	% Remove ObjectStream object onumber
-         } if
+	 0 3 1 roll		% Set ObjectStream object number = 0
+	 //false setxrefentry	% Save xref entry, don't change existing entries
+	 3 -1 roll pop		% Remove ObjectStream object onumber
        }
        {			% xref line tag was not /n
 	 /f ne			% verify that the tag was /f
@@ -341,7 +339,7 @@
 %    (loc: ) print 1 index pdfstring cvs print ( ) print
 %    (gen: ) print dup === flush
     0 3 1 roll			% set stream number = 0
-    setxrefentry
+    //false setxrefentry
     3 -1 roll pop		% remove stream number
   } bind
 	% XRef entry type 2 - compressed object type xref entry
@@ -350,7 +348,7 @@
 %    (obj num: ) print 2 index pdfstring cvs print ( ) print
 %    (field 2: ) print 1 index pdfstring cvs print ( ) print
 %    (field 3: ) print dup === flush
-    0 setxrefentry pop		% set generation number = 0
+    0 //false setxrefentry pop	% set generation number = 0
   } bind
 ] def
 

Modified: trunk/gs/lib/pdf_rbld.ps
===================================================================
--- trunk/gs/lib/pdf_rbld.ps	2007-10-20 23:31:00 UTC (rev 8309)
+++ trunk/gs/lib/pdf_rbld.ps	2007-10-21 20:49:29 UTC (rev 8310)
@@ -31,10 +31,12 @@
 
 % Note:  This procedure is also used by non-rebuild code.
 % Store a line in the xref array (Actually Objects and Generations arrays)
-% <obj num> (strm num> <obj loc> <gen num>  setxrefentry <obj num> strm num>
-% 						 	 <obj loc> <gen num>
+% <obj num> (strm num> <obj loc> <gen num> <rebuild>
+%                         setxrefentry <obj num> strm num> <obj loc> <gen num>
 /setxrefentry
-{	% We store generation numbers as value + 1
+{
+  5 1 roll
+       	% We store generation numbers as value + 1
 	% We reserve 0 to indicate an free xref entry
   1 add			% increment generation number
 	% To save space, generations numbers are stored in a lstring unless we
@@ -70,7 +72,7 @@
     } if
 	% Set error flag if we have equal object and generation numbers
     Generations 4 index lget 1 index eq { /dup_obj_gen_num true def } if
-  } ifelse
+  } 8 -1 roll { ifelse } { pop if } ifelse  % Run 'else' only when rebuilding.
 } bind def
 
 % Print the contents of the xref array.  This actually consists of three
@@ -274,7 +276,7 @@
 	      % save xref parameters into ObjectStream, Objects and Generations
 	      1 index 0			% rearrange parms for setxrefentry
 	      4 index PDFoffset sub 3 index
-	      setxrefentry		% save parameters
+	      //true setxrefentry	% save parameters
 	      pop pop pop pop		% clear parameters
 	    } if			% check if name is 'obj'
           } if				% check if we got 'obj" string



More information about the gs-cvs mailing list