pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1726882 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
Date Tue, 26 Jan 2016 20:27:35 GMT
Author: tilman
Date: Tue Jan 26 20:27:35 2016
New Revision: 1726882

URL: http://svn.apache.org/viewvc?rev=1726882&view=rev
Log:
PDFBOX-2852: replace deprecated calls

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java?rev=1726882&r1=1726881&r2=1726882&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
Tue Jan 26 20:27:35 2016
@@ -103,7 +103,7 @@ public class PDFormXObject extends PDXOb
      */
     public int getFormType()
     {
-        return getCOSStream().getInt(COSName.FORMTYPE, 1);
+        return getCOSObject().getInt(COSName.FORMTYPE, 1);
     }
 
     /**
@@ -112,7 +112,7 @@ public class PDFormXObject extends PDXOb
      */
     public void setFormType(int formType)
     {
-        getCOSStream().setInt(COSName.FORMTYPE, formType);
+        getCOSObject().setInt(COSName.FORMTYPE, formType);
     }
 
     /**
@@ -124,7 +124,7 @@ public class PDFormXObject extends PDXOb
     {
         if( group == null ) 
         {
-            COSDictionary dic = (COSDictionary) getCOSStream().getDictionaryObject(COSName.GROUP);
+            COSDictionary dic = (COSDictionary) getCOSObject().getDictionaryObject(COSName.GROUP);
             if( dic != null ) 
             {
                 group = new PDTransparencyGroupAttributes(dic);
@@ -135,13 +135,13 @@ public class PDFormXObject extends PDXOb
     
     public PDStream getContentStream()
     {
-        return new PDStream(getCOSStream());
+        return new PDStream(getCOSObject());
     }
 
     @Override
     public InputStream getContents() throws IOException
     {
-        return getCOSStream().createInputStream();
+        return getCOSObject().createInputStream();
     }
 
     /**
@@ -153,7 +153,7 @@ public class PDFormXObject extends PDXOb
     @Override
     public PDResources getResources()
     {
-        COSDictionary resources = (COSDictionary) getCOSStream().getDictionaryObject(COSName.RESOURCES);
+        COSDictionary resources = (COSDictionary) getCOSObject().getDictionaryObject(COSName.RESOURCES);
         if (resources != null)
         {
             return new PDResources(resources, cache);
@@ -167,7 +167,7 @@ public class PDFormXObject extends PDXOb
      */
     public void setResources(PDResources resources)
     {
-        getCOSStream().setItem(COSName.RESOURCES, resources);
+        getCOSObject().setItem(COSName.RESOURCES, resources);
     }
 
     /**
@@ -181,7 +181,7 @@ public class PDFormXObject extends PDXOb
     public PDRectangle getBBox()
     {
         PDRectangle retval = null;
-        COSArray array = (COSArray) getCOSStream().getDictionaryObject(COSName.BBOX);
+        COSArray array = (COSArray) getCOSObject().getDictionaryObject(COSName.BBOX);
         if (array != null)
         {
             retval = new PDRectangle(array);
@@ -197,11 +197,11 @@ public class PDFormXObject extends PDXOb
     {
         if (bbox == null)
         {
-            getCOSStream().removeItem(COSName.BBOX);
+            getCOSObject().removeItem(COSName.BBOX);
         }
         else
         {
-            getCOSStream().setItem(COSName.BBOX, bbox.getCOSArray());
+            getCOSObject().setItem(COSName.BBOX, bbox.getCOSArray());
         }
     }
 
@@ -212,7 +212,7 @@ public class PDFormXObject extends PDXOb
     @Override
     public Matrix getMatrix()
     {
-        COSArray array = (COSArray) getCOSStream().getDictionaryObject(COSName.MATRIX);
+        COSArray array = (COSArray) getCOSObject().getDictionaryObject(COSName.MATRIX);
         if (array != null)
         {
             return new Matrix(array);
@@ -237,7 +237,7 @@ public class PDFormXObject extends PDXOb
         {
             matrix.add(new COSFloat((float) v));
         }
-        getCOSStream().setItem(COSName.MATRIX, matrix);
+        getCOSObject().setItem(COSName.MATRIX, matrix);
     }
 
     /**
@@ -248,7 +248,7 @@ public class PDFormXObject extends PDXOb
      */
     public int getStructParents()
     {
-        return getCOSStream().getInt(COSName.STRUCT_PARENTS, 0);
+        return getCOSObject().getInt(COSName.STRUCT_PARENTS, 0);
     }
 
     /**
@@ -257,6 +257,6 @@ public class PDFormXObject extends PDXOb
      */
     public void setStructParents(int structParent)
     {
-        getCOSStream().setInt(COSName.STRUCT_PARENTS, structParent);
+        getCOSObject().setInt(COSName.STRUCT_PARENTS, structParent);
     }
 }



Mime
View raw message