From 9ef58f47298a2fb14d866e296f1c8b47607e236e Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 14 Jan 2008 11:02:34 +0000 Subject: Restore default constructor for PDFArray. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@611767 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/pdf/PDFArray.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/java/org/apache') diff --git a/src/java/org/apache/fop/pdf/PDFArray.java b/src/java/org/apache/fop/pdf/PDFArray.java index 2cb2adb1d..ec713b313 100644 --- a/src/java/org/apache/fop/pdf/PDFArray.java +++ b/src/java/org/apache/fop/pdf/PDFArray.java @@ -45,6 +45,13 @@ public class PDFArray extends PDFObject { super(parent); } + /** + * Create a new, empty array object with no parent. + */ + public PDFArray() { + this(null); + } + /** * Create an array object. * @param parent the array's parent if any @@ -120,22 +127,14 @@ public class PDFArray extends PDFObject { return this.values.get(index); } - /** - * Adds a new value to the array. - * @param obj the value - */ - public void add(PDFObject obj) { - if (obj != null) { - obj.setParent(this); - } - this.values.add(obj); - } - /** * Adds a new value to the array. * @param obj the value */ public void add(Object obj) { + if (obj instanceof PDFObject) { + ((PDFObject)obj).setParent(this); + } this.values.add(obj); } -- cgit v1.2.3