diff options
author | Glenn Adams <gadams@apache.org> | 2014-07-06 23:46:18 +0000 |
---|---|---|
committer | Glenn Adams <gadams@apache.org> | 2014-07-06 23:46:18 +0000 |
commit | 6ebc570ad4891b338192c2e2900424c8445efc86 (patch) | |
tree | 12db084b6a5acebab4467eac453f697a29f53752 /src/java/org/apache/fop/complexscripts/bidi | |
parent | e7015eb126ea5a302045a207e565edde4f239898 (diff) | |
download | xmlgraphics-fop-6ebc570ad4891b338192c2e2900424c8445efc86.tar.gz xmlgraphics-fop-6ebc570ad4891b338192c2e2900424c8445efc86.zip |
FOP 2388: Fix Arabic text left justified on the first cell of a table with writing mode rl-tb.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1608314 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/complexscripts/bidi')
-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() { } |