You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2014/06/20 16:51:44 UTC

svn commit: r1604181 - in /pdfbox/trunk: app/pom.xml parent/pom.xml pdfbox/pom.xml pdfbox/src/main/java/org/apache/pdfbox/text/ICU4JImpl.java pdfbox/src/main/java/org/apache/pdfbox/text/TextNormalize.java

Author: lehmi
Date: Fri Jun 20 14:51:44 2014
New Revision: 1604181

URL: http://svn.apache.org/r1604181
Log:
PDFBOX-2118: removed TextNormalizer#makeLineLogicalOrder, removed ICU4J dependency

Removed:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/ICU4JImpl.java
Modified:
    pdfbox/trunk/app/pom.xml
    pdfbox/trunk/parent/pom.xml
    pdfbox/trunk/pdfbox/pom.xml
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextNormalize.java

Modified: pdfbox/trunk/app/pom.xml
URL: http://svn.apache.org/viewvc/pdfbox/trunk/app/pom.xml?rev=1604181&r1=1604180&r2=1604181&view=diff
==============================================================================
--- pdfbox/trunk/app/pom.xml (original)
+++ pdfbox/trunk/app/pom.xml Fri Jun 20 14:51:44 2014
@@ -49,11 +49,6 @@
       <artifactId>bcprov-jdk15on</artifactId>
       <scope>provided</scope>
     </dependency>
-    <dependency>
-      <groupId>com.ibm.icu</groupId>
-      <artifactId>icu4j</artifactId>
-      <scope>provided</scope>
-    </dependency>
   </dependencies>
 
   <build>

Modified: pdfbox/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/pdfbox/trunk/parent/pom.xml?rev=1604181&r1=1604180&r2=1604181&view=diff
==============================================================================
--- pdfbox/trunk/parent/pom.xml (original)
+++ pdfbox/trunk/parent/pom.xml Fri Jun 20 14:51:44 2014
@@ -83,11 +83,6 @@
                 <version>1.50</version>
             </dependency>
             <dependency>
-                <groupId>com.ibm.icu</groupId>
-                <artifactId>icu4j</artifactId>
-                <version>53.1</version>
-            </dependency>
-            <dependency>
                 <groupId>log4j</groupId>
                 <artifactId>log4j</artifactId>
                 <version>1.2.17</version>

Modified: pdfbox/trunk/pdfbox/pom.xml
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/pom.xml?rev=1604181&r1=1604180&r2=1604181&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/pom.xml (original)
+++ pdfbox/trunk/pdfbox/pom.xml Fri Jun 20 14:51:44 2014
@@ -57,11 +57,6 @@
             <optional>true</optional>
         </dependency>
         <dependency>
-            <groupId>com.ibm.icu</groupId>
-            <artifactId>icu4j</artifactId>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextNormalize.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextNormalize.java?rev=1604181&r1=1604180&r2=1604181&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextNormalize.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextNormalize.java Fri Jun 20 14:51:44 2014
@@ -22,7 +22,6 @@ import java.util.HashMap;
 
 /**
  * This class allows a caller to normalize text in various ways.
- * It will load the ICU4J jar file if it is defined on the classpath.
  * 
  * @author Brian Carrier
  */
@@ -72,7 +71,6 @@ public class TextNormalize
         return map;
     }
 
-    private ICU4JImpl icu4j = null;
     private String outputEncoding;
 
     /**
@@ -81,47 +79,9 @@ public class TextNormalize
      */
     public TextNormalize(String encoding)
     {
-        findICU4J();
         outputEncoding = encoding;
     }
 
-    private void findICU4J()
-    {
-        // see if we can load the icu4j classes from the classpath
-        try
-        {
-            this.getClass().getClassLoader().loadClass("com.ibm.icu.text.Bidi");
-            this.getClass().getClassLoader().loadClass("com.ibm.icu.text.Normalizer");
-            icu4j = new ICU4JImpl();
-        }
-        catch (ClassNotFoundException e)
-        {
-            icu4j = null;
-        }
-    }
-
-    /**
-     * Takes a line of text in presentation order and converts it to logical order. For most text
-     * other than Arabic and Hebrew, the presentation and logical orders are the same. However, for
-     * Arabic and Hebrew, they are different and if the text involves both RTL and LTR text then the
-     * Unicode BIDI algorithm must be used to determine how to map  between them.
-     * 
-     * @param str Presentation form of line to convert (i.e. left most char is first char)
-     * @param isRtlDominant true if the PAGE has a dominant right to left ordering
-     * @return Logical form of string (or original string if ICU4J library is not on classpath)
-     */
-    public String makeLineLogicalOrder(String str, boolean isRtlDominant)
-    {
-        if (icu4j != null)
-        {
-            return icu4j.makeLineLogicalOrder(str, isRtlDominant);
-        }
-        else
-        {
-            return str;
-        }
-    }
-
     /**
      * Normalize the presentation forms of characters in the string. For example, convert the
      * single "fi" ligature to "f" and "i".