Bug 47031 - [PATCH] PdfGraphics2D incorrectly writes clipping instructions
Summary: [PATCH] PdfGraphics2D incorrectly writes clipping instructions
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.95
Hardware: PC Windows Vista
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-14 12:01 UTC by Francois Fernandes
Modified: 2012-04-01 07:06 UTC (History)
0 users



Attachments
patch for PDFGraphics2D.writeClip(Shape) (730 bytes, patch)
2009-04-14 12:01 UTC, Francois Fernandes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Fernandes 2009-04-14 12:01:43 UTC
Created attachment 23493 [details]
patch for PDFGraphics2D.writeClip(Shape)

The current implementation of writeClip(Shape) of PDFGraphics2D checks whether the given clipping shape is empty. But if the shape has no points (i.e. shape.getPathIterator(...).isDone() returns true) there will only the instructions W n written to the pdf page content stream.
The attached patch will fix this by checking if the PathIterator has at least one segment. If not, it will return without doing anything.
Comment 1 Jeremias Maerki 2009-04-20 00:02:28 UTC
Thanks for the patch, Francois. Committed: http://svn.apache.org/viewvc?rev=766596&view=rev

Changes to your patch:
- replaced tab character with spaces.
Comment 2 Glenn Adams 2012-04-01 07:06:18 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed