pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1825231 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java
Date Sat, 24 Feb 2018 12:34:03 GMT
Author: msahyoun
Date: Sat Feb 24 12:34:03 2018
New Revision: 1825231

URL: http://svn.apache.org/viewvc?rev=1825231&view=rev
Log:
PDFBOX-4125: getValue() either returns String or Array - adjust writeXML to deal with that

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java?rev=1825231&r1=1825230&r2=1825231&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java Sat Feb
24 12:34:03 2018
@@ -117,17 +117,12 @@ public class FDFField implements COSObje
     {
         output.write("<field name=\"" + getPartialFieldName() + "\">\n");
         Object value = getValue();
-        if (value != null)
+
+        if (value instanceof String)
         {
-            if (value instanceof COSString)
-            {
-                output.write("<value>" + escapeXML(((COSString) value).getString())
+ "</value>\n");
-            }
-            else if (value instanceof COSStream)
-            {
-                output.write("<value>" + escapeXML(((COSStream) value).toTextString())
+ "</value>\n");
-            }
+            output.write("<value>" + escapeXML((String) value) + "</value>\n");
         }
+
         String rt = getRichText();
         if (rt != null)
         {



Mime
View raw message