Browse Source

Some fixes for SVG along the way:

Fix for group nesting.
Fix for reused content (metadata etc.) cause exceptions.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@686227 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Jeremias Maerki 16 years ago
parent
commit
18c9e7a523

+ 1
- 0
src/sandbox/org/apache/fop/render/svg/AbstractSVGPainter.java View File

@@ -193,6 +193,7 @@ public abstract class AbstractSVGPainter extends AbstractXMLWritingIFPainter
/** {@inheritDoc} */
public void endGroup() throws IFException {
try {
establish(MODE_NORMAL);
endElement("g");
} catch (SAXException e) {
throw new IFException("SAX error in endGroup()", e);

+ 15
- 0
src/sandbox/org/apache/fop/render/svg/SVGPainter.java View File

@@ -109,6 +109,9 @@ public class SVGPainter extends AbstractSVGPainter {
TransformerHandler toDOMHandler = tFactory.newTransformerHandler();
toDOMHandler.setResult(new DOMResult(this.reusedParts));
this.handler = toDOMHandler;
this.handler.startDocument();
} catch (SAXException se) {
throw new IFException("SAX error in startDocument()", se);
} catch (TransformerConfigurationException e) {
throw new IFException(
"Error while setting up a TransformerHandler for SVG generation", e);
@@ -120,6 +123,18 @@ public class SVGPainter extends AbstractSVGPainter {
//nop
}

/** {@inheritDoc} */
public void endDocumentHeader() throws IFException {
super.endDocumentHeader();
try {
//Stop recording parts reused for each page
this.handler.endDocument();
this.handler = null;
} catch (SAXException e) {
throw new IFException("SAX error in endDocumentHeader()", e);
}
}

/** {@inheritDoc} */
public void startPageSequence(String id) throws IFException {
//nop

Loading…
Cancel
Save