[gs-cvs] gs/lib

Raph Levien raph at casper.ghostscript.com
Wed Jul 3 15:10:33 PDT 2002


Update of /cvs/ghostscript/gs/lib
In directory casper:/tmp/cvs-serv15167/lib

Modified Files:
	pdf_base.ps pdf_draw.ps 
Log Message:
Fix: Set pdfemptycount in .pdfpaintproc so that .pdfcount gives
correct answers when invoked from inside patterns. Fixes SF bug
#576572.


Index: pdf_base.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_base.ps,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- pdf_base.ps	26 Jun 2002 18:35:51 -0000	1.25
+++ pdf_base.ps	3 Jul 2002 22:10:31 -0000	1.26
@@ -179,8 +179,11 @@
   /LocalResources exch store
 } bind def
 
-% Get the depth of the PDF operand stack.  The main program (pdf_main.ps)
-% sets pdfemptycount before calling .pdfrun.
+% Get the depth of the PDF operand stack.  The caller sets pdfemptycount
+% before calling .pdfrun or .pdfruncontext.  It is initially set by
+% pdf_main, and is also set by any routine which changes the operand
+% stack depth (currently .pdfpaintproc, although there are other callers
+% of .pdfrun{context} which have not been checked for opstack depth.
 /.pdfcount {		% - .pdfcount <count>
   count pdfemptycount sub
 } bind def

Index: pdf_draw.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_draw.ps,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- pdf_draw.ps	28 Jun 2002 23:10:10 -0000	1.48
+++ pdf_draw.ps	3 Jul 2002 22:10:31 -0000	1.49
@@ -624,7 +624,13 @@
   PDFfile fileposition 3 1 roll
   q
   null sc1 null SC1
+
+  % save old value of pdfemptycount on opstack, set to new value
+  pdfemptycount /pdfemptycount count 3 sub def 3 1 roll
   exch false resolvestream pdfopdict .pdfruncontext
+  % restore pdfemptycount
+  /pdfemptycount exch def
+
   Q
   DEBUG { (%End PaintProc) = flush } if
   PDFfile exch setfileposition




More information about the gs-cvs mailing list