pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1758817 - in /pdfbox/trunk/pdfbox/src: main/java/org/apache/pdfbox/pdmodel/interactive/form/PlainText.java test/java/org/apache/pdfbox/pdmodel/interactive/form/ControlCharacterTest.java
Date Thu, 01 Sep 2016 17:35:46 GMT
Author: msahyoun
Date: Thu Sep  1 17:35:46 2016
New Revision: 1758817

URL: http://svn.apache.org/viewvc?rev=1758817&view=rev
Log:
PDFBOX-3165: replace Tab character with space. Proper handling to follow in PDFBOX-3469

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PlainText.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/ControlCharacterTest.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PlainText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PlainText.java?rev=1758817&r1=1758816&r2=1758817&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PlainText.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PlainText.java
Thu Sep  1 17:35:46 2016
@@ -51,7 +51,7 @@ class PlainText
      */
     PlainText(String textValue)
     {
-        List<String> parts = Arrays.asList(textValue.split("\\r\\n|\\n|\\r|\\u2028|\\u2029"));
+        List<String> parts = Arrays.asList(textValue.replaceAll("\t", " ").split("\\r\\n|\\n|\\r|\\u2028|\\u2029"));
         paragraphs = new ArrayList<Paragraph>();
         for (String part : parts)
         {

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/ControlCharacterTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/ControlCharacterTest.java?rev=1758817&r1=1758816&r2=1758817&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/ControlCharacterTest.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/ControlCharacterTest.java
Thu Sep  1 17:35:46 2016
@@ -76,7 +76,7 @@ public class ControlCharacterTest {
     	acroForm.getField("pdfbox-nul").setValue("NUL\0NUL");
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test
     public void characterTAB() throws IOException
     {
     	acroForm.getField("pdfbox-tab").setValue("TAB\tTAB");



Mime
View raw message