aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-02-16 10:10:38 +0000
committerJeremias Maerki <jeremias@apache.org>2009-02-16 10:10:38 +0000
commit952af34e4941903c48ec3cb982d6893ff857ab0e (patch)
treec65d26aea11e5b49269b59628ee938ee636f0e41
parent8f75d04af016452a77111bfe7ad7ebfcde0fe4dd (diff)
downloadxmlgraphics-fop-952af34e4941903c48ec3cb982d6893ff857ab0e.tar.gz
xmlgraphics-fop-952af34e4941903c48ec3cb982d6893ff857ab0e.zip
Fixed copy/paste mistakes.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@744874 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/render/afp/AFPDocumentHandler.java8
-rw-r--r--src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java9
-rw-r--r--src/java/org/apache/fop/render/intermediate/AbstractBinaryWritingIFDocumentHandler.java8
-rw-r--r--src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java8
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFSerializer.java1
-rw-r--r--src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java9
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java8
-rw-r--r--src/java/org/apache/fop/render/ps/PSDocumentHandler.java8
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java1
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java1
10 files changed, 24 insertions, 37 deletions
diff --git a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
index b2a1b3a3b..8391422ff 100644
--- a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
+++ b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
@@ -128,14 +128,8 @@ public class AFPDocumentHandler extends AbstractBinaryWritingIFDocumentHandler
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
try {
- if (getUserAgent() == null) {
- throw new IllegalStateException(
- "User agent must be set before starting PostScript generation");
- }
- if (this.outputStream == null) {
- throw new IllegalStateException("OutputStream hasn't been set through setResult()");
- }
paintingState.setColor(Color.WHITE);
this.dataStream = resourceManager.createDataStream(paintingState, outputStream);
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
index a7f0a185f..81f8bdee7 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
@@ -111,15 +111,8 @@ public class TIFFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
try {
- if (getUserAgent() == null) {
- throw new IllegalStateException(
- "User agent must be set before starting PDF generation");
- }
- if (this.outputStream == null) {
- throw new IllegalStateException("OutputStream hasn't been set through setResult()");
- }
-
// Creates writer
this.imageWriter = ImageWriterRegistry.getInstance().getWriterFor(getMimeType());
if (this.imageWriter == null) {
diff --git a/src/java/org/apache/fop/render/intermediate/AbstractBinaryWritingIFDocumentHandler.java b/src/java/org/apache/fop/render/intermediate/AbstractBinaryWritingIFDocumentHandler.java
index 758b18dbb..a362d0fb5 100644
--- a/src/java/org/apache/fop/render/intermediate/AbstractBinaryWritingIFDocumentHandler.java
+++ b/src/java/org/apache/fop/render/intermediate/AbstractBinaryWritingIFDocumentHandler.java
@@ -107,6 +107,14 @@ public abstract class AbstractBinaryWritingIFDocumentHandler extends AbstractIFD
}
/** {@inheritDoc} */
+ public void startDocument() throws IFException {
+ super.startDocument();
+ if (this.outputStream == null) {
+ throw new IllegalStateException("OutputStream hasn't been set through setResult()");
+ }
+ }
+
+ /** {@inheritDoc} */
public void endDocument() throws IFException {
if (this.ownOutputStream) {
IOUtils.closeQuietly(this.outputStream);
diff --git a/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java b/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java
index 2fb071e18..deefe0b94 100644
--- a/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java
+++ b/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java
@@ -64,6 +64,14 @@ public abstract class AbstractIFDocumentHandler implements IFDocumentHandler {
}
/** {@inheritDoc} */
+ public void startDocument() throws IFException {
+ if (getUserAgent() == null) {
+ throw new IllegalStateException(
+ "User agent must be set before starting document generation");
+ }
+ }
+
+ /** {@inheritDoc} */
public void startDocumentHeader() throws IFException {
//nop
}
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
index cccef80c6..5076a089f 100644
--- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
@@ -143,6 +143,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
try {
handler.startDocument();
handler.startPrefixMapping("", NAMESPACE);
diff --git a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
index bf067b1a4..e4923b2c3 100644
--- a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
+++ b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
@@ -125,15 +125,8 @@ public class PCLDocumentHandler extends AbstractBinaryWritingIFDocumentHandler
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
try {
- if (getUserAgent() == null) {
- throw new IllegalStateException(
- "User agent must be set before starting PDF generation");
- }
- if (this.outputStream == null) {
- throw new IllegalStateException("OutputStream hasn't been set through setResult()");
- }
- log.debug("Rendering areas to PCL...");
this.gen = new PCLGenerator(this.outputStream, getResolution());
if (!pclUtil.isPJLDisabled()) {
diff --git a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
index 901dc4473..b98b15d5e 100644
--- a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
@@ -120,14 +120,8 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
try {
- if (getUserAgent() == null) {
- throw new IllegalStateException(
- "User agent must be set before starting PDF generation");
- }
- if (this.outputStream == null) {
- throw new IllegalStateException("OutputStream hasn't been set through setResult()");
- }
this.pdfDoc = pdfUtil.setupPDFDocument(this.outputStream);
} catch (IOException e) {
throw new IFException("I/O error in startDocument()", e);
diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
index c3aac8cd8..1379651c8 100644
--- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
+++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
@@ -138,14 +138,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
try {
- if (getUserAgent() == null) {
- throw new IllegalStateException(
- "User agent must be set before starting PostScript generation");
- }
- if (this.outputStream == null) {
- throw new IllegalStateException("OutputStream hasn't been set through setResult()");
- }
OutputStream out;
if (psUtil.isOptimizeResources()) {
this.tempFile = File.createTempFile("fop", null);
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java
index 4012b7e97..a8ce2dd2b 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java
@@ -98,6 +98,7 @@ public class SVGDocumentHandler extends AbstractSVGDocumentHandler {
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
builderFactory.setNamespaceAware(true);
builderFactory.setValidating(false);
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java
index 25a7f3e7d..9746fe8ec 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java
@@ -65,6 +65,7 @@ public class SVGPrintDocumentHandler extends AbstractSVGDocumentHandler {
/** {@inheritDoc} */
public void startDocument() throws IFException {
+ super.startDocument();
try {
handler.startDocument();
handler.startPrefixMapping("", NAMESPACE);