xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r1466146 [3/20] - in /xmlgraphics/fop/trunk: ./ src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/ src/codegen/unicode/java/org/apache/fop/text/linebreak/ src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/modca/ src/java/or...
Date Tue, 09 Apr 2013 17:31:45 GMT
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java Tue Apr  9 17:31:41 2013
@@ -798,8 +798,8 @@ public class AreaTreeParser {
                     = XMLUtil.getAttributeAsPositionAdjustments(lastAttributes, "position-adjust");
                 content.flip();
                 WordArea word = new WordArea
-                    ( offset, level, content.toString().trim(), letterAdjust,
-                      null, gposAdjustments, reversed );
+                    (offset, level, content.toString().trim(), letterAdjust,
+                      null, gposAdjustments, reversed);
                 AbstractTextArea text = getCurrentText();
                 word.setParentArea(text);
                 text.addChildArea(word);
@@ -851,7 +851,7 @@ public class AreaTreeParser {
                 setTraits(attributes, leader, SUBSET_COLOR);
                 setTraits(attributes, leader, SUBSET_FONT);
                 leader.setBlockProgressionOffset
-                    ( XMLUtil.getAttributeAsInt(attributes, "offset", 0) );
+                    (XMLUtil.getAttributeAsInt(attributes, "offset", 0));
                 String ruleStyle = attributes.getValue("ruleStyle");
                 if (ruleStyle != null) {
                     leader.setRuleStyle(ruleStyle);
@@ -876,7 +876,7 @@ public class AreaTreeParser {
                 viewport.setContentPosition(XMLUtil.getAttributeAsRectangle2D(attributes, "pos"));
                 viewport.setClip(XMLUtil.getAttributeAsBoolean(attributes, "clip", false));
                 viewport.setBlockProgressionOffset
-                    ( XMLUtil.getAttributeAsInt(attributes, "offset", 0) );
+                    (XMLUtil.getAttributeAsInt(attributes, "offset", 0));
                 Area parent = (Area)areaStack.peek();
                 parent.addChildArea(viewport);
                 areaStack.push(viewport);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/BodyRegion.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/BodyRegion.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/BodyRegion.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/BodyRegion.java Tue Apr  9 17:31:41 2013
@@ -146,8 +146,8 @@ public class BodyRegion extends RegionRe
      * @param wmtg a WM traits getter
      */
     public void setWritingModeTraits(WritingModeTraitsGetter wmtg) {
-        if ( getMainReference() != null ) {
-            getMainReference().setWritingModeTraits ( wmtg );
+        if (getMainReference() != null) {
+            getMainReference().setWritingModeTraits (wmtg);
         }
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/CTM.java Tue Apr  9 17:31:41 2013
@@ -341,7 +341,7 @@ public class CTM implements Serializable
          * can set ipd and bpd appropriately based on the writing mode.
          */
 
-        switch ( writingMode.getEnumValue() ) {
+        switch (writingMode.getEnumValue()) {
         case EN_TB_LR:
         case EN_TB_RL:
             reldims.ipd = height;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java Tue Apr  9 17:31:41 2013
@@ -130,12 +130,12 @@ public class LineArea extends Area {
      * <p> Used by bidirectional processing after line area consituent reordering.</p>
      * @param inlineAreas the list of inline areas
      */
-    public void setInlineAreas ( List inlineAreas ) {
-        for ( Iterator<InlineArea> it = inlineAreas.iterator(); it.hasNext();) {
+    public void setInlineAreas (List inlineAreas) {
+        for (Iterator<InlineArea> it = inlineAreas.iterator(); it.hasNext();) {
             InlineArea ia = it.next();
             Area pa = ia.getParentArea();
-            if ( pa == null ) {
-                ia.setParentArea ( this );
+            if (pa == null) {
+                ia.setParentArea (this);
             } else {
                 assert pa == this;
             }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LinkResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LinkResolver.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LinkResolver.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LinkResolver.java Tue Apr  9 17:31:41 2013
@@ -80,7 +80,7 @@ public class LinkResolver implements Res
     public void resolveIDRef(String id, PageViewport pv) {
         if (idRef.equals(id) && pv != null) {
             resolved = true;
-            if ( area != null ) {
+            if (area != null) {
                 Trait.InternalLink iLink = new Trait.InternalLink(pv.getKey(), idRef);
                 area.addTrait(Trait.INTERNAL_LINK, iLink);
                 area = null; // break circular reference from basic link area to this resolver
@@ -95,17 +95,17 @@ public class LinkResolver implements Res
      * @param dependent resolvable
      */
     public void addDependent(Resolvable dependent) {
-        if ( dependents == null ) {
+        if (dependents == null) {
             dependents = new ArrayList<Resolvable>();
         }
         dependents.add(dependent);
     }
 
     private void resolveDependents(String id, PageViewport pv) {
-        if ( dependents != null ) {
+        if (dependents != null) {
             List<PageViewport> pages = new ArrayList<PageViewport>();
             pages.add(pv);
-            for ( Resolvable r : dependents ) {
+            for (Resolvable r : dependents) {
                 r.resolveIDRef(id, pages);
             }
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/MainReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/MainReference.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/MainReference.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/MainReference.java Tue Apr  9 17:31:41 2013
@@ -131,8 +131,8 @@ public class MainReference extends Area 
      * @param wmtg a WM traits getter
      */
     public void setWritingModeTraits(WritingModeTraitsGetter wmtg) {
-        for ( Span s : getSpans() ) {
-            s.setWritingModeTraits ( wmtg );
+        for (Span s : getSpans()) {
+            s.setWritingModeTraits (wmtg);
         }
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/PageViewport.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/PageViewport.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/PageViewport.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/PageViewport.java Tue Apr  9 17:31:41 2013
@@ -519,7 +519,7 @@ public class PageViewport extends AreaTr
      * @param wmtg a WM traits getter
      */
     public void setWritingModeTraits(WritingModeTraitsGetter wmtg) {
-        if ( page != null ) {
+        if (page != null) {
             page.setWritingModeTraits(wmtg);
         }
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Span.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Span.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Span.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Span.java Tue Apr  9 17:31:41 2013
@@ -193,16 +193,16 @@ public class Span extends Area {
      * @param wmtg a WM traits getter
      */
     public void setWritingModeTraits(WritingModeTraitsGetter wmtg) {
-        switch ( wmtg.getColumnProgressionDirection().getEnumValue() ) {
+        switch (wmtg.getColumnProgressionDirection().getEnumValue()) {
         case Constants.EN_RL:
             setBidiLevel(1);
-            for ( Iterator<NormalFlow> it = flowAreas.iterator(); it.hasNext();) {
+            for (Iterator<NormalFlow> it = flowAreas.iterator(); it.hasNext();) {
                 it.next().setBidiLevel(1);
             }
             break;
         default:
             resetBidiLevel();
-            for ( Iterator<NormalFlow> it = flowAreas.iterator(); it.hasNext();) {
+            for (Iterator<NormalFlow> it = flowAreas.iterator(); it.hasNext();) {
                 it.next().resetBidiLevel();
             }
             break;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java Tue Apr  9 17:31:41 2013
@@ -58,7 +58,7 @@ public class BasicLinkArea extends Inlin
      * @param resolver the link resolver that will resolve this basic link or null
      */
     public void setResolver(LinkResolver resolver) {
-        assert ( resolver == null ) || ( this.resolver == null );
+        assert (resolver == null) || (this.resolver == null);
         this.resolver = resolver;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java Tue Apr  9 17:31:41 2013
@@ -106,7 +106,7 @@ public class InlineArea extends Area {
      * Default constructor for inline area.
      */
     public InlineArea() {
-        this (  0, -1 );
+        this (0, -1);
     }
 
     /**
@@ -114,7 +114,7 @@ public class InlineArea extends Area {
      * @param blockProgressionOffset a block progression offset or zero
      * @param bidiLevel a resolved bidi level or -1
      */
-    protected InlineArea ( int blockProgressionOffset, int bidiLevel ) {
+    protected InlineArea (int blockProgressionOffset, int bidiLevel) {
         this.blockProgressionOffset = blockProgressionOffset;
         setBidiLevel(bidiLevel);
     }
@@ -311,9 +311,9 @@ public class InlineArea extends Area {
      * @param runs current list of inline runs
      * @return modified list of inline runs, having appended new run
      */
-    public List collectInlineRuns ( List runs ) {
+    public List collectInlineRuns (List runs) {
         assert runs != null;
-        runs.add ( new InlineRun ( this, new int[] {getBidiLevel()}) );
+        runs.add (new InlineRun (this, new int[] {getBidiLevel()}));
         return runs;
     }
 
@@ -322,8 +322,8 @@ public class InlineArea extends Area {
      * @param ia inline area to test
      * @return true if specified inline area is an ancestor or same as this area
      */
-    public boolean isAncestorOrSelf ( InlineArea ia ) {
-        return ( ia == this ) || isAncestor ( ia );
+    public boolean isAncestorOrSelf (InlineArea ia) {
+        return (ia == this) || isAncestor (ia);
     }
 
     /**
@@ -331,12 +331,12 @@ public class InlineArea extends Area {
      * @param ia inline area to test
      * @return true if specified inline area is an ancestor of this area
      */
-    public boolean isAncestor ( InlineArea ia ) {
-        for ( Area p = getParentArea(); p != null;) {
-            if ( p == ia ) {
+    public boolean isAncestor (InlineArea ia) {
+        for (Area p = getParentArea(); p != null;) {
+            if (p == ia) {
                 return true;
-            } else if ( p instanceof InlineArea ) {
-                p = ( (InlineArea) p ).getParentArea();
+            } else if (p instanceof InlineArea) {
+                p = ((InlineArea) p).getParentArea();
             } else {
                 p = null;
             }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java Tue Apr  9 17:31:41 2013
@@ -64,7 +64,7 @@ public class InlineParent extends Inline
         if (autoSize) {
             increaseIPD(childArea.getAllocIPD());
         }
-        updateLevel ( childArea.getBidiLevel() );
+        updateLevel (childArea.getBidiLevel());
         int childOffset = childArea.getVirtualOffset();
         minChildOffset = Math.min(minChildOffset, childOffset);
         maxAfterEdge = Math.max(maxAfterEdge, childOffset + childArea.getVirtualBPD());
@@ -114,10 +114,10 @@ public class InlineParent extends Inline
     }
 
     @Override
-    public List collectInlineRuns ( List runs ) {
-        for ( Iterator<InlineArea> it = getChildAreas().iterator(); it.hasNext();) {
+    public List collectInlineRuns (List runs) {
+        for (Iterator<InlineArea> it = getChildAreas().iterator(); it.hasNext();) {
             InlineArea ia = it.next();
-            runs = ia.collectInlineRuns ( runs );
+            runs = ia.collectInlineRuns (runs);
         }
         return runs;
     }
@@ -127,20 +127,20 @@ public class InlineParent extends Inline
      * signalling that they will inherit the level of their parent text area.
      */
     public void resetChildrenLevel() {
-        for ( Iterator it = inlines.iterator(); it.hasNext();) {
-            ( (InlineArea) it.next() ) .resetBidiLevel();
+        for (Iterator it = inlines.iterator(); it.hasNext();) {
+            ((InlineArea) it.next()) .resetBidiLevel();
         }
     }
 
-    private void updateLevel ( int newLevel ) {
-        if ( newLevel >= 0 ) {
+    private void updateLevel (int newLevel) {
+        if (newLevel >= 0) {
             int curLevel = getBidiLevel();
-            if ( curLevel >= 0 ) {
-                if ( newLevel < curLevel ) {
-                    setBidiLevel ( newLevel );
+            if (curLevel >= 0) {
+                if (newLevel < curLevel) {
+                    setBidiLevel (newLevel);
                 }
             } else {
-                setBidiLevel ( newLevel );
+                setBidiLevel (newLevel);
             }
         }
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/SpaceArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/SpaceArea.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/SpaceArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/SpaceArea.java Tue Apr  9 17:31:41 2013
@@ -44,7 +44,7 @@ public class SpaceArea extends InlineAre
      * @param bidiLevel the bidirectional embedding level (or -1 if not defined)
      */
     public SpaceArea(int blockProgressionOffset, int bidiLevel, char space, boolean adjustable) {
-        super ( blockProgressionOffset, bidiLevel );
+        super (blockProgressionOffset, bidiLevel);
         this.space = space;
         this.isAdjustable = adjustable;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/TextArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/TextArea.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/TextArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/TextArea.java Tue Apr  9 17:31:41 2013
@@ -89,12 +89,12 @@ public class TextArea extends AbstractTe
      * @param blockProgressionOffset the offset for the next area
      */
     public void addWord
-        ( String word, int ipd, int[] letterAdjust, int[] levels,
-          int[][] gposAdjustments, int blockProgressionOffset ) {
-        int minWordLevel = findMinLevel ( levels );
+        (String word, int ipd, int[] letterAdjust, int[] levels,
+          int[][] gposAdjustments, int blockProgressionOffset) {
+        int minWordLevel = findMinLevel (levels);
         WordArea wordArea = new WordArea
-            ( blockProgressionOffset, minWordLevel, word, letterAdjust, levels, gposAdjustments );
-        wordArea.setIPD ( ipd );
+            (blockProgressionOffset, minWordLevel, word, letterAdjust, levels, gposAdjustments);
+        wordArea.setIPD (ipd);
         addChildArea(wordArea);
         wordArea.setParentArea(this);
         updateLevel(minWordLevel);
@@ -110,9 +110,9 @@ public class TextArea extends AbstractTe
      * @param level resolved bidirection level of space character
      */
     public void addSpace
-        ( char space, int ipd, boolean adjustable, int blockProgressionOffset, int level ) {
+        (char space, int ipd, boolean adjustable, int blockProgressionOffset, int level) {
         SpaceArea spaceArea = new SpaceArea(blockProgressionOffset, level, space, adjustable);
-        spaceArea.setIPD ( ipd );
+        spaceArea.setIPD (ipd);
         addChildArea(spaceArea);
         spaceArea.setParentArea(this);
         updateLevel(level);
@@ -167,29 +167,29 @@ public class TextArea extends AbstractTe
         return sb.toString();
     }
 
-    private void updateLevel ( int newLevel ) {
-        if ( newLevel >= 0 ) {
+    private void updateLevel (int newLevel) {
+        if (newLevel >= 0) {
             int curLevel = getBidiLevel();
-            if ( curLevel >= 0 ) {
-                if ( newLevel < curLevel ) {
-                    setBidiLevel ( newLevel );
+            if (curLevel >= 0) {
+                if (newLevel < curLevel) {
+                    setBidiLevel (newLevel);
                 }
             } else {
-                setBidiLevel ( newLevel );
+                setBidiLevel (newLevel);
             }
         }
     }
 
-    private static int findMinLevel ( int[] levels ) {
-        if ( levels != null ) {
+    private static int findMinLevel (int[] levels) {
+        if (levels != null) {
             int lMin = Integer.MAX_VALUE;
-            for ( int i = 0, n = levels.length; i < n; i++ ) {
+            for (int i = 0, n = levels.length; i < n; i++) {
                 int l = levels [ i ];
-                if ( ( l >= 0 ) && ( l < lMin ) ) {
+                if ((l >= 0) && (l < lMin)) {
                     lMin = l;
                 }
             }
-            if ( lMin == Integer.MAX_VALUE ) {
+            if (lMin == Integer.MAX_VALUE) {
                 return -1;
             } else {
                 return lMin;
@@ -199,10 +199,10 @@ public class TextArea extends AbstractTe
         }
     }
 
-    private int[] makeLevels ( int level, int count ) {
-        if ( level >= 0 ) {
+    private int[] makeLevels (int level, int count) {
+        if (level >= 0) {
             int[] levels = new int [ count ];
-            Arrays.fill ( levels, level );
+            Arrays.fill (levels, level);
             return levels;
         } else {
             return null;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java Tue Apr  9 17:31:41 2013
@@ -162,9 +162,9 @@ public class UnresolvedPageNumber extend
      * @return modified list of inline runs, having appended new run
      */
     @Override
-    public List collectInlineRuns ( List runs ) {
+    public List collectInlineRuns (List runs) {
         assert runs != null;
-        runs.add ( new InlineRun ( this, new int[] {getBidiLevel()}) );
+        runs.add (new InlineRun (this, new int[] {getBidiLevel()}));
         return runs;
     }
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/WordArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/WordArea.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/WordArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/WordArea.java Tue Apr  9 17:31:41 2013
@@ -67,14 +67,14 @@ public class WordArea extends InlineArea
      * @param reversed true if word is known to be reversed at construction time
      */
     public WordArea
-        ( int blockProgressionOffset, int level, String word, int[] letterAdjust, int[] levels,
-          int[][] gposAdjustments, boolean reversed ) {
-        super ( blockProgressionOffset, level );
-        int length = ( word != null ) ? word.length() : 0;
+        (int blockProgressionOffset, int level, String word, int[] letterAdjust, int[] levels,
+          int[][] gposAdjustments, boolean reversed) {
+        super (blockProgressionOffset, level);
+        int length = (word != null) ? word.length() : 0;
         this.word = word;
-        this.letterAdjust = maybeAdjustLength ( letterAdjust, length );
-        this.levels = maybePopulateLevels ( levels, level, length );
-        this.gposAdjustments = maybeAdjustLength ( gposAdjustments, length );
+        this.letterAdjust = maybeAdjustLength (letterAdjust, length);
+        this.levels = maybePopulateLevels (levels, level, length);
+        this.gposAdjustments = maybeAdjustLength (gposAdjustments, length);
         this.reversed = reversed;
     }
 
@@ -89,9 +89,9 @@ public class WordArea extends InlineArea
      * @param gposAdjustments array of general position adjustments or null if none apply
      */
     public WordArea
-        ( int blockProgressionOffset, int level, String word, int[] letterAdjust, int[] levels,
-          int[][] gposAdjustments ) {
-        this ( blockProgressionOffset, level, word, letterAdjust, levels, gposAdjustments, false );
+        (int blockProgressionOffset, int level, String word, int[] letterAdjust, int[] levels,
+          int[][] gposAdjustments) {
+        this (blockProgressionOffset, level, word, letterAdjust, levels, gposAdjustments, false);
     }
 
     /** @return Returns the word. */
@@ -120,12 +120,12 @@ public class WordArea extends InlineArea
      * @return a (possibly null) array of per-character (glyph) levels over the specified
      * sequence
      */
-    public int[] getBidiLevels ( int start, int end ) {
+    public int[] getBidiLevels (int start, int end) {
         assert start <= end;
-        if ( this.levels != null ) {
+        if (this.levels != null) {
             int n = end - start;
             int[] levels = new int [ n ];
-            for ( int i = 0; i < n; i++ ) {
+            for (int i = 0; i < n; i++) {
                 levels[i] = this.levels [ start + i ];
             }
             return levels;
@@ -141,10 +141,10 @@ public class WordArea extends InlineArea
      * level
      * @return a resolved bidirectional level or, if not specified, then -1
      */
-    public int bidiLevelAt ( int position ) {
-        if ( position > word.length() ) {
+    public int bidiLevelAt (int position) {
+        if (position > word.length()) {
             throw new IndexOutOfBoundsException();
-        } else if ( levels != null ) {
+        } else if (levels != null) {
             return levels [ position ];
         } else {
             return -1;
@@ -152,15 +152,15 @@ public class WordArea extends InlineArea
     }
 
     @Override
-    public List collectInlineRuns ( List runs ) {
+    public List collectInlineRuns (List runs) {
         assert runs != null;
         InlineRun r;
-        if ( getBidiLevels() != null ) {
-            r = new InlineRun ( this, getBidiLevels() );
+        if (getBidiLevels() != null) {
+            r = new InlineRun (this, getBidiLevels());
         } else {
-            r = new InlineRun ( this, -1, word.length() );
+            r = new InlineRun (this, -1, word.length());
         }
-        runs.add ( r );
+        runs.add (r);
         return runs;
     }
 
@@ -180,10 +180,10 @@ public class WordArea extends InlineArea
      * level
      * @return an array of adjustments or null if none applies
      */
-    public int[] glyphPositionAdjustmentsAt ( int position ) {
-        if ( position > word.length() ) {
+    public int[] glyphPositionAdjustmentsAt (int position) {
+        if (position > word.length()) {
             throw new IndexOutOfBoundsException();
-        } else if ( gposAdjustments != null ) {
+        } else if (gposAdjustments != null) {
             return gposAdjustments [ position ];
         } else {
             return null;
@@ -195,18 +195,18 @@ public class WordArea extends InlineArea
      * adjustments.</p>
      * @param mirror if true, then perform mirroring if mirrorred characters
      */
-    public void reverse ( boolean mirror ) {
-        if ( word.length() > 0 ) {
-            word = ( ( new StringBuffer ( word ) ) .reverse() ) .toString();
-            if ( levels != null ) {
-                reverse ( levels );
+    public void reverse (boolean mirror) {
+        if (word.length() > 0) {
+            word = ((new StringBuffer (word)) .reverse()) .toString();
+            if (levels != null) {
+                reverse (levels);
             }
-            if ( gposAdjustments != null ) {
-                reverse ( gposAdjustments );
+            if (gposAdjustments != null) {
+                reverse (gposAdjustments);
             }
             reversed = !reversed;
-            if ( mirror ) {
-                word = CharMirror.mirror ( word );
+            if (mirror) {
+                word = CharMirror.mirror (word);
             }
         }
     }
@@ -215,8 +215,8 @@ public class WordArea extends InlineArea
      * <p>Perform mirroring on mirrorable characters.</p>
      */
     public void mirror() {
-        if ( word.length() > 0 ) {
-            word = CharMirror.mirror ( word );
+        if (word.length() > 0) {
+            word = CharMirror.mirror (word);
         }
     }
 
@@ -236,14 +236,14 @@ public class WordArea extends InlineArea
      * If int[] array is not of specified length, then create
      * a new copy of the first length entries.
      */
-    private static int[] maybeAdjustLength ( int[] ia, int length ) {
-        if ( ia != null ) {
-            if ( ia.length == length ) {
+    private static int[] maybeAdjustLength (int[] ia, int length) {
+        if (ia != null) {
+            if (ia.length == length) {
                 return ia;
             } else {
                 int[] iaNew = new int [ length ];
-                for ( int i = 0, n = ia.length; i < n; i++ ) {
-                    if ( i < length ) {
+                for (int i = 0, n = ia.length; i < n; i++) {
+                    if (i < length) {
                         iaNew [ i ] = ia [ i ];
                     } else {
                         break;
@@ -260,14 +260,14 @@ public class WordArea extends InlineArea
      * If int[][] matrix is not of specified length, then create
      * a new shallow copy of the first length entries.
      */
-    private static int[][] maybeAdjustLength ( int[][] im, int length ) {
-        if ( im != null ) {
-            if ( im.length == length ) {
+    private static int[][] maybeAdjustLength (int[][] im, int length) {
+        if (im != null) {
+            if (im.length == length) {
                 return im;
             } else {
                 int[][] imNew = new int [ length ][];
-                for ( int i = 0, n = im.length; i < n; i++ ) {
-                    if ( i < length ) {
+                for (int i = 0, n = im.length; i < n; i++) {
+                    if (i < length) {
                         imNew [ i ] = im [ i ];
                     } else {
                         break;
@@ -280,16 +280,16 @@ public class WordArea extends InlineArea
         }
     }
 
-    private static int[] maybePopulateLevels ( int[] levels, int level, int count ) {
-        if ( ( levels == null ) && ( level >= 0 ) ) {
+    private static int[] maybePopulateLevels (int[] levels, int level, int count) {
+        if ((levels == null) && (level >= 0)) {
             levels = new int[count];
-            Arrays.fill ( levels, level );
+            Arrays.fill (levels, level);
         }
-        return maybeAdjustLength ( levels, count );
+        return maybeAdjustLength (levels, count);
     }
 
-    private static void reverse ( int[] a ) {
-        for ( int i = 0, n = a.length, m = n / 2; i < m; i++ ) {
+    private static void reverse (int[] a) {
+        for (int i = 0, n = a.length, m = n / 2; i < m; i++) {
             int k = n - i - 1;
             int t = a [ k ];
             a [ k ] = a [ i ];
@@ -297,8 +297,8 @@ public class WordArea extends InlineArea
         }
     }
 
-    private static void reverse ( int[][] aa ) {
-        for ( int i = 0, n = aa.length, m = n / 2; i < m; i++ ) {
+    private static void reverse (int[][] aa) {
+        for (int i = 0, n = aa.length, m = n / 2; i < m; i++) {
             int k = n - i - 1;
             int[] t = aa [ k ];
             aa [ k ] = aa [ i ];

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiClass.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiClass.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiClass.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiClass.java Tue Apr  9 17:31:41 2013
@@ -241,25 +241,25 @@ private static byte[] bcC1 = {
  * @param ch a unicode scalar value
  * @return bidi class
  */
-public static int getBidiClass ( int ch ) {
-  if ( ch <= 0x00FF ) {
+public static int getBidiClass (int ch) {
+  if (ch <= 0x00FF) {
     return bcL1 [ ch - 0x0000 ];
-  } else if ( ( ch >= 0x0590 ) && ( ch <= 0x06FF ) ) {
+  } else if ((ch >= 0x0590) && (ch <= 0x06FF)) {
     return bcR1 [ ch - 0x0590 ];
   } else {
-    return getBidiClass ( ch, bcS1, bcE1, bcC1 );
+    return getBidiClass (ch, bcS1, bcE1, bcC1);
   }
 }
 
-private static int getBidiClass ( int ch, int[] sa, int[] ea, byte[] ca ) {
-  int k = Arrays.binarySearch ( sa, ch );
-  if ( k >= 0 ) {
+private static int getBidiClass (int ch, int[] sa, int[] ea, byte[] ca) {
+  int k = Arrays.binarySearch (sa, ch);
+  if (k >= 0) {
     return ca [ k ];
   } else {
-    k = - ( k + 1 );
-    if ( k == 0 ) {
+    k = - (k + 1);
+    if (k == 0) {
       return BidiConstants.L;
-    } else if ( ch <= ea [ k - 1 ] ) {
+    } else if (ch <= ea [ k - 1 ]) {
       return ca [ k - 1 ];
     } else {
       return BidiConstants.L;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/BidiResolver.java Tue Apr  9 17:31:41 2013
@@ -57,183 +57,183 @@ public final class BidiResolver {
      * Resolve inline directionality.
      * @param ps a page sequence FO instance
      */
-    public static void resolveInlineDirectionality ( PageSequence ps ) {
+    public static void resolveInlineDirectionality (PageSequence ps) {
         if (log.isDebugEnabled()) {
-            log.debug ( "BD: RESOLVE: " + ps );
+            log.debug ("BD: RESOLVE: " + ps);
         }
-        List ranges = pruneEmptyRanges ( ps.collectDelimitedTextRanges ( new Stack() ) );
-        resolveInlineDirectionality ( ranges );
+        List ranges = pruneEmptyRanges (ps.collectDelimitedTextRanges (new Stack()));
+        resolveInlineDirectionality (ranges);
     }
 
     /**
      * Reorder line area.
      * @param la a line area instance
      */
-    public static void reorder ( LineArea la ) {
+    public static void reorder (LineArea la) {
 
         // 1. collect inline levels
-        List runs = collectRuns ( la.getInlineAreas(), new Vector() );
+        List runs = collectRuns (la.getInlineAreas(), new Vector());
         if (log.isDebugEnabled()) {
-            dumpRuns ( "BD: REORDER: INPUT:", runs );
+            dumpRuns ("BD: REORDER: INPUT:", runs);
         }
 
         // 2. split heterogeneous inlines
-        runs = splitRuns ( runs );
+        runs = splitRuns (runs);
         if (log.isDebugEnabled()) {
-            dumpRuns ( "BD: REORDER: SPLIT INLINES:", runs );
+            dumpRuns ("BD: REORDER: SPLIT INLINES:", runs);
         }
 
         // 3. determine minimum and maximum levels
-        int[] mm = computeMinMaxLevel ( runs, null );
+        int[] mm = computeMinMaxLevel (runs, null);
         if (log.isDebugEnabled()) {
-            log.debug( "BD: REORDER: { min = " + mm[0] + ", max = " + mm[1] + "}" );
+            log.debug("BD: REORDER: { min = " + mm[0] + ", max = " + mm[1] + "}");
         }
 
         // 4. reorder from maximum level to minimum odd level
         int mn = mm[0];
         int mx = mm[1];
-        if ( mx > 0 ) {
-            for ( int l1 = mx, l2 = ( ( mn & 1 ) == 0 ) ? ( mn + 1 ) : mn; l1 >= l2; l1-- ) {
-                runs = reorderRuns ( runs, l1 );
+        if (mx > 0) {
+            for (int l1 = mx, l2 = ((mn & 1) == 0) ? (mn + 1) : mn; l1 >= l2; l1--) {
+                runs = reorderRuns (runs, l1);
             }
         }
         if (log.isDebugEnabled()) {
-            dumpRuns ( "BD: REORDER: REORDERED RUNS:", runs );
+            dumpRuns ("BD: REORDER: REORDERED RUNS:", runs);
         }
 
         // 5. reverse word consituents (characters and glyphs) while mirroring
         boolean mirror = true;
-        reverseWords ( runs, mirror );
+        reverseWords (runs, mirror);
         if (log.isDebugEnabled()) {
-            dumpRuns ( "BD: REORDER: REORDERED WORDS:", runs );
+            dumpRuns ("BD: REORDER: REORDERED WORDS:", runs);
         }
 
         // 6. replace line area's inline areas with reordered runs' inline areas
-        replaceInlines ( la, replicateSplitWords ( runs ) );
+        replaceInlines (la, replicateSplitWords (runs));
     }
 
-    private static void resolveInlineDirectionality ( List ranges ) {
-        for ( Iterator it = ranges.iterator(); it.hasNext(); ) {
+    private static void resolveInlineDirectionality (List ranges) {
+        for (Iterator it = ranges.iterator(); it.hasNext(); ) {
             DelimitedTextRange r = (DelimitedTextRange) it.next();
             r.resolve();
             if (log.isDebugEnabled()) {
-                log.debug ( r );
+                log.debug (r);
             }
         }
     }
 
-    private static List collectRuns ( List inlines, List runs ) {
-        for ( Iterator it = inlines.iterator(); it.hasNext(); ) {
+    private static List collectRuns (List inlines, List runs) {
+        for (Iterator it = inlines.iterator(); it.hasNext(); ) {
             InlineArea ia = (InlineArea) it.next();
-            runs = ia.collectInlineRuns ( runs );
+            runs = ia.collectInlineRuns (runs);
         }
         return runs;
     }
 
-    private static List splitRuns ( List runs ) {
+    private static List splitRuns (List runs) {
         List runsNew = new Vector();
-        for ( Iterator it = runs.iterator(); it.hasNext(); ) {
+        for (Iterator it = runs.iterator(); it.hasNext(); ) {
             InlineRun ir = (InlineRun) it.next();
-            if ( ir.isHomogenous() ) {
-                runsNew.add ( ir );
+            if (ir.isHomogenous()) {
+                runsNew.add (ir);
             } else {
-                runsNew.addAll ( ir.split() );
+                runsNew.addAll (ir.split());
             }
         }
-        if ( ! runsNew.equals ( runs ) ) {
+        if (! runsNew.equals (runs)) {
             runs = runsNew;
         }
         return runs;
     }
 
-    private static int[] computeMinMaxLevel ( List runs, int[] mm ) {
-        if ( mm == null ) {
+    private static int[] computeMinMaxLevel (List runs, int[] mm) {
+        if (mm == null) {
             mm = new int[] {Integer.MAX_VALUE, Integer.MIN_VALUE};
         }
-        for ( Iterator it = runs.iterator(); it.hasNext(); ) {
+        for (Iterator it = runs.iterator(); it.hasNext(); ) {
             InlineRun ir = (InlineRun) it.next();
-            ir.updateMinMax ( mm );
+            ir.updateMinMax (mm);
         }
         return mm;
     }
-    private static List reorderRuns ( List runs, int level ) {
+    private static List reorderRuns (List runs, int level) {
         assert level >= 0;
         List runsNew = new Vector();
-        for ( int i = 0, n = runs.size(); i < n; i++ ) {
+        for (int i = 0, n = runs.size(); i < n; i++) {
             InlineRun iri = (InlineRun) runs.get(i);
-            if ( iri.getMinLevel() < level ) {
-                runsNew.add ( iri );
+            if (iri.getMinLevel() < level) {
+                runsNew.add (iri);
             } else {
                 int s = i;
                 int e = s;
-                while ( e < n ) {
+                while (e < n) {
                     InlineRun ire = (InlineRun) runs.get(e);
-                    if ( ire.getMinLevel() < level ) {
+                    if (ire.getMinLevel() < level) {
                         break;
                     } else {
                         e++;
                     }
                 }
-                if ( s < e ) {
-                    runsNew.addAll ( reverseRuns ( runs, s, e ) );
+                if (s < e) {
+                    runsNew.addAll (reverseRuns (runs, s, e));
                 }
                 i = e - 1;
             }
         }
-        if ( ! runsNew.equals ( runs ) ) {
+        if (! runsNew.equals (runs)) {
             runs = runsNew;
         }
         return runs;
     }
-    private static List reverseRuns ( List runs, int s, int e ) {
+    private static List reverseRuns (List runs, int s, int e) {
         int n = e - s;
-        Vector runsNew = new Vector ( n );
-        if ( n > 0 ) {
-            for ( int i = 0; i < n; i++ ) {
-                int k = ( n - i - 1 );
+        Vector runsNew = new Vector (n);
+        if (n > 0) {
+            for (int i = 0; i < n; i++) {
+                int k = (n - i - 1);
                 InlineRun ir = (InlineRun) runs.get(s + k);
                 ir.reverse();
-                runsNew.add ( ir );
+                runsNew.add (ir);
             }
         }
         return runsNew;
     }
-    private static void reverseWords ( List runs, boolean mirror ) {
-        for ( Iterator it = runs.iterator(); it.hasNext(); ) {
+    private static void reverseWords (List runs, boolean mirror) {
+        for (Iterator it = runs.iterator(); it.hasNext(); ) {
             InlineRun ir = (InlineRun) it.next();
-            ir.maybeReverseWord ( mirror );
+            ir.maybeReverseWord (mirror);
         }
     }
-    private static List replicateSplitWords ( List runs ) {
+    private static List replicateSplitWords (List runs) {
         // [TBD] for each run which inline word area appears multiple times in
         // runs, replicate that word
         return runs;
     }
-    private static void replaceInlines ( LineArea la, List runs ) {
+    private static void replaceInlines (LineArea la, List runs) {
         List<InlineArea> inlines = new ArrayList<InlineArea>();
-        for ( Iterator it = runs.iterator(); it.hasNext(); ) {
+        for (Iterator it = runs.iterator(); it.hasNext(); ) {
             InlineRun ir = (InlineRun) it.next();
-            inlines.add ( ir.getInline() );
+            inlines.add (ir.getInline());
         }
-        la.setInlineAreas ( unflattenInlines ( inlines ) );
+        la.setInlineAreas (unflattenInlines (inlines));
     }
-    private static List unflattenInlines ( List<InlineArea> inlines ) {
-        return new UnflattenProcessor ( inlines ) .unflatten();
+    private static List unflattenInlines (List<InlineArea> inlines) {
+        return new UnflattenProcessor (inlines) .unflatten();
     }
-    private static void dumpRuns ( String header, List runs ) {
-        log.debug ( header );
-        for ( Iterator it = runs.iterator(); it.hasNext(); ) {
+    private static void dumpRuns (String header, List runs) {
+        log.debug (header);
+        for (Iterator it = runs.iterator(); it.hasNext(); ) {
             InlineRun ir = (InlineRun) it.next();
-            log.debug ( ir );
+            log.debug (ir);
         }
     }
 
-    private static List pruneEmptyRanges ( Stack ranges ) {
+    private static List pruneEmptyRanges (Stack ranges) {
         Vector rv = new Vector();
-        for ( Iterator it = ranges.iterator(); it.hasNext(); ) {
+        for (Iterator it = ranges.iterator(); it.hasNext(); ) {
             DelimitedTextRange r = (DelimitedTextRange) it.next();
-            if ( ! r.isEmpty() ) {
-                rv.add ( r );
+            if (! r.isEmpty()) {
+                rv.add (r);
             }
         }
         return rv;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java Tue Apr  9 17:31:41 2013
@@ -54,7 +54,7 @@ public class DelimitedTextRange {
      * Primary constructor.
      * @param fn node that generates this text range
      */
-    public DelimitedTextRange ( FONode fn ) {
+    public DelimitedTextRange (FONode fn) {
         this.fn = fn;
         this.buffer = new StringBuffer();
         this.intervals = new Vector();
@@ -71,16 +71,16 @@ public class DelimitedTextRange {
      * @param it character iterator
      * @param fn node that generates interval being appended
      */
-    public void append ( CharIterator it, FONode fn ) {
-        if ( it != null ) {
+    public void append (CharIterator it, FONode fn) {
+        if (it != null) {
             int s = buffer.length();
             int e = s;
-            while ( it.hasNext() ) {
+            while (it.hasNext()) {
                 char c = it.nextChar();
-                buffer.append ( c );
+                buffer.append (c);
                 e++;
             }
-            intervals.add ( new TextInterval ( fn, s, e ) );
+            intervals.add (new TextInterval (fn, s, e));
         }
     }
     /**
@@ -88,12 +88,12 @@ public class DelimitedTextRange {
      * @param c character
      * @param fn node that generates interval being appended
      */
-    public void append ( char c, FONode fn ) {
-        if ( c != 0 ) {
+    public void append (char c, FONode fn) {
+        if (c != 0) {
             int s = buffer.length();
             int e = s + 1;
-            buffer.append ( c );
-            intervals.add ( new TextInterval ( fn, s, e ) );
+            buffer.append (c);
+            intervals.add (new TextInterval (fn, s, e));
         }
     }
     /**
@@ -108,32 +108,32 @@ public class DelimitedTextRange {
      */
     public void resolve() {
         WritingModeTraitsGetter tg;
-        if ( ( tg = WritingModeTraits.getWritingModeTraitsGetter ( getNode() ) ) != null ) {
-            resolve ( tg.getInlineProgressionDirection() );
+        if ((tg = WritingModeTraits.getWritingModeTraitsGetter (getNode())) != null) {
+            resolve (tg.getInlineProgressionDirection());
         }
     }
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer ( "DR: " + fn.getLocalName() + " { <" + CharUtilities.toNCRefs ( buffer.toString() ) + ">" );
-        sb.append ( ", intervals <" );
+        StringBuffer sb = new StringBuffer ("DR: " + fn.getLocalName() + " { <" + CharUtilities.toNCRefs (buffer.toString()) + ">");
+        sb.append (", intervals <");
         boolean first = true;
-        for ( Iterator it = intervals.iterator(); it.hasNext(); ) {
+        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
             TextInterval ti = (TextInterval) it.next();
-            if ( first ) {
+            if (first) {
                 first = false;
             } else {
                 sb.append(',');
             }
-            sb.append ( ti.toString() );
+            sb.append (ti.toString());
         }
         sb.append("> }");
         return sb.toString();
     }
-    private void resolve ( Direction paragraphEmbeddingLevel ) {
+    private void resolve (Direction paragraphEmbeddingLevel) {
         int [] levels;
-        if ( ( levels = UnicodeBidiAlgorithm.resolveLevels ( buffer, paragraphEmbeddingLevel ) ) != null ) {
-            assignLevels ( levels );
-            assignBlockLevel ( paragraphEmbeddingLevel );
+        if ((levels = UnicodeBidiAlgorithm.resolveLevels (buffer, paragraphEmbeddingLevel)) != null) {
+            assignLevels (levels);
+            assignBlockLevel (paragraphEmbeddingLevel);
             assignTextLevels();
         }
     }
@@ -145,13 +145,13 @@ public class DelimitedTextRange {
      * @param levels array of levels each corresponding to each index of the delimited
      * text range
      */
-    private void assignLevels ( int[] levels ) {
-        Vector intervalsNew = new Vector ( intervals.size() );
-        for ( Iterator it = intervals.iterator(); it.hasNext(); ) {
+    private void assignLevels (int[] levels) {
+        Vector intervalsNew = new Vector (intervals.size());
+        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
             TextInterval ti = (TextInterval) it.next();
-            intervalsNew.addAll ( assignLevels ( ti, levels ) );
+            intervalsNew.addAll (assignLevels (ti, levels));
         }
-        if ( ! intervalsNew.equals ( intervals ) ) {
+        if (! intervalsNew.equals (intervals)) {
             intervals = intervalsNew;
         }
     }
@@ -167,30 +167,30 @@ public class DelimitedTextRange {
      * @return a list of text intervals as described above
      */
     private static final Log log = LogFactory.getLog(BidiResolver.class); // CSOK: ConstantNameCheck
-    private List assignLevels ( TextInterval ti, int[] levels ) {
+    private List assignLevels (TextInterval ti, int[] levels) {
         Vector tiv = new Vector();
         FONode fn = ti.getNode();
         int fnStart = ti.getStart();                                     // start of node's text in delimited text range
-        for ( int i = fnStart, n = ti.getEnd(); i < n; ) {
+        for (int i = fnStart, n = ti.getEnd(); i < n; ) {
             int s = i;                                              // inclusive start index of interval in delimited text range
             int e = s;                                              // exclusive end index of interval in delimited text range
             int l = levels [ s ];                                   // current run level
-            while ( e < n ) {                                       // skip to end of run level or end of interval
-                if ( levels [ e ] != l ) {
+            while (e < n) {                                       // skip to end of run level or end of interval
+                if (levels [ e ] != l) {
                     break;
                 } else {
                     e++;
                 }
             }
-            if ( ( ti.getStart() == s ) && ( ti.getEnd() == e ) ) {
-                ti.setLevel ( l );                                       // reuse interval, assigning it single level
+            if ((ti.getStart() == s) && (ti.getEnd() == e)) {
+                ti.setLevel (l);                                       // reuse interval, assigning it single level
             } else {
-                ti = new TextInterval ( fn, fnStart, s, e, l );     // subdivide interval
+                ti = new TextInterval (fn, fnStart, s, e, l);     // subdivide interval
             }
             if (log.isDebugEnabled()) {
-                log.debug ( "AL(" + l + "): " + ti );
+                log.debug ("AL(" + l + "): " + ti);
             }
-            tiv.add ( ti );
+            tiv.add (ti);
             i = e;
         }
         return tiv;
@@ -199,25 +199,25 @@ public class DelimitedTextRange {
      * <p>Assign resolved levels for each interval to source #PCDATA in the associated FOText.</p>
      */
     private void assignTextLevels() {
-        for ( Iterator it = intervals.iterator(); it.hasNext(); ) {
+        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
             TextInterval ti = (TextInterval) it.next();
             ti.assignTextLevels();
         }
     }
-    private void assignBlockLevel ( Direction paragraphEmbeddingLevel ) {
-        int defaultLevel = ( paragraphEmbeddingLevel == Direction.RL ) ? 1 : 0;
-        for ( Iterator it = intervals.iterator(); it.hasNext(); ) {
+    private void assignBlockLevel (Direction paragraphEmbeddingLevel) {
+        int defaultLevel = (paragraphEmbeddingLevel == Direction.RL) ? 1 : 0;
+        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
             TextInterval ti = (TextInterval) it.next();
-            assignBlockLevel ( ti.getNode(), defaultLevel );
+            assignBlockLevel (ti.getNode(), defaultLevel);
         }
     }
-    private void assignBlockLevel ( FONode node, int defaultLevel ) {
-        for ( FONode fn = node; fn != null; fn = fn.getParent() ) {
-            if ( fn instanceof FObj ) {
+    private void assignBlockLevel (FONode node, int defaultLevel) {
+        for (FONode fn = node; fn != null; fn = fn.getParent()) {
+            if (fn instanceof FObj) {
                 FObj fo = (FObj) fn;
-                if ( fo.isBidiRangeBlockItem() ) {
-                    if ( fo.getBidiLevel() < 0 ) {
-                        fo.setBidiLevel ( defaultLevel );
+                if (fo.isBidiRangeBlockItem()) {
+                    if (fo.getBidiLevel() < 0) {
+                        fo.setBidiLevel (defaultLevel);
                     }
                     break;
                 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java Tue Apr  9 17:31:41 2013
@@ -57,12 +57,12 @@ public class InlineRun {
      * @param inline which generated this inline run
      * @param levels levels array
      */
-    public InlineRun ( InlineArea inline, int[] levels ) {
+    public InlineRun (InlineArea inline, int[] levels) {
         assert inline != null;
         assert levels != null;
         this.inline = inline;
         this.levels = levels;
-        setMinMax ( levels );
+        setMinMax (levels);
     }
     /**
      * Alternate constructor.
@@ -70,8 +70,8 @@ public class InlineRun {
      * @param level for each index
      * @param count of indices
      */
-    public InlineRun ( InlineArea inline, int level, int count ) {
-        this ( inline, makeLevels ( level, count ) );
+    public InlineRun (InlineArea inline, int level, int count) {
+        this (inline, makeLevels (level, count));
     }
     /**
      * Obtain inline area that generated this inline run.
@@ -94,16 +94,16 @@ public class InlineRun {
     public int getMaxLevel() {
         return maxLevel;
     }
-    private void setMinMax ( int[] levels ) {
+    private void setMinMax (int[] levels) {
         int mn = Integer.MAX_VALUE;
         int mx = Integer.MIN_VALUE;
-        if ( ( levels != null ) && ( levels.length > 0 ) ) {
-            for ( int i = 0, n = levels.length; i < n; i++ ) {
+        if ((levels != null) && (levels.length > 0)) {
+            for (int i = 0, n = levels.length; i < n; i++) {
                 int l = levels [ i ];
-                if ( l < mn ) {
+                if (l < mn) {
                     mn = l;
                 }
-                if ( l > mx ) {
+                if (l > mx) {
                     mx = l;
                 }
             }
@@ -126,19 +126,19 @@ public class InlineRun {
      */
     public List split() {
         List runs = new Vector();
-        for ( int i = 0, n = levels.length; i < n; ) {
+        for (int i = 0, n = levels.length; i < n; ) {
             int l = levels [ i ];
             int s = i;
             int e = s;
-            while ( e < n ) {
-                if ( levels [ e ] != l ) {
+            while (e < n) {
+                if (levels [ e ] != l) {
                     break;
                 } else {
                     e++;
                 }
             }
-            if ( s < e ) {
-                runs.add ( new InlineRun ( inline, l, e - s ) );
+            if (s < e) {
+                runs.add (new InlineRun (inline, l, e - s));
             }
             i = e;
         }
@@ -149,11 +149,11 @@ public class InlineRun {
      * Update a min/max array to correspond with this run's min/max values.
      * @param mm reference to min/max array
      */
-    public void updateMinMax ( int[] mm ) {
-        if ( minLevel < mm[0] ) {
+    public void updateMinMax (int[] mm) {
+        if (minLevel < mm[0]) {
             mm[0] = minLevel;
         }
-        if ( maxLevel > mm[1] ) {
+        if (maxLevel > mm[1]) {
             mm[1] = maxLevel;
         }
     }
@@ -162,7 +162,7 @@ public class InlineRun {
      * @return true if run is homogenous and odd (i.e., right to left)
      */
     public boolean maybeNeedsMirroring() {
-        return ( minLevel == maxLevel ) && ( ( minLevel & 1 ) != 0 );
+        return (minLevel == maxLevel) && ((minLevel & 1) != 0);
     }
     /**
      * Reverse run (by incrementing reversal count, not actually reversing).
@@ -175,41 +175,41 @@ public class InlineRun {
      * reversal.
      * @param mirror if true then also mirror characters
      */
-    public void maybeReverseWord ( boolean mirror ) {
-        if ( inline instanceof WordArea ) {
+    public void maybeReverseWord (boolean mirror) {
+        if (inline instanceof WordArea) {
             WordArea w = (WordArea) inline;
             // if not already reversed, then reverse now
-            if ( ! w.isReversed() ) {
-                if ( ( reversals & 1 ) != 0 ) {
-                    w.reverse ( mirror );
-                } else if ( mirror && maybeNeedsMirroring() ) {
+            if (! w.isReversed()) {
+                if ((reversals & 1) != 0) {
+                    w.reverse (mirror);
+                } else if (mirror && maybeNeedsMirroring()) {
                     w.mirror();
                 }
             }
         }
     }
     @Override
-    public boolean equals ( Object o ) {
-        if ( o instanceof InlineRun ) {
+    public boolean equals (Object o) {
+        if (o instanceof InlineRun) {
             InlineRun ir = (InlineRun) o;
-            if ( ir.inline != inline ) {
+            if (ir.inline != inline) {
                 return false;
-            } else if ( ir.minLevel != minLevel ) {
+            } else if (ir.minLevel != minLevel) {
                 return false;
-            } else if ( ir.maxLevel != maxLevel ) {
+            } else if (ir.maxLevel != maxLevel) {
                 return false;
-            } else if ( ( ir.levels != null ) && ( levels != null ) ) {
-                if ( ir.levels.length != levels.length ) {
+            } else if ((ir.levels != null) && (levels != null)) {
+                if (ir.levels.length != levels.length) {
                     return false;
                 } else {
-                    for ( int i = 0, n = levels.length; i < n; i++ ) {
-                        if ( ir.levels[i] != levels[i] ) {
+                    for (int i = 0, n = levels.length; i < n; i++) {
+                        if (ir.levels[i] != levels[i]) {
                             return false;
                         }
                     }
                     return true;
                 }
-            } else if ( ( ir.levels == null ) && ( levels == null ) ) {
+            } else if ((ir.levels == null) && (levels == null)) {
                 return true;
             } else {
                 return false;
@@ -220,88 +220,88 @@ public class InlineRun {
     }
     @Override
     public int hashCode() {
-        int l = ( inline != null ) ? inline.hashCode() : 0;
-        l = ( l ^ minLevel ) + ( l << 19 );
-        l = ( l ^ maxLevel )   + ( l << 11 );
+        int l = (inline != null) ? inline.hashCode() : 0;
+        l = (l ^ minLevel) + (l << 19);
+        l = (l ^ maxLevel)   + (l << 11);
         return l;
     }
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer( "RR: { type = \'" );
+        StringBuffer sb = new StringBuffer("RR: { type = \'");
         char c;
         String content = null;
-        if ( inline instanceof WordArea ) {
+        if (inline instanceof WordArea) {
             c = 'W';
-            content = ( (WordArea) inline ) .getWord();
-        } else if ( inline instanceof SpaceArea ) {
+            content = ((WordArea) inline) .getWord();
+        } else if (inline instanceof SpaceArea) {
             c = 'S';
-            content = ( (SpaceArea) inline ) .getSpace();
-        } else if ( inline instanceof Anchor ) {
+            content = ((SpaceArea) inline) .getSpace();
+        } else if (inline instanceof Anchor) {
             c = 'A';
-        } else if ( inline instanceof Leader ) {
+        } else if (inline instanceof Leader) {
             c = 'L';
-        } else if ( inline instanceof Space ) {
+        } else if (inline instanceof Space) {
             c = 'S';
-        } else if ( inline instanceof UnresolvedPageNumber ) {
+        } else if (inline instanceof UnresolvedPageNumber) {
             c = '#';
-            content = ( (UnresolvedPageNumber) inline ) .getText();
-        } else if ( inline instanceof InlineBlockParent ) {
+            content = ((UnresolvedPageNumber) inline) .getText();
+        } else if (inline instanceof InlineBlockParent) {
             c = 'B';
-        } else if ( inline instanceof InlineViewport ) {
+        } else if (inline instanceof InlineViewport) {
             c = 'V';
-        } else if ( inline instanceof InlineParent ) {
+        } else if (inline instanceof InlineParent) {
             c = 'I';
         } else {
             c = '?';
         }
-        sb.append ( c );
-        sb.append ( "\', levels = \'" );
-        sb.append ( generateLevels ( levels ) );
-        sb.append ( "\', min = " );
-        sb.append ( minLevel );
-        sb.append ( ", max = " );
-        sb.append ( maxLevel );
-        sb.append ( ", reversals = " );
-        sb.append ( reversals );
-        sb.append ( ", content = <" );
-        sb.append ( CharUtilities.toNCRefs ( content ) );
-        sb.append ( "> }" );
+        sb.append (c);
+        sb.append ("\', levels = \'");
+        sb.append (generateLevels (levels));
+        sb.append ("\', min = ");
+        sb.append (minLevel);
+        sb.append (", max = ");
+        sb.append (maxLevel);
+        sb.append (", reversals = ");
+        sb.append (reversals);
+        sb.append (", content = <");
+        sb.append (CharUtilities.toNCRefs (content));
+        sb.append ("> }");
         return sb.toString();
     }
-    private String generateLevels ( int[] levels ) {
+    private String generateLevels (int[] levels) {
         StringBuffer lb = new StringBuffer();
         int maxLevel = -1;
         int numLevels = levels.length;
-        for ( int i = 0; i < numLevels; i++ ) {
+        for (int i = 0; i < numLevels; i++) {
             int l = levels [ i ];
-            if ( l > maxLevel ) {
+            if (l > maxLevel) {
                 maxLevel = l;
             }
         }
-        if ( maxLevel < 0 ) {
+        if (maxLevel < 0) {
             // leave level buffer empty
-        } else if ( maxLevel < 10 ) {
+        } else if (maxLevel < 10) {
             // use string of decimal digits
-            for ( int i = 0; i < numLevels; i++ ) {
-                lb.append ( (char) ( '0' + levels [ i ] ) );
+            for (int i = 0; i < numLevels; i++) {
+                lb.append ((char) ('0' + levels [ i ]));
             }
         } else {
             // use comma separated list
             boolean first = true;
-            for ( int i = 0; i < numLevels; i++ ) {
-                if ( first ) {
+            for (int i = 0; i < numLevels; i++) {
+                if (first) {
                     first = false;
                 } else {
                     lb.append(',');
                 }
-                lb.append ( levels [ i ] );
+                lb.append (levels [ i ]);
             }
         }
         return lb.toString();
     }
-    private static int[] makeLevels ( int level, int count ) {
+    private static int[] makeLevels (int level, int count) {
         int[] levels = new int [ count ];
-        Arrays.fill ( levels, level );
+        Arrays.fill (levels, level);
         return levels;
     }
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/TextInterval.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/TextInterval.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/TextInterval.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/TextInterval.java Tue Apr  9 17:31:41 2013
@@ -42,10 +42,10 @@ class TextInterval {
     private int start;              // starting index within delimited text range
     private int end;                // ending index within delimited text range
     private int level;              // resolved level or default (-1)
-    TextInterval ( FONode fn, int start, int end ) {
-        this ( fn, start, start, end, -1 );
+    TextInterval (FONode fn, int start, int end) {
+        this (fn, start, start, end, -1);
     }
-    TextInterval ( FONode fn, int textStart, int start, int end, int level ) {
+    TextInterval (FONode fn, int textStart, int start, int end, int level) {
         this.fn = fn;
         this.textStart = textStart;
         this.start = start;
@@ -67,42 +67,42 @@ class TextInterval {
     int getLevel() {
         return level;
     }
-    void setLevel ( int level ) {
+    void setLevel (int level) {
         this.level = level;
     }
     public int length() {
         return end - start;
     }
     public String getText() {
-        if ( fn instanceof FOText ) {
-            return ( (FOText) fn ) .getCharSequence() .toString();
-        } else if ( fn instanceof Character ) {
-            return new String ( new char[] {( (Character) fn ) .getCharacter()} );
+        if (fn instanceof FOText) {
+            return ((FOText) fn) .getCharSequence() .toString();
+        } else if (fn instanceof Character) {
+            return new String (new char[] {((Character) fn) .getCharacter()});
         } else {
             return null;
         }
     }
     public void assignTextLevels() {
-        if ( fn instanceof FOText ) {
-            ( (FOText) fn ) .setBidiLevel ( level, start - textStart, end - textStart );
-        } else if ( fn instanceof Character ) {
-            ( (Character) fn ) .setBidiLevel ( level );
-        } else if ( fn instanceof AbstractPageNumberCitation ) {
-            ( (AbstractPageNumberCitation) fn ) .setBidiLevel ( level );
-        } else if ( fn instanceof AbstractGraphics ) {
-            ( (AbstractGraphics) fn ) .setBidiLevel ( level );
-        } else if ( fn instanceof Leader ) {
-            ( (Leader) fn ) .setBidiLevel ( level );
+        if (fn instanceof FOText) {
+            ((FOText) fn) .setBidiLevel (level, start - textStart, end - textStart);
+        } else if (fn instanceof Character) {
+            ((Character) fn) .setBidiLevel (level);
+        } else if (fn instanceof AbstractPageNumberCitation) {
+            ((AbstractPageNumberCitation) fn) .setBidiLevel (level);
+        } else if (fn instanceof AbstractGraphics) {
+            ((AbstractGraphics) fn) .setBidiLevel (level);
+        } else if (fn instanceof Leader) {
+            ((Leader) fn) .setBidiLevel (level);
         }
     }
-    public boolean equals ( Object o ) {
-        if ( o instanceof TextInterval ) {
+    public boolean equals (Object o) {
+        if (o instanceof TextInterval) {
             TextInterval ti = (TextInterval) o;
-            if ( ti.getNode() != fn ) {
+            if (ti.getNode() != fn) {
                 return false;
-            } else if ( ti.getStart() != start ) {
+            } else if (ti.getStart() != start) {
                 return false;
-            } else if ( ti.getEnd() != end ) {
+            } else if (ti.getEnd() != end) {
                 return false;
             } else {
                 return true;
@@ -112,31 +112,31 @@ class TextInterval {
         }
     }
     public int hashCode() {
-        int l = ( fn != null ) ? fn.hashCode() : 0;
-        l = ( l ^ start ) + ( l << 19 );
-        l = ( l ^ end )   + ( l << 11 );
+        int l = (fn != null) ? fn.hashCode() : 0;
+        l = (l ^ start) + (l << 19);
+        l = (l ^ end)   + (l << 11);
         return l;
     }
     public String toString() {
         StringBuffer sb = new StringBuffer();
         char c;
-        if ( fn instanceof FOText ) {
+        if (fn instanceof FOText) {
             c = 'T';
-        } else if ( fn instanceof Character ) {
+        } else if (fn instanceof Character) {
             c = 'C';
-        } else if ( fn instanceof BidiOverride ) {
+        } else if (fn instanceof BidiOverride) {
             c = 'B';
-        } else if ( fn instanceof AbstractPageNumberCitation ) {
+        } else if (fn instanceof AbstractPageNumberCitation) {
             c = '#';
-        } else if ( fn instanceof AbstractGraphics ) {
+        } else if (fn instanceof AbstractGraphics) {
             c = 'G';
-        } else if ( fn instanceof Leader ) {
+        } else if (fn instanceof Leader) {
             c = 'L';
         } else {
             c = '?';
         }
-        sb.append ( c );
-        sb.append ( "[" + start + "," + end + "][" + textStart + "](" + level + ")" );
+        sb.append (c);
+        sb.append ("[" + start + "," + end + "][" + textStart + "](" + level + ")");
         return sb.toString();
     }
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java Tue Apr  9 17:31:41 2013
@@ -54,7 +54,7 @@ class UnflattenProcessor {
     private TextArea                tcNew;          // new text area container being constructed
     private Stack<InlineParent>     icOrig;         // stack of original inline parent containers
     private Stack<InlineParent>     icNew;          // stack of new inline parent containers being constructed
-    UnflattenProcessor ( List<InlineArea> inlines ) {
+    UnflattenProcessor (List<InlineArea> inlines) {
         this.il = inlines;
         this.ilNew = new ArrayList<InlineArea>();
         this.iaLevelLast = -1;
@@ -62,90 +62,90 @@ class UnflattenProcessor {
         this.icNew = new Stack<InlineParent>();
     }
     List unflatten() {
-        if ( il != null ) {
-            for ( Iterator<InlineArea> it = il.iterator(); it.hasNext(); ) {
-                process ( it.next() );
+        if (il != null) {
+            for (Iterator<InlineArea> it = il.iterator(); it.hasNext(); ) {
+                process (it.next());
             }
         }
         finishAll();
         return ilNew;
     }
-    private void process ( InlineArea ia ) {
-        process ( findInlineContainers ( ia ), findTextContainer ( ia ), ia );
+    private void process (InlineArea ia) {
+        process (findInlineContainers (ia), findTextContainer (ia), ia);
     }
-    private void process ( List<InlineParent> ich, TextArea tc, InlineArea ia ) {
-        if ( ( tcNew == null ) || ( tc != tcNew ) ) {
-            maybeFinishTextContainer ( tc, ia );
-            maybeFinishInlineContainers ( ich, tc, ia );
-            update ( ich, tc, ia );
+    private void process (List<InlineParent> ich, TextArea tc, InlineArea ia) {
+        if ((tcNew == null) || (tc != tcNew)) {
+            maybeFinishTextContainer (tc, ia);
+            maybeFinishInlineContainers (ich, tc, ia);
+            update (ich, tc, ia);
         } else {
             // skip inline area whose text container is the current new text container,
             // which occurs in the context of the inline runs produced by a filled area
         }
     }
-    private boolean shouldFinishTextContainer ( TextArea tc, InlineArea ia ) {
-        if ( ( tcOrig != null ) && ( tc != tcOrig ) ) {
+    private boolean shouldFinishTextContainer (TextArea tc, InlineArea ia) {
+        if ((tcOrig != null) && (tc != tcOrig)) {
             return true;
-        } else if ( ( iaLevelLast != -1 ) && ( ia.getBidiLevel() != iaLevelLast ) ) {
+        } else if ((iaLevelLast != -1) && (ia.getBidiLevel() != iaLevelLast)) {
             return true;
         } else {
             return false;
         }
     }
     private void finishTextContainer() {
-        finishTextContainer ( null, null );
+        finishTextContainer (null, null);
     }
-    private void finishTextContainer ( TextArea tc, InlineArea ia ) {
-        if ( tcNew != null ) {
-            updateIPD ( tcNew );
-            if ( ! icNew.empty() ) {
-                icNew.peek().addChildArea ( tcNew );
+    private void finishTextContainer (TextArea tc, InlineArea ia) {
+        if (tcNew != null) {
+            updateIPD (tcNew);
+            if (! icNew.empty()) {
+                icNew.peek().addChildArea (tcNew);
             } else {
-                ilNew.add ( tcNew );
+                ilNew.add (tcNew);
             }
         }
         tcNew = null;
     }
-    private void maybeFinishTextContainer ( TextArea tc, InlineArea ia ) {
-        if ( shouldFinishTextContainer ( tc, ia ) ) {
-            finishTextContainer ( tc, ia );
+    private void maybeFinishTextContainer (TextArea tc, InlineArea ia) {
+        if (shouldFinishTextContainer (tc, ia)) {
+            finishTextContainer (tc, ia);
         }
     }
-    private boolean shouldFinishInlineContainer ( List<InlineParent> ich, TextArea tc, InlineArea ia ) {
-        if ( ( ich == null ) || ich.isEmpty() ) {
+    private boolean shouldFinishInlineContainer (List<InlineParent> ich, TextArea tc, InlineArea ia) {
+        if ((ich == null) || ich.isEmpty()) {
             return ! icOrig.empty();
         } else {
-            if ( ! icOrig.empty() ) {
+            if (! icOrig.empty()) {
                 InlineParent ic  = ich.get(0);
                 InlineParent ic0 = icOrig.peek();
-                return ( ic != ic0 ) && ! isInlineParentOf ( ic, ic0 );
+                return (ic != ic0) && ! isInlineParentOf (ic, ic0);
             } else {
                 return false;
             }
         }
     }
     private void finishInlineContainer() {
-        finishInlineContainer ( null, null, null );
+        finishInlineContainer (null, null, null);
     }
-    private void finishInlineContainer ( List<InlineParent> ich, TextArea tc, InlineArea ia ) {
-        if ( ( ich != null ) && ! ich.isEmpty() ) {     // finish non-matching inner inline container(s)
-            for ( Iterator<InlineParent> it = ich.iterator(); it.hasNext(); ) {
+    private void finishInlineContainer (List<InlineParent> ich, TextArea tc, InlineArea ia) {
+        if ((ich != null) && ! ich.isEmpty()) {     // finish non-matching inner inline container(s)
+            for (Iterator<InlineParent> it = ich.iterator(); it.hasNext(); ) {
                 InlineParent ic  = it.next();
                 InlineParent ic0 = icOrig.empty() ? null : icOrig.peek();
-                if ( ic0 == null ) {
+                if (ic0 == null) {
                     assert icNew.empty();
-                } else if ( ic != ic0 ) {
+                } else if (ic != ic0) {
                     assert ! icNew.empty();
                     InlineParent icO0 = icOrig.pop();
                     InlineParent icN0 = icNew.pop();
                     assert icO0 != null;
                     assert icN0 != null;
-                    if ( icNew.empty() ) {
-                        ilNew.add ( icN0 );
+                    if (icNew.empty()) {
+                        ilNew.add (icN0);
                     } else {
-                        icNew.peek().addChildArea ( icN0 );
+                        icNew.peek().addChildArea (icN0);
                     }
-                    if ( ! icOrig.empty() && ( icOrig.peek() == ic ) ) {
+                    if (! icOrig.empty() && (icOrig.peek() == ic)) {
                         break;
                     }
                 } else {
@@ -153,184 +153,184 @@ class UnflattenProcessor {
                 }
             }
         } else {                                        // finish all inline containers
-            while ( ! icNew.empty() ) {
+            while (! icNew.empty()) {
                 InlineParent icO0 = icOrig.pop();
                 InlineParent icN0 = icNew.pop();
                 assert icO0 != null;
                 assert icN0 != null;
-                if ( icNew.empty() ) {
-                    ilNew.add ( icN0 );
+                if (icNew.empty()) {
+                    ilNew.add (icN0);
                 } else {
-                    icNew.peek().addChildArea ( icN0 );
+                    icNew.peek().addChildArea (icN0);
                 }
             }
         }
     }
-    private void maybeFinishInlineContainers ( List<InlineParent> ich, TextArea tc, InlineArea ia ) {
-        if ( shouldFinishInlineContainer ( ich, tc, ia ) ) {
-            finishInlineContainer ( ich, tc, ia );
+    private void maybeFinishInlineContainers (List<InlineParent> ich, TextArea tc, InlineArea ia) {
+        if (shouldFinishInlineContainer (ich, tc, ia)) {
+            finishInlineContainer (ich, tc, ia);
         }
     }
     private void finishAll() {
         finishTextContainer();
         finishInlineContainer();
     }
-    private void update ( List<InlineParent> ich, TextArea tc, InlineArea ia ) {
-        if ( ! alreadyUnflattened ( ia ) ) {
-            if ( ( ich != null ) && ! ich.isEmpty() ) {
-                pushInlineContainers ( ich );
+    private void update (List<InlineParent> ich, TextArea tc, InlineArea ia) {
+        if (! alreadyUnflattened (ia)) {
+            if ((ich != null) && ! ich.isEmpty()) {
+                pushInlineContainers (ich);
             }
-            if ( tc != null ) {
-                pushTextContainer ( tc, ia );
+            if (tc != null) {
+                pushTextContainer (tc, ia);
             } else {
-                pushNonTextInline ( ia );
+                pushNonTextInline (ia);
             }
             iaLevelLast = ia.getBidiLevel();
             tcOrig = tc;
-        } else  if ( tcNew != null ) {
+        } else  if (tcNew != null) {
             finishTextContainer();
             tcOrig = null;
         } else {
             tcOrig = null;
         }
     }
-    private boolean alreadyUnflattened ( InlineArea ia ) {
-        for ( Iterator<InlineArea> it = ilNew.iterator(); it.hasNext(); ) {
-            if ( ia.isAncestorOrSelf ( it.next() ) ) {
+    private boolean alreadyUnflattened (InlineArea ia) {
+        for (Iterator<InlineArea> it = ilNew.iterator(); it.hasNext(); ) {
+            if (ia.isAncestorOrSelf (it.next())) {
                 return true;
             }
         }
         return false;
     }
-    private void pushInlineContainers ( List<InlineParent> ich ) {
+    private void pushInlineContainers (List<InlineParent> ich) {
         LinkedList<InlineParent> icl = new LinkedList<InlineParent>();
-        for ( Iterator<InlineParent> it = ich.iterator(); it.hasNext(); ) {
+        for (Iterator<InlineParent> it = ich.iterator(); it.hasNext(); ) {
             InlineParent ic = it.next();
-            if ( icOrig.search ( ic ) >= 0 ) {
+            if (icOrig.search (ic) >= 0) {
                 break;
             } else {
-                icl.addFirst ( ic );
+                icl.addFirst (ic);
             }
         }
-        for ( Iterator<InlineParent> it = icl.iterator(); it.hasNext(); ) {
+        for (Iterator<InlineParent> it = icl.iterator(); it.hasNext(); ) {
             InlineParent ic = it.next();
-            icOrig.push ( ic );
-            icNew.push ( generateInlineContainer ( ic ) );
+            icOrig.push (ic);
+            icNew.push (generateInlineContainer (ic));
         }
     }
-    private void pushTextContainer ( TextArea tc, InlineArea ia ) {
-        if ( tc instanceof UnresolvedPageNumber ) {
+    private void pushTextContainer (TextArea tc, InlineArea ia) {
+        if (tc instanceof UnresolvedPageNumber) {
             tcNew = tc;
         } else {
-            if ( tcNew == null ) {
-                tcNew = generateTextContainer ( tc );
+            if (tcNew == null) {
+                tcNew = generateTextContainer (tc);
             }
-            tcNew.addChildArea ( ia );
+            tcNew.addChildArea (ia);
         }
     }
-    private void pushNonTextInline ( InlineArea ia ) {
-        if ( icNew.empty() ) {
-            ilNew.add ( ia );
+    private void pushNonTextInline (InlineArea ia) {
+        if (icNew.empty()) {
+            ilNew.add (ia);
         } else {
-            icNew.peek().addChildArea ( ia );
+            icNew.peek().addChildArea (ia);
         }
     }
-    private InlineParent generateInlineContainer ( InlineParent i ) {
-        if ( i instanceof BasicLinkArea ) {
-            return generateBasicLinkArea ( (BasicLinkArea) i );
-        } else if ( i instanceof FilledArea ) {
-            return generateFilledArea ( (FilledArea) i );
+    private InlineParent generateInlineContainer (InlineParent i) {
+        if (i instanceof BasicLinkArea) {
+            return generateBasicLinkArea ((BasicLinkArea) i);
+        } else if (i instanceof FilledArea) {
+            return generateFilledArea ((FilledArea) i);
         } else {
-            return generateInlineContainer0 ( i );
+            return generateInlineContainer0 (i);
         }
     }
-    private InlineParent generateBasicLinkArea ( BasicLinkArea l ) {
+    private InlineParent generateBasicLinkArea (BasicLinkArea l) {
         BasicLinkArea lc = new BasicLinkArea();
-        if ( l != null ) {
-            initializeInlineContainer ( lc, l );
-            initializeLinkArea ( lc, l );
+        if (l != null) {
+            initializeInlineContainer (lc, l);
+            initializeLinkArea (lc, l);
         }
         return lc;
     }
-    private void initializeLinkArea ( BasicLinkArea lc, BasicLinkArea l ) {
+    private void initializeLinkArea (BasicLinkArea lc, BasicLinkArea l) {
         assert lc != null;
         assert l != null;
         LinkResolver r = l.getResolver();
-        if ( r != null ) {
+        if (r != null) {
             String[] idrefs = r.getIDRefs();
-            if ( idrefs.length > 0 ) {
+            if (idrefs.length > 0) {
                 String idref = idrefs[0];
-                LinkResolver lr = new LinkResolver ( idref, lc );
-                lc.setResolver ( lr );
-                r.addDependent ( lr );
+                LinkResolver lr = new LinkResolver (idref, lc);
+                lc.setResolver (lr);
+                r.addDependent (lr);
             }
         }
     }
-    private InlineParent generateFilledArea ( FilledArea f ) {
+    private InlineParent generateFilledArea (FilledArea f) {
         FilledArea fc = new FilledArea();
-        if ( f != null ) {
-            initializeInlineContainer ( fc, f );
-            initializeFilledArea ( fc, f );
+        if (f != null) {
+            initializeInlineContainer (fc, f);
+            initializeFilledArea (fc, f);
         }
         return fc;
     }
-    private void initializeFilledArea ( FilledArea fc, FilledArea f ) {
+    private void initializeFilledArea (FilledArea fc, FilledArea f) {
         assert fc != null;
         assert f != null;
-        fc.setIPD ( f.getIPD() );
-        fc.setUnitWidth ( f.getUnitWidth() );
-        fc.setAdjustingInfo( f.getAdjustingInfo() );
+        fc.setIPD (f.getIPD());
+        fc.setUnitWidth (f.getUnitWidth());
+        fc.setAdjustingInfo(f.getAdjustingInfo());
     }
-    private InlineParent generateInlineContainer0 ( InlineParent i ) {
+    private InlineParent generateInlineContainer0 (InlineParent i) {
         InlineParent ic = new InlineParent();
-        if ( i != null ) {
-            initializeInlineContainer ( ic, i );
+        if (i != null) {
+            initializeInlineContainer (ic, i);
         }
         return ic;
     }
-    private void initializeInlineContainer ( InlineParent ic, InlineParent i ) {
+    private void initializeInlineContainer (InlineParent ic, InlineParent i) {
         assert ic != null;
         assert i != null;
-        ic.setTraits ( i.getTraits() );
-        ic.setBPD ( i.getBPD() );
-        ic.setBlockProgressionOffset ( i.getBlockProgressionOffset() );
+        ic.setTraits (i.getTraits());
+        ic.setBPD (i.getBPD());
+        ic.setBlockProgressionOffset (i.getBlockProgressionOffset());
     }
-    private TextArea generateTextContainer ( TextArea t ) {
+    private TextArea generateTextContainer (TextArea t) {
         TextArea tc = new TextArea();
-        if ( t != null ) {
-            tc.setTraits ( t.getTraits() );
-            tc.setBPD ( t.getBPD() );
-            tc.setBlockProgressionOffset ( t.getBlockProgressionOffset() );
-            tc.setBaselineOffset ( t.getBaselineOffset() );
-            tc.setTextWordSpaceAdjust ( t.getTextWordSpaceAdjust() );
-            tc.setTextLetterSpaceAdjust ( t.getTextLetterSpaceAdjust() );
+        if (t != null) {
+            tc.setTraits (t.getTraits());
+            tc.setBPD (t.getBPD());
+            tc.setBlockProgressionOffset (t.getBlockProgressionOffset());
+            tc.setBaselineOffset (t.getBaselineOffset());
+            tc.setTextWordSpaceAdjust (t.getTextWordSpaceAdjust());
+            tc.setTextLetterSpaceAdjust (t.getTextLetterSpaceAdjust());
         }
         return tc;
     }
-    private void updateIPD ( TextArea tc ) {
+    private void updateIPD (TextArea tc) {
         int numAdjustable = 0;
-        for ( Iterator it = tc.getChildAreas().iterator(); it.hasNext(); ) {
+        for (Iterator it = tc.getChildAreas().iterator(); it.hasNext(); ) {
             InlineArea ia = (InlineArea) it.next();
-            if ( ia instanceof SpaceArea ) {
+            if (ia instanceof SpaceArea) {
                 SpaceArea sa = (SpaceArea) ia;
-                if ( sa.isAdjustable() ) {
+                if (sa.isAdjustable()) {
                     numAdjustable++;
                 }
             }
         }
-        if ( numAdjustable > 0 ) {
-            tc.setIPD ( tc.getIPD() + ( numAdjustable * tc.getTextWordSpaceAdjust() ) );
+        if (numAdjustable > 0) {
+            tc.setIPD (tc.getIPD() + (numAdjustable * tc.getTextWordSpaceAdjust()));
         }
     }
-    private TextArea findTextContainer ( InlineArea ia ) {
+    private TextArea findTextContainer (InlineArea ia) {
         assert ia != null;
         TextArea t = null;
-        while ( t == null ) {
-            if ( ia instanceof TextArea ) {
+        while (t == null) {
+            if (ia instanceof TextArea) {
                 t = (TextArea) ia;
             } else {
                 Area p = ia.getParentArea();
-                if ( p instanceof InlineArea ) {
+                if (p instanceof InlineArea) {
                     ia = (InlineArea) p;
                 } else {
                     break;
@@ -339,23 +339,23 @@ class UnflattenProcessor {
         }
         return t;
     }
-    private List<InlineParent> findInlineContainers ( InlineArea ia ) {
+    private List<InlineParent> findInlineContainers (InlineArea ia) {
         assert ia != null;
         List<InlineParent> ich = new ArrayList<InlineParent>();
         Area a = ia.getParentArea();
-        while ( a != null ) {
-            if ( a instanceof InlineArea ) {
-                if ( ( a instanceof InlineParent ) && ! ( a instanceof TextArea ) ) {
-                    ich.add ( (InlineParent) a );
+        while (a != null) {
+            if (a instanceof InlineArea) {
+                if ((a instanceof InlineParent) && ! (a instanceof TextArea)) {
+                    ich.add ((InlineParent) a);
                 }
-                a = ( (InlineArea) a ) .getParentArea();
+                a = ((InlineArea) a) .getParentArea();
             } else {
                 a = null;
             }
         }
         return ich;
     }
-    private boolean isInlineParentOf ( InlineParent ic0, InlineParent ic1 ) {
+    private boolean isInlineParentOf (InlineParent ic0, InlineParent ic1) {
         assert ic0 != null;
         return ic0.getParentArea() == ic1;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message