From 82e13b4659fc22daee22fb1c2cf373177cc9785c Mon Sep 17 00:00:00 2001 From: Simon Pepping Date: Tue, 19 Jul 2011 19:13:01 +0000 Subject: [PATCH] A few edits git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts@1148489 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fonts/DefaultScriptProcessor.java | 2 -- .../apache/fop/fonts/DevanagariScriptProcessor.java | 2 +- .../org/apache/fop/fonts/IndicScriptProcessor.java | 12 +++++------- src/java/org/apache/fop/fonts/ScriptProcessor.java | 6 ++---- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/java/org/apache/fop/fonts/DefaultScriptProcessor.java b/src/java/org/apache/fop/fonts/DefaultScriptProcessor.java index 61df47f98..fdd528a0f 100644 --- a/src/java/org/apache/fop/fonts/DefaultScriptProcessor.java +++ b/src/java/org/apache/fop/fonts/DefaultScriptProcessor.java @@ -19,8 +19,6 @@ package org.apache.fop.fonts; -import java.util.Map; - // CSOFF: LineLengthCheck /** diff --git a/src/java/org/apache/fop/fonts/DevanagariScriptProcessor.java b/src/java/org/apache/fop/fonts/DevanagariScriptProcessor.java index 544b04d53..e2bb3e219 100644 --- a/src/java/org/apache/fop/fonts/DevanagariScriptProcessor.java +++ b/src/java/org/apache/fop/fonts/DevanagariScriptProcessor.java @@ -44,7 +44,7 @@ public class DevanagariScriptProcessor extends IndicScriptProcessor { } @Override - protected Class getSyllabizerClass() { + protected Class getSyllabizerClass() { return DevanagariSyllabizer.class; } diff --git a/src/java/org/apache/fop/fonts/IndicScriptProcessor.java b/src/java/org/apache/fop/fonts/IndicScriptProcessor.java index c4b31e283..168a0c200 100644 --- a/src/java/org/apache/fop/fonts/IndicScriptProcessor.java +++ b/src/java/org/apache/fop/fonts/IndicScriptProcessor.java @@ -207,7 +207,7 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { * Get script specific syllabizer class. * @return a syllabizer class object or null */ - protected Class getSyllabizerClass() { + protected Class getSyllabizerClass() { return null; } @@ -391,9 +391,7 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { if ( o instanceof Syllabizer ) { Syllabizer s = (Syllabizer) o; if ( ( d = script.compareTo ( s.script ) ) == 0 ) { - if ( ( d = language.compareTo ( s.language ) ) == 0 ) { - d = 0; - } + d = language.compareTo ( s.language ); } } else { d = -1; @@ -401,7 +399,7 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { return d; } private static Map syllabizers = new HashMap(); - static Syllabizer getSyllabizer ( String script, String language, Class syllabizerClass ) { + static Syllabizer getSyllabizer ( String script, String language, Class syllabizerClass ) { String sid = makeSyllabizerId ( script, language ); Syllabizer s = syllabizers.get ( sid ); if ( s == null ) { @@ -415,10 +413,10 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { static String makeSyllabizerId ( String script, String language ) { return script + ":" + language; } - static Syllabizer makeSyllabizer ( String script, String language, Class syllabizerClass ) { + static Syllabizer makeSyllabizer ( String script, String language, Class syllabizerClass ) { Syllabizer s; try { - Constructor cf = syllabizerClass.getDeclaredConstructor ( new Class[] { String.class, String.class } ); + Constructor cf = syllabizerClass.getDeclaredConstructor ( new Class[] { String.class, String.class } ); s = (Syllabizer) cf.newInstance ( script, language ); } catch ( NoSuchMethodException e ) { s = null; diff --git a/src/java/org/apache/fop/fonts/ScriptProcessor.java b/src/java/org/apache/fop/fonts/ScriptProcessor.java index 601a27053..8fabe6028 100644 --- a/src/java/org/apache/fop/fonts/ScriptProcessor.java +++ b/src/java/org/apache/fop/fonts/ScriptProcessor.java @@ -19,9 +19,7 @@ package org.apache.fop.fonts; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.apache.fop.util.CharUtilities; @@ -39,7 +37,7 @@ public abstract class ScriptProcessor { private final String script; - private static Map processors = new HashMap(); + private static Map processors = new HashMap(); /** * Instantiate a script processor. @@ -207,7 +205,7 @@ public abstract class ScriptProcessor { public static synchronized ScriptProcessor getInstance ( String script ) { ScriptProcessor sp = null; assert processors != null; - if ( ( sp = (ScriptProcessor) processors.get ( script ) ) == null ) { + if ( ( sp = processors.get ( script ) ) == null ) { processors.put ( script, sp = createProcessor ( script ) ); } return sp; -- 2.39.5