From: Simon Pepping Date: Sat, 18 Dec 2010 11:36:28 +0000 (+0000) Subject: Merge from trunk X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e914537cba3c39675b04de25c292b1f51d46e3e0;p=xmlgraphics-fop.git Merge from trunk git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts@1050618 13f79535-47bb-0310-9956-ffa450edef68 --- e914537cba3c39675b04de25c292b1f51d46e3e0 diff --cc src/java/org/apache/fop/area/LineArea.java index b4aabeea1,b33b5da14..bca42186e --- a/src/java/org/apache/fop/area/LineArea.java +++ b/src/java/org/apache/fop/area/LineArea.java @@@ -206,8 -206,11 +215,11 @@@ public class LineArea extends Area * and destroy the AdjustingInfo object if there are * no UnresolvedAreas left */ - public void finalise() { + public void finish() { if (adjustingInfo.lineAlignment == Constants.EN_JUSTIFY) { + if (log.isTraceEnabled()) { + log.trace("Applying variation factor to justified line: " + adjustingInfo); + } // justified line: apply the variation factor boolean bUnresolvedAreasPresent = false; // recursively apply variation factor to descendant areas diff --cc src/java/org/apache/fop/area/inline/InlineParent.java index 786170186,86c9141e6..9e69e00a7 --- a/src/java/org/apache/fop/area/inline/InlineParent.java +++ b/src/java/org/apache/fop/area/inline/InlineParent.java @@@ -19,11 -19,9 +19,10 @@@ package org.apache.fop.area.inline; - import org.apache.fop.area.Area; - - import java.util.ArrayList; - import java.util.Iterator; import java.util.List; ++import java.util.Iterator; + + import org.apache.fop.area.Area; /** * Inline parent area. @@@ -87,35 -86,17 +88,40 @@@ public class InlineParent extends Inlin public boolean applyVariationFactor(double variationFactor, int lineStretch, int lineShrink) { boolean bUnresolvedAreasPresent = false; + int cumulativeIPD = 0; // recursively apply variation factor to descendant areas for (int i = 0, len = inlines.size(); i < len; i++) { - bUnresolvedAreasPresent |= ((InlineArea)inlines.get(i)) - .applyVariationFactor(variationFactor, lineStretch, lineShrink); + InlineArea inline = inlines.get(i); + bUnresolvedAreasPresent |= inline.applyVariationFactor( + variationFactor, lineStretch, lineShrink); + cumulativeIPD += inline.getIPD(); //Update this area's IPD based on changes to children } + setIPD(cumulativeIPD); + return bUnresolvedAreasPresent; } -} + /** + * Reset bidirectionality level of all children to default (-1), + * 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(); + } + } + private void updateLevel ( int newLevel ) { + if ( newLevel >= 0 ) { + int curLevel = getBidiLevel(); + if ( curLevel >= 0 ) { + if ( newLevel < curLevel ) { + setBidiLevel ( newLevel ); + } + } else { + setBidiLevel ( newLevel ); + } + } + } + + +}