diff options
Diffstat (limited to 'src/java/org/apache/fop/complexscripts')
-rw-r--r-- | src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java | 22 | ||||
-rw-r--r-- | src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java | 2 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java b/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java index f1a4d2a69..e458e781c 100644 --- a/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java +++ b/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java @@ -57,7 +57,17 @@ public final class BidiResolver { if (log.isDebugEnabled()) { log.debug("BD: RESOLVE: " + ps); } - List ranges = pruneEmptyRanges(ps.collectDelimitedTextRanges(new Stack())); + // 1. collect delimited text ranges + List ranges = ps.collectDelimitedTextRanges(new Stack()); + if (log.isDebugEnabled()) { + dumpRanges("BD: RESOLVE: RANGES:", ranges); + } + // 2. prune empty ranges + ranges = pruneEmptyRanges(ranges); + if (log.isDebugEnabled()) { + dumpRanges("BD: RESOLVE: PRUNED RANGES:", ranges); + } + // 3. resolve inline directionaly of unpruned ranges resolveInlineDirectionality(ranges); } @@ -223,8 +233,14 @@ public final class BidiResolver { log.debug(ir); } } - - private static List pruneEmptyRanges(Stack ranges) { + private static void dumpRanges(String header, List ranges) { + log.debug(header); + for (Iterator it = ranges.iterator(); it.hasNext(); ) { + DelimitedTextRange r = (DelimitedTextRange) it.next(); + log.debug(r); + } + } + private static List pruneEmptyRanges(List ranges) { Vector rv = new Vector(); for (Iterator it = ranges.iterator(); it.hasNext(); ) { DelimitedTextRange r = (DelimitedTextRange) it.next(); diff --git a/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java b/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java index 694cc9245..6b47450b7 100644 --- a/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java +++ b/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java @@ -38,7 +38,7 @@ public final class UnicodeBidiAlgorithm implements BidiConstants { /** * logging instance */ - private static final Log log = LogFactory.getLog(BidiResolver.class); + private static final Log log = LogFactory.getLog(UnicodeBidiAlgorithm.class); private UnicodeBidiAlgorithm() { } |