pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1653981 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
Date Thu, 22 Jan 2015 18:10:01 GMT
Author: tilman
Date: Thu Jan 22 18:10:00 2015
New Revision: 1653981

URL: http://svn.apache.org/r1653981
Log:
PDFBOX-2622: allow /BS as indirect object

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java?rev=1653981&r1=1653980&r2=1653981&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
Thu Jan 22 18:10:00 2015
@@ -111,12 +111,11 @@ public class PDAnnotationLink extends PD
      * pattern used in drawing the line.
      *
      * @param bs the border style dictionary to set.
-     * TODO not all annotations may have a BS entry
      *
      */
     public void setBorderStyle( PDBorderStyleDictionary bs )
     {
-        this.getDictionary().setItem( "BS", bs);
+        this.getDictionary().setItem(COSName.BS, bs);
     }
 
     /**
@@ -124,15 +123,13 @@ public class PDAnnotationLink extends PD
      * dash pattern used in drawing the line.
      *
      * @return the border style dictionary.
-     * TODO not all annotations may have a BS entry
      */
     public PDBorderStyleDictionary getBorderStyle()
     {
-        COSDictionary bs = (COSDictionary) this.getDictionary().getItem(
-                COSName.getPDFName( "BS" ) );
-        if (bs != null)
+        COSBase bs = this.getDictionary().getDictionaryObject(COSName.BS);
+        if (bs instanceof COSDictionary)
         {
-            return new PDBorderStyleDictionary( bs );
+            return new PDBorderStyleDictionary((COSDictionary) bs);
         }
         else
         {



Mime
View raw message