You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2015/05/02 13:29:55 UTC
svn commit: r1677305 - in
/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf:
PDLayoutAttributeObject.java PDStandardAttributeObject.java
Author: tilman
Date: Sat May 2 11:29:55 2015
New Revision: 1677305
URL: http://svn.apache.org/r1677305
Log:
PDFBOX-2783: Use getCOSObject() instead of getCOSDictionary()
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDLayoutAttributeObject.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDLayoutAttributeObject.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDLayoutAttributeObject.java?rev=1677305&r1=1677304&r2=1677305&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDLayoutAttributeObject.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDLayoutAttributeObject.java Sat May 2 11:29:55 2015
@@ -389,7 +389,7 @@ public class PDLayoutAttributeObject ext
* <li>{@link #PLACEMENT_BEFORE},</li>
* <li>{@link #PLACEMENT_START},</li>
* <li>{@link #PLACEMENT_END}.</li>
- * <ul>
+ * </ul>
*
* @param placement the placement
*/
@@ -841,7 +841,7 @@ public class PDLayoutAttributeObject ext
public PDRectangle getBBox()
{
COSArray array =
- (COSArray) this.getCOSDictionary().getDictionaryObject(BBOX);
+ (COSArray) this.getCOSObject().getDictionaryObject(BBOX);
if (array != null)
{
return new PDRectangle(array);
@@ -857,8 +857,8 @@ public class PDLayoutAttributeObject ext
public void setBBox(PDRectangle bbox)
{
String name = BBOX;
- COSBase oldValue = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setItem(name, bbox);
+ COSBase oldValue = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setItem(name, bbox);
COSBase newValue = bbox == null ? null : bbox.getCOSObject();
this.potentiallyNotifyChanged(oldValue, newValue);
}
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java?rev=1677305&r1=1677304&r2=1677305&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java Sat May 2 11:29:55 2015
@@ -61,7 +61,7 @@ public abstract class PDStandardAttribut
*/
public boolean isSpecified(String name)
{
- return this.getCOSDictionary().getDictionaryObject(name) != null;
+ return this.getCOSObject().getDictionaryObject(name) != null;
}
@@ -73,7 +73,7 @@ public abstract class PDStandardAttribut
*/
protected String getString(String name)
{
- return this.getCOSDictionary().getString(name);
+ return this.getCOSObject().getString(name);
}
/**
@@ -84,9 +84,9 @@ public abstract class PDStandardAttribut
*/
protected void setString(String name, String value)
{
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setString(name, value);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setString(name, value);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -98,7 +98,7 @@ public abstract class PDStandardAttribut
*/
protected String[] getArrayOfString(String name)
{
- COSBase v = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase v = this.getCOSObject().getDictionaryObject(name);
if (v instanceof COSArray)
{
COSArray array = (COSArray) v;
@@ -120,14 +120,14 @@ public abstract class PDStandardAttribut
*/
protected void setArrayOfString(String name, String[] values)
{
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
COSArray array = new COSArray();
for (String value : values)
{
array.add(new COSString(value));
}
- this.getCOSDictionary().setItem(name, array);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ this.getCOSObject().setItem(name, array);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -139,7 +139,7 @@ public abstract class PDStandardAttribut
*/
protected String getName(String name)
{
- return this.getCOSDictionary().getNameAsString(name);
+ return this.getCOSObject().getNameAsString(name);
}
/**
@@ -151,7 +151,7 @@ public abstract class PDStandardAttribut
*/
protected String getName(String name, String defaultValue)
{
- return this.getCOSDictionary().getNameAsString(name, defaultValue);
+ return this.getCOSObject().getNameAsString(name, defaultValue);
}
/**
@@ -163,7 +163,7 @@ public abstract class PDStandardAttribut
*/
protected Object getNameOrArrayOfName(String name, String defaultValue)
{
- COSBase v = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase v = this.getCOSObject().getDictionaryObject(name);
if (v instanceof COSArray)
{
COSArray array = (COSArray) v;
@@ -193,9 +193,9 @@ public abstract class PDStandardAttribut
*/
protected void setName(String name, String value)
{
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setName(name, value);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setName(name, value);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -207,14 +207,14 @@ public abstract class PDStandardAttribut
*/
protected void setArrayOfName(String name, String[] values)
{
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
COSArray array = new COSArray();
for (String value : values)
{
array.add(COSName.getPDFName(value));
}
- this.getCOSDictionary().setItem(name, array);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ this.getCOSObject().setItem(name, array);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -227,7 +227,7 @@ public abstract class PDStandardAttribut
*/
protected Object getNumberOrName(String name, String defaultValue)
{
- COSBase value = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase value = this.getCOSObject().getDictionaryObject(name);
if (value instanceof COSNumber)
{
return ((COSNumber) value).floatValue();
@@ -248,7 +248,7 @@ public abstract class PDStandardAttribut
*/
protected int getInteger(String name, int defaultValue)
{
- return this.getCOSDictionary().getInt(name, defaultValue);
+ return this.getCOSObject().getInt(name, defaultValue);
}
/**
@@ -259,9 +259,9 @@ public abstract class PDStandardAttribut
*/
protected void setInteger(String name, int value)
{
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setInt(name, value);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setInt(name, value);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -274,7 +274,7 @@ public abstract class PDStandardAttribut
*/
protected float getNumber(String name, float defaultValue)
{
- return this.getCOSDictionary().getFloat(name, defaultValue);
+ return this.getCOSObject().getFloat(name, defaultValue);
}
/**
@@ -285,7 +285,7 @@ public abstract class PDStandardAttribut
*/
protected float getNumber(String name)
{
- return this.getCOSDictionary().getFloat(name);
+ return this.getCOSObject().getFloat(name);
}
/**
@@ -302,7 +302,7 @@ public abstract class PDStandardAttribut
*/
protected Object getNumberOrArrayOfNumber(String name, float defaultValue)
{
- COSBase v = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase v = this.getCOSObject().getDictionaryObject(name);
if (v instanceof COSArray)
{
COSArray array = (COSArray) v;
@@ -336,9 +336,9 @@ public abstract class PDStandardAttribut
*/
protected void setNumber(String name, float value)
{
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setFloat(name, value);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setFloat(name, value);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -350,9 +350,9 @@ public abstract class PDStandardAttribut
*/
protected void setNumber(String name, int value)
{
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setInt(name, value);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setInt(name, value);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -369,9 +369,9 @@ public abstract class PDStandardAttribut
{
array.add(new COSFloat(values[i]));
}
- COSBase oldBase = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setItem(name, array);
- COSBase newBase = this.getCOSDictionary().getDictionaryObject(name);
+ COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setItem(name, array);
+ COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
@@ -383,7 +383,7 @@ public abstract class PDStandardAttribut
*/
protected PDGamma getColor(String name)
{
- COSArray c = (COSArray) this.getCOSDictionary().getDictionaryObject(name);
+ COSArray c = (COSArray) this.getCOSObject().getDictionaryObject(name);
if (c != null)
{
return new PDGamma(c);
@@ -400,7 +400,7 @@ public abstract class PDStandardAttribut
protected Object getColorOrFourColors(String name)
{
COSArray array =
- (COSArray) this.getCOSDictionary().getDictionaryObject(name);
+ (COSArray) this.getCOSObject().getDictionaryObject(name);
if (array == null)
{
return null;
@@ -425,8 +425,8 @@ public abstract class PDStandardAttribut
*/
protected void setColor(String name, PDGamma value)
{
- COSBase oldValue = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setItem(name, value);
+ COSBase oldValue = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setItem(name, value);
COSBase newValue = value == null ? null : value.getCOSObject();
this.potentiallyNotifyChanged(oldValue, newValue);
}
@@ -439,8 +439,8 @@ public abstract class PDStandardAttribut
*/
protected void setFourColors(String name, PDFourColours value)
{
- COSBase oldValue = this.getCOSDictionary().getDictionaryObject(name);
- this.getCOSDictionary().setItem(name, value);
+ COSBase oldValue = this.getCOSObject().getDictionaryObject(name);
+ this.getCOSObject().setItem(name, value);
COSBase newValue = value == null ? null : value.getCOSObject();
this.potentiallyNotifyChanged(oldValue, newValue);
}