Bug 35202 - SVGGraphics2D.stream(*) corrupts created document.
Summary: SVGGraphics2D.stream(*) corrupts created document.
Status: NEW
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: SVGGraphics2D (show other bugs)
Version: 1.5
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-03 15:05 UTC by Chaker Nakhli
Modified: 2005-06-03 07:05 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chaker Nakhli 2005-06-03 15:05:53 UTC
The document created with an SVGGraphics2D object is corrupted(becomes empty)
after invoking SVGGraphics.stream(*) methods.The document must be explicitly set
to root before streaming (using SVGGraphics2D.getRoot(Document ) ) unless it's
lost. If this is the correct behavior, please update Javadoc (see bug 31625).

Code example:

 Document doc = ... ; // create a document with a dom implementation
 SVGGraphics2D svgG2d = new SVGGraphics2D(doc);
 
 //render into SVGGraphics2D object
 svgG2d.setPaint(...); svgG2d.fill(...) ....


 //stream the created Document, it works fine the first invocation
 svgG2d.stream(out, true); //out is a Writer

 //BUG-- spits an empty document. the created document is lost.
 svgG2d.stream(out,true);


remark:

  To fix this problem, one can add the following code before streaming the document:

  Element root = doc.getDocumentElement();
  svgG2d.getRoot(root);