keiron      2002/11/13 02:25:58

  Modified:    src/org/apache/fop/layoutmgr AbstractLayoutManager.java
                        BlockContainerLayoutManager.java
                        BlockLayoutManager.java
                        BlockStackingLayoutManager.java BreakPoss.java
                        ContentLayoutManager.java FlowLayoutManager.java
                        InlineStackingLayoutManager.java LMiter.java
                        LayoutContext.java LayoutManager.java
                        LeafNodeLayoutManager.java LeafPosition.java
                        LineLayoutManager.java NonLeafPosition.java
                        PageLayoutManager.java Position.java
                        PositionIterator.java SpaceSpecifier.java
                        StaticContentLayoutManager.java
                        TextLayoutManager.java
               src/org/apache/fop/layoutmgr/list Item.java
                        ListBlockLayoutManager.java
                        ListItemLayoutManager.java
               src/org/apache/fop/layoutmgr/table Body.java Caption.java
                        Cell.java Row.java
                        TableAndCaptionLayoutManager.java
                        TableLayoutManager.java
  Log:
  cleanup of lms
  attempt at fixing some block layout problems
  
  Revision  Changes    Path
  1.17      +33 -35    xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java
  
  Index: AbstractLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AbstractLayoutManager.java        6 Nov 2002 15:36:29 -0000       1.16
  +++ AbstractLayoutManager.java        13 Nov 2002 10:25:48 -0000      1.17
  @@ -28,10 +28,10 @@
       protected String foID = null;
   
       /** True if this LayoutManager has handled all of its content. */
  -    private boolean m_bFinished = false;
  -    protected LayoutManager m_curChildLM = null;
  -    protected ListIterator m_childLMiter;
  -    protected boolean m_bInited = false;
  +    private boolean bFinished = false;
  +    protected LayoutManager curChildLM = null;
  +    protected ListIterator childLMiter;
  +    protected boolean bInited = false;
   
       protected LayoutPos curPos = new LayoutPos();
   
  @@ -48,7 +48,7 @@
           this.fobj = fobj;
           foID = fobj.getID();
           this.parentLM = null;
  -        m_childLMiter = lmIter;
  +        childLMiter = lmIter;
       }
   
       public void setParentLM(LayoutManager lm) {
  @@ -104,26 +104,26 @@
        * and print a warning.
        */
       protected LayoutManager getChildLM() {
  -        if (m_curChildLM != null && !m_curChildLM.isFinished()) {
  -            return m_curChildLM;
  +        if (curChildLM != null && !curChildLM.isFinished()) {
  +            return curChildLM;
           }
  -        while (m_childLMiter.hasNext()) {
  -            m_curChildLM = (LayoutManager) m_childLMiter.next();
  -            m_curChildLM.setParentLM(this);
  -            m_curChildLM.init();
  -            return m_curChildLM;
  +        while (childLMiter.hasNext()) {
  +            curChildLM = (LayoutManager) childLMiter.next();
  +            curChildLM.setParentLM(this);
  +            curChildLM.init();
  +            return curChildLM;
           }
           return null;
       }
   
       protected boolean hasMoreLM(LayoutManager prevLM) {
  -        // prevLM should = m_curChildLM
  -        if (prevLM != m_curChildLM) {
  +        // prevLM should = curChildLM
  +        if (prevLM != curChildLM) {
               //log.debug("AbstractLayoutManager.peekNextLM: " + 
               //                   "passed LM is not current child LM!");
               return false;
           }
  -        return !m_childLMiter.hasNext();
  +        return !childLMiter.hasNext();
       }
   
   
  @@ -138,20 +138,20 @@
       protected void reset(Position pos) {
           //if (lm == null) return; 
           LayoutManager lm = (pos != null) ? pos.getLM() : null;
  -        if (m_curChildLM != lm) {
  -            // ASSERT m_curChildLM == (LayoutManager)m_childLMiter.previous()
  -            if (m_childLMiter.hasPrevious() && m_curChildLM !=
  -                    (LayoutManager) m_childLMiter.previous()) {
  +        if (curChildLM != lm) {
  +            // ASSERT curChildLM == (LayoutManager)childLMiter.previous()
  +            if (childLMiter.hasPrevious() && curChildLM !=
  +                    (LayoutManager) childLMiter.previous()) {
                   //log.error("LMiter problem!");
               }
  -            while (m_curChildLM != lm && m_childLMiter.hasPrevious()) {
  -                m_curChildLM.resetPosition(null);
  -                m_curChildLM = (LayoutManager) m_childLMiter.previous();
  +            while (curChildLM != lm && childLMiter.hasPrevious()) {
  +                curChildLM.resetPosition(null);
  +                curChildLM = (LayoutManager) childLMiter.previous();
               }
  -            m_childLMiter.next(); // Otherwise next returns same object
  +            childLMiter.next(); // Otherwise next returns same object
           }
  -        if(m_curChildLM != null) {
  -            m_curChildLM.resetPosition(pos);
  +        if(curChildLM != null) {
  +            curChildLM.resetPosition(pos);
           }
           if (isFinished()) {
               setFinished(false);
  @@ -170,9 +170,9 @@
        * for the areas it will create, based on Properties set on its FO.
        */
       public void init() { 
  -        if (fobj != null && m_bInited == false) {
  +        if (fobj != null && bInited == false) {
               initProperties(fobj.getPropertyManager());
  -            m_bInited = true;
  +            bInited = true;
           }
       }
   
  @@ -191,11 +191,11 @@
        * ie. the last one returned represents the end of the content.
        */
       public boolean isFinished() {
  -        return m_bFinished;
  +        return bFinished;
       }
   
  -    public void setFinished(boolean bFinished) {
  -        m_bFinished = bFinished;
  +    public void setFinished(boolean fin) {
  +        bFinished = fin;
       }
   
   
  @@ -243,12 +243,10 @@
           return null;
       }
   
  -    protected boolean flush() {
  -        return false;
  +    protected void flush() {
       }
   
  -    public boolean addChild(Area childArea) {
  -        return false;
  +    public void addChild(Area childArea) {
       }
   
       /**
  
  
  
  1.5       +3 -5      
xml-fop/src/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
  
  Index: BlockContainerLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BlockContainerLayoutManager.java  6 Nov 2002 15:46:55 -0000       1.4
  +++ BlockContainerLayoutManager.java  13 Nov 2002 10:25:48 -0000      1.5
  @@ -37,7 +37,7 @@
       private BlockViewport viewportBlockArea;
       private Block curBlockArea;
   
  -    ArrayList childBreaks = new ArrayList();
  +    List childBreaks = new ArrayList();
   
       AbsolutePositionProps abProps;
       FODimension relDims;
  @@ -275,12 +275,10 @@
       }
   
   
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
               curBlockArea.addBlock((Block) childArea);
  -            //return super.addChild(childArea);
           }
  -        return false;
       }
   
       public void resetPosition(Position resetPos) {
  
  
  
  1.23      +38 -26    xml-fop/src/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- BlockLayoutManager.java   1 Nov 2002 10:49:34 -0000       1.22
  +++ BlockLayoutManager.java   13 Nov 2002 10:25:48 -0000      1.23
  @@ -41,7 +41,7 @@
       int lineHeight = 14000;
       int follow = 2000;
   
  -    ArrayList childBreaks = new ArrayList();
  +    protected List childBreaks = new ArrayList();
   
       /**
        * Iterator for Block layout.
  @@ -63,11 +63,11 @@
                   LayoutManager lm = (LayoutManager) proxy.next();
                   if(lm.generatesInlineAreas()) {
                       LineLayoutManager lineLM = createLineManager(lm);
  -                    m_listLMs.add(lineLM);
  +                    listLMs.add(lineLM);
                   } else {
  -                    m_listLMs.add(lm);
  +                    listLMs.add(lm);
                   }
  -                if (m_curPos < m_listLMs.size()) {
  +                if (curPos < listLMs.size()) {
                       return true;
                   }
               }
  @@ -77,7 +77,7 @@
           protected LineLayoutManager createLineManager(
             LayoutManager firstlm) {
               LayoutManager lm;
  -            ArrayList inlines = new ArrayList();
  +            List inlines = new ArrayList();
               inlines.add(firstlm);
               while (proxy.hasNext()) {
                   lm = (LayoutManager) proxy.next();
  @@ -98,7 +98,7 @@
   
       public BlockLayoutManager(FObj fobj) {
           super(fobj);
  -        m_childLMiter = new BlockLMiter(m_childLMiter);
  +        childLMiter = new BlockLMiter(childLMiter);
       }
   
       public void setBlockTextInfo(TextInfo ti) {
  @@ -118,7 +118,9 @@
       }
       
       public BreakPoss getNextBreakPoss(LayoutContext context) {
  -        LayoutManager curLM ; // currently active LM
  +        LayoutManager curLM; // currently active LM
  +
  +        int ipd = context.getRefIPD();
   
           MinOptMax stackSize = new MinOptMax();
           // if starting add space before
  @@ -129,7 +131,6 @@
           while ((curLM = getChildLM()) != null) {
               // Make break positions and return blocks!
               // Set up a LayoutContext
  -            int ipd = context.getRefIPD();
               BreakPoss bp;
   
               LayoutContext childLC = new LayoutContext(0);
  @@ -137,7 +138,7 @@
               // line LM actually generates a LineArea which is a block
               if (curLM.generatesInlineAreas()) {
                   // set stackLimit for lines
  -                childLC.setStackLimit(new MinOptMax(ipd/* - m_iIndents - 
m_iTextIndent*/));
  +                childLC.setStackLimit(new MinOptMax(ipd/* - iIndents - 
iTextIndent*/));
                   childLC.setRefIPD(ipd);
               } else {
                   childLC.setStackLimit(
  @@ -145,7 +146,7 @@
                                        stackSize));
                   childLC.setRefIPD(ipd);
               }
  -
  +            boolean over = false;
               while (!curLM.isFinished()) {
                   if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
                       stackSize.add(bp.getStackingSize());
  @@ -156,6 +157,7 @@
                           } else {
                               curLM.resetPosition(null);
                           }
  +                        over = true;
                           break;
                       }
                       lastPos = bp;
  @@ -163,23 +165,28 @@
   
                       if (curLM.generatesInlineAreas()) {
                           // Reset stackLimit for non-first lines
  -                        childLC.setStackLimit(new MinOptMax(ipd/* - m_iIndents*/));
  +                        childLC.setStackLimit(new MinOptMax(ipd/* - iIndents*/));
                       } else {
  -                        childLC.setStackLimit( MinOptMax.subtract(
  +                        childLC.setStackLimit(MinOptMax.subtract(
                                                    context.getStackLimit(), 
stackSize));
                       }
                   }
               }
  -            if(getChildLM() == null) {
  -                stackSize.add(layoutProps.spaceAfter.space);
  -            }
  -            BreakPoss breakPoss = new BreakPoss(
  +            if(getChildLM() == null || over) {
  +                if(getChildLM() == null) {
  +                    setFinished(true);
  +                    stackSize.add(layoutProps.spaceAfter.space);
  +                }
  +                BreakPoss breakPoss = new BreakPoss(
                                       new LeafPosition(this, childBreaks.size() - 1));
  -            breakPoss.setStackingSize(stackSize);
  -            return breakPoss;
  +                breakPoss.setStackingSize(stackSize);
  +                return breakPoss;
  +            }
           }
           setFinished(true);
  -        return null;
  +        BreakPoss breakPoss = new BreakPoss(new LeafPosition(this, -2));
  +        breakPoss.setStackingSize(stackSize);
  +        return breakPoss;
       }
   
       public void addAreas(PositionIterator parentIter,
  @@ -197,6 +204,12 @@
           LayoutContext lc = new LayoutContext(0);
           while (parentIter.hasNext()) {
               LeafPosition lfp = (LeafPosition) parentIter.next();
  +            if (lfp.getLeafPos() == -2) {
  +                childBreaks.clear();
  +                curBlockArea = null;
  +                flush();
  +                return;
  +            }
               // Add the block areas to Area
               PositionIterator breakPosIter =
                 new BreakPossPosIter(childBreaks, iStartPos,
  @@ -246,24 +259,23 @@
           return curBlockArea;
       }
   
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
               if (childArea instanceof LineArea) {
                   curBlockArea.addLineArea((LineArea) childArea);
  -
  -                return false;
               } else {
                   curBlockArea.addBlock((Block) childArea);
  -
  -                return false;
               }
           }
  -        return false;
       }
   
       public void resetPosition(Position resetPos) {
           if (resetPos == null) {
               reset(null);
  +            childBreaks.clear();
  +        } else {
  +            //reset(resetPos);
  +            LayoutManager lm = resetPos.getLM();
           }
       }
   }
  
  
  
  1.13      +6 -10     
xml-fop/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
  
  Index: BlockStackingLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- BlockStackingLayoutManager.java   25 Oct 2002 09:29:45 -0000      1.12
  +++ BlockStackingLayoutManager.java   13 Nov 2002 10:25:48 -0000      1.13
  @@ -89,19 +89,16 @@
        * @param childArea the area to add: will be some block-stacked Area.
        * @param parentArea the area in which to add the childArea
        */
  -    protected boolean addChildToArea(Area childArea,
  +    protected void addChildToArea(Area childArea,
                                        BlockParent parentArea) {
           // This should be a block-level Area (Block in the generic sense)
           if (!(childArea instanceof Block)) {
               //log.error("Child not a Block in BlockStackingLM!");
  -            return false;
           }
   
           MinOptMax spaceBefore = resolveSpaceSpecifier(childArea);
           parentArea.addBlock((Block) childArea);
           flush(); // hand off current area to parent
  -
  -        return true;
       }
   
   
  @@ -113,18 +110,17 @@
        * If so, add it. Otherwise initiate breaking.
        * @param childArea the area to add: will be some block-stacked Area.
        */
  -    public boolean addChild(Area childArea) {
  -        return addChildToArea(childArea, getCurrentArea());
  +    public void addChild(Area childArea) {
  +        addChildToArea(childArea, getCurrentArea());
       }
   
       /**
        * Force current area to be added to parent area.
        */
  -    protected boolean flush() {
  +    protected void flush() {
           if (getCurrentArea() != null) {
  -            return parentLM.addChild(getCurrentArea());
  +            parentLM.addChild(getCurrentArea());
           }
  -        return false;
       }
   
   }
  
  
  
  1.9       +5 -1      xml-fop/src/org/apache/fop/layoutmgr/BreakPoss.java
  
  Index: BreakPoss.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BreakPoss.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BreakPoss.java    3 Sep 2002 11:45:13 -0000       1.8
  +++ BreakPoss.java    13 Nov 2002 10:25:48 -0000      1.9
  @@ -38,6 +38,10 @@
        * in the lowest level text LM will be suppressed.
        */
       public static final int REST_ARE_SUPPRESS_AT_LB = 0x200;
  +    /**
  +     * Next area for LM overflows
  +     */
  +    public static final int NEXT_OVERFLOWS = 0x400;
   
       /** The opaque position object used by m_lm to record its
        *  break position.
  
  
  
  1.10      +7 -6      xml-fop/src/org/apache/fop/layoutmgr/ContentLayoutManager.java
  
  Index: ContentLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/ContentLayoutManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ContentLayoutManager.java 25 Oct 2002 09:29:45 -0000      1.9
  +++ ContentLayoutManager.java 13 Nov 2002 10:25:48 -0000      1.10
  @@ -6,13 +6,15 @@
    */
   package org.apache.fop.layoutmgr;
   
  -import java.util.List;
  -
   import org.apache.fop.area.Area;
   import org.apache.fop.area.MinOptMax;
   import org.apache.fop.area.Resolveable;
   import org.apache.fop.area.PageViewport;
   
  +import java.util.List;
  +import java.util.ArrayList;
  +
  +
   /**
    * Content Layout Manager.
    * For use with objects that contain inline areas such as
  @@ -35,7 +37,7 @@
   
       public void fillArea(LayoutManager curLM) {
   
  -        List childBreaks = new java.util.ArrayList();
  +        List childBreaks = new ArrayList();
           MinOptMax stack = new MinOptMax();
           int ipd = 1000000;
           BreakPoss bp;
  @@ -116,9 +118,8 @@
       }
   
       /** @see org.apache.fop.layoutmgr.LayoutManager */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           holder.addChild(childArea);
  -        return true;
       }
   
       /** @see org.apache.fop.layoutmgr.LayoutManager */
  
  
  
  1.15      +5 -5      xml-fop/src/org/apache/fop/layoutmgr/FlowLayoutManager.java
  
  Index: FlowLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/FlowLayoutManager.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- FlowLayoutManager.java    25 Oct 2002 09:29:45 -0000      1.14
  +++ FlowLayoutManager.java    13 Nov 2002 10:25:48 -0000      1.15
  @@ -23,7 +23,7 @@
    */
   public class FlowLayoutManager extends BlockStackingLayoutManager {
   
  -    ArrayList blockBreaks = new ArrayList();      
  +    protected List blockBreaks = new ArrayList();      
   
       /** Array of areas currently being filled stored by area class */
       private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
  @@ -119,9 +119,9 @@
        * area class. A Flow can fill at most one area container of any class
        * at any one time. The actual work is done by BlockStackingLM.
        */
  -    public boolean addChild(Area childArea) {
  -        return addChildToArea(childArea,
  -                              this.currentAreas[childArea.getAreaClass()]);
  +    public void addChild(Area childArea) {
  +        addChildToArea(childArea,
  +                          this.currentAreas[childArea.getAreaClass()]);
       }
   
       public Area getParentArea(Area childArea) {
  
  
  
  1.7       +2 -4      
xml-fop/src/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java
  
  Index: InlineStackingLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- InlineStackingLayoutManager.java  5 Nov 2002 11:18:34 -0000       1.6
  +++ InlineStackingLayoutManager.java  13 Nov 2002 10:25:48 -0000      1.7
  @@ -511,8 +511,7 @@
           currentArea = area;
       }
   
  -
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           // Make sure childArea is inline area
           if (childArea instanceof InlineArea) {
               Area parent = getCurrentArea();
  @@ -523,7 +522,6 @@
               }
               parent.addChild(childArea);
           }
  -        return false;
       }
   
       protected void setChildContext(LayoutContext lc) {
  
  
  
  1.6       +25 -24    xml-fop/src/org/apache/fop/layoutmgr/LMiter.java
  
  Index: LMiter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LMiter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LMiter.java       1 Nov 2002 10:49:34 -0000       1.5
  +++ LMiter.java       13 Nov 2002 10:25:48 -0000      1.6
  @@ -10,35 +10,36 @@
   import org.apache.fop.fo.FObj;
   
   import java.util.ArrayList;
  +import java.util.List;
   import java.util.ListIterator;
   import java.util.NoSuchElementException;
   
   public class LMiter implements ListIterator {
   
   
  -    private ListIterator m_baseIter;
  -    private FObj m_curFO;
  -    protected ArrayList m_listLMs;
  -    protected int m_curPos = 0;
  -
  -    public LMiter(ListIterator baseIter) {
  -        m_baseIter = baseIter;
  -        m_listLMs = new ArrayList(10);
  +    private ListIterator baseIter;
  +    private FObj curFO;
  +    protected List listLMs;
  +    protected int curPos = 0;
  +
  +    public LMiter(ListIterator bIter) {
  +        baseIter = bIter;
  +        listLMs = new ArrayList(10);
       }
   
       public boolean hasNext() {
  -        return (m_curPos < m_listLMs.size()) ? true : preLoadNext();
  +        return (curPos < listLMs.size()) ? true : preLoadNext();
       }
   
       protected boolean preLoadNext() {
           // skip over child FObj's that don't add lms
  -        while (m_baseIter.hasNext()) {
  -            Object theobj = m_baseIter.next();
  +        while (baseIter.hasNext()) {
  +            Object theobj = baseIter.next();
               if(theobj instanceof FObj) {
                   FObj fobj = (FObj) theobj;
  -                //m_listLMs.add(fobj.getLayoutManager());
  -                fobj.addLayoutManager(m_listLMs);
  -                if(m_curPos < m_listLMs.size()) {
  +                //listLMs.add(fobj.getLayoutManager());
  +                fobj.addLayoutManager(listLMs);
  +                if(curPos < listLMs.size()) {
                       return true;
                   }
               }
  @@ -47,26 +48,26 @@
       }
   
       public boolean hasPrevious() {
  -        return (m_curPos > 0);
  +        return (curPos > 0);
       }
   
       public Object previous() throws NoSuchElementException {
  -        if (m_curPos > 0) {
  -            return m_listLMs.get(--m_curPos);
  +        if (curPos > 0) {
  +            return listLMs.get(--curPos);
           } else
               throw new NoSuchElementException();
       }
   
       public Object next() throws NoSuchElementException {
  -        if (m_curPos < m_listLMs.size()) {
  -            return m_listLMs.get(m_curPos++);
  +        if (curPos < listLMs.size()) {
  +            return listLMs.get(curPos++);
           } else
               throw new NoSuchElementException();
       }
   
       public void remove() throws NoSuchElementException {
  -        if (m_curPos > 0) {
  -            m_listLMs.remove(--m_curPos);
  +        if (curPos > 0) {
  +            listLMs.remove(--curPos);
               // Note: doesn't actually remove it from the base!
           } else
               throw new NoSuchElementException();
  @@ -83,11 +84,11 @@
       }
   
       public int nextIndex() {
  -        return m_curPos;
  +        return curPos;
       }
   
       public int previousIndex() {
  -        return m_curPos - 1;
  +        return curPos - 1;
       }
   
   }
  
  
  
  1.10      +36 -36    xml-fop/src/org/apache/fop/layoutmgr/LayoutContext.java
  
  Index: LayoutContext.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LayoutContext.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LayoutContext.java        22 Aug 2002 13:57:48 -0000      1.9
  +++ LayoutContext.java        13 Nov 2002 10:25:48 -0000      1.10
  @@ -48,7 +48,7 @@
        * These LM <b>may</b> wish to pass this information down to lower
        * level LM to allow them to optimize returned break possibilities.
        */
  -    MinOptMax m_stackLimit;
  +    MinOptMax stackLimit;
   
   
       /** True if current top-level reference area is spanning. */
  @@ -58,42 +58,42 @@
       int refIPD;
   
       /** Current pending space-after or space-end from preceding area */
  -    SpaceSpecifier m_trailingSpace;
  +    SpaceSpecifier trailingSpace;
   
       /** Current pending space-before or space-start from ancestor areas */
  -    SpaceSpecifier m_leadingSpace;
  +    SpaceSpecifier leadingSpace;
   
       /** Current hyphenation context. May be null. */
  -    private HyphContext m_hyphContext = null;
  +    private HyphContext hyphContext = null;
   
       /** Stretch or shrink value when making areas. */
       private double ipdAdjust = 0.0;
   
       /** Stretch or shrink value when adding spaces. */
  -    private double m_dSpaceAdjust = 0.0;
  +    private double dSpaceAdjust = 0.0;
   
  -    private int m_iLineHeight;
  -    private int m_iBaseline;
  +    private int iLineHeight;
  +    private int iBaseline;
   
       public LayoutContext(LayoutContext parentLC) {
           this.flags = parentLC.flags;
           this.refIPD = parentLC.refIPD;
  -        this.m_stackLimit = null; // Don't reference parent MinOptMax!
  -        this.m_leadingSpace = parentLC.m_leadingSpace; //???
  -        this.m_trailingSpace = parentLC.m_trailingSpace; //???
  -        this.m_hyphContext = parentLC.m_hyphContext;
  -        this.m_dSpaceAdjust = parentLC.m_dSpaceAdjust;
  -        this.m_iLineHeight = parentLC.m_iLineHeight;
  -        this.m_iBaseline = parentLC.m_iBaseline;
  +        this.stackLimit = null; // Don't reference parent MinOptMax!
  +        this.leadingSpace = parentLC.leadingSpace; //???
  +        this.trailingSpace = parentLC.trailingSpace; //???
  +        this.hyphContext = parentLC.hyphContext;
  +        this.dSpaceAdjust = parentLC.dSpaceAdjust;
  +        this.iLineHeight = parentLC.iLineHeight;
  +        this.iBaseline = parentLC.iBaseline;
           // Copy other fields as necessary. Use clone???
       }
   
       public LayoutContext(int flags) {
           this.flags = flags;
           this.refIPD = 0;
  -        m_stackLimit = new MinOptMax(0);
  -        m_leadingSpace = null;
  -        m_trailingSpace = null;
  +        stackLimit = new MinOptMax(0);
  +        leadingSpace = null;
  +        trailingSpace = null;
       }
   
       public void setFlags(int flags) {
  @@ -117,7 +117,7 @@
       }
   
       public boolean startsNewArea() {
  -        return ((this.flags & NEW_AREA) != 0 && m_leadingSpace != null);
  +        return ((this.flags & NEW_AREA) != 0 && leadingSpace != null);
       }
   
       public boolean isFirstArea() {
  @@ -133,11 +133,11 @@
       }
   
       public void setLeadingSpace(SpaceSpecifier space) {
  -        m_leadingSpace = space;
  +        leadingSpace = space;
       }
   
       public SpaceSpecifier getLeadingSpace() {
  -        return m_leadingSpace;
  +        return leadingSpace;
       }
   
       public boolean resolveLeadingSpace() {
  @@ -145,19 +145,19 @@
       }
   
       public void setTrailingSpace(SpaceSpecifier space) {
  -        m_trailingSpace = space;
  +        trailingSpace = space;
       }
   
       public SpaceSpecifier getTrailingSpace() {
  -        return m_trailingSpace;
  +        return trailingSpace;
       }
   
  -    public void setStackLimit(MinOptMax stackLimit) {
  -        m_stackLimit = stackLimit;
  +    public void setStackLimit(MinOptMax limit) {
  +        stackLimit = limit;
       }
   
       public MinOptMax getStackLimit() {
  -        return m_stackLimit;
  +        return stackLimit;
       }
   
       public void setRefIPD(int ipd) {
  @@ -168,24 +168,24 @@
           return refIPD;
       }
   
  -    public void setHyphContext(HyphContext hyphContext) {
  -        m_hyphContext = hyphContext;
  +    public void setHyphContext(HyphContext hyph) {
  +        hyphContext = hyph;
       }
   
       public HyphContext getHyphContext() {
  -        return m_hyphContext;
  +        return hyphContext;
       }
   
       public boolean tryHyphenate() {
           return ((this.flags & TRY_HYPHENATE) != 0);
       }
   
  -    public void setSpaceAdjust(double dSpaceAdjust) {
  -        m_dSpaceAdjust = dSpaceAdjust ;
  +    public void setSpaceAdjust(double adjust) {
  +        dSpaceAdjust = adjust;
       }
   
       public double getSpaceAdjust() {
  -        return m_dSpaceAdjust;
  +        return dSpaceAdjust;
       }
   
       public void setIPDAdjust(double ipdA) {
  @@ -197,19 +197,19 @@
       }
   
       public void setLineHeight(int lh) {
  -        m_iLineHeight = lh;
  +        iLineHeight = lh;
       }
   
       public int getLineHeight() {
  -        return m_iLineHeight;
  +        return iLineHeight;
       }
   
       public void setBaseline(int bl) {
  -        m_iBaseline = bl;
  +        iBaseline = bl;
       }
   
       public int getBaseline() {
  -        return m_iBaseline;
  +        return iBaseline;
       }
   }
   
  
  
  
  1.12      +2 -2      xml-fop/src/org/apache/fop/layoutmgr/LayoutManager.java
  
  Index: LayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LayoutManager.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- LayoutManager.java        13 Sep 2002 08:21:54 -0000      1.11
  +++ LayoutManager.java        13 Nov 2002 10:25:48 -0000      1.12
  @@ -18,7 +18,7 @@
   public interface LayoutManager {
       public boolean generatesInlineAreas();
       public Area getParentArea (Area childArea);
  -    public boolean addChild (Area childArea);
  +    public void addChild (Area childArea);
       public void setParentLM(LayoutManager lm);
   
       /**
  
  
  
  1.19      +2 -3      xml-fop/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java
  
  Index: LeafNodeLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- LeafNodeLayoutManager.java        18 Sep 2002 14:15:04 -0000      1.18
  +++ LeafNodeLayoutManager.java        13 Nov 2002 10:25:48 -0000      1.19
  @@ -96,8 +96,7 @@
        * @param childArea the childArea to add
        * @return not used
        */
  -    public boolean addChild(Area childArea) {
  -        return false;
  +    public void addChild(Area childArea) {
       }
   
       /**
  
  
  
  1.4       +5 -5      xml-fop/src/org/apache/fop/layoutmgr/LeafPosition.java
  
  Index: LeafPosition.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LeafPosition.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LeafPosition.java 3 Sep 2002 11:45:13 -0000       1.3
  +++ LeafPosition.java 13 Nov 2002 10:25:48 -0000      1.4
  @@ -9,15 +9,15 @@
   
   public class LeafPosition extends Position {
   
  -    private int m_iLeafPos;
  +    private int iLeafPos;
   
  -    public LeafPosition(LayoutManager lm, int iLeafPos) {
  +    public LeafPosition(LayoutManager lm, int pos) {
           super(lm);
  -        m_iLeafPos = iLeafPos;
  +        iLeafPos = pos;
       }
   
       public int getLeafPos() {
  -        return m_iLeafPos;
  +        return iLeafPos;
       }
   }
   
  
  
  
  1.17      +70 -70    xml-fop/src/org/apache/fop/layoutmgr/LineLayoutManager.java
  
  Index: LineLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LineLayoutManager.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- LineLayoutManager.java    28 Oct 2002 13:07:22 -0000      1.16
  +++ LineLayoutManager.java    13 Nov 2002 10:25:48 -0000      1.17
  @@ -52,19 +52,19 @@
        * inline break positions.
        */
       private static class LineBreakPosition extends LeafPosition {
  -        // int m_iPos;
  -        double m_dAdjust; // Percentage to adjust (stretch or shrink)
  +        // int iPos;
  +        double dAdjust; // Percentage to adjust (stretch or shrink)
           double ipdAdjust; // Percentage to adjust (stretch or shrink)
           int startIndent;
           int lineHeight;
           int baseline;
   
           LineBreakPosition(LayoutManager lm, int iBreakIndex,
  -                          double ipdA, double dAdjust, int ind, int lh, int bl) {
  +                          double ipdA, double adjust, int ind, int lh, int bl) {
               super(lm, iBreakIndex);
  -            // m_iPos = iBreakIndex;
  +            // iPos = iBreakIndex;
               ipdAdjust = ipdA;
  -            m_dAdjust = dAdjust;
  +            dAdjust = adjust;
               startIndent = ind;
               lineHeight = lh;
               baseline = bl;
  @@ -73,13 +73,13 @@
   
   
       /** Break positions returned by inline content. */
  -    private ArrayList m_vecInlineBreaks = new ArrayList();
  +    private List vecInlineBreaks = new ArrayList();
   
  -    private BreakPoss m_prevBP = null; // Last confirmed break position
  +    private BreakPoss prevBP = null; // Last confirmed break position
       private int bTextAlignment = TextAlign.JUSTIFY;
  -    private int m_iTextIndent = 0;
  -    private int m_iIndents = 0;
  -    private HyphenationProps m_hyphProps;
  +    private int iTextIndent = 0;
  +    private int iIndents = 0;
  +    private HyphenationProps hyphProps;
   
       private int lineHeight;
       private int lead;
  @@ -113,11 +113,11 @@
        */
       protected void initProperties(PropertyManager propMgr) {
           MarginProps marginProps = propMgr.getMarginProps();
  -        m_iIndents = marginProps.startIndent + marginProps.endIndent;
  +        iIndents = marginProps.startIndent + marginProps.endIndent;
           BlockProps blockProps = propMgr.getBlockProps();
           bTextAlignment = blockProps.textAlign;
  -        m_iTextIndent = blockProps.firstIndent;
  -        m_hyphProps = propMgr.getHyphenationProps();
  +        iTextIndent = blockProps.firstIndent;
  +        hyphProps = propMgr.getHyphenationProps();
       }
   
       /**
  @@ -132,7 +132,7 @@
           // Set up constraints for inline level managers
   
           LayoutManager curLM ; // currently active LM
  -        BreakPoss prevBP = null;
  +        BreakPoss prev = null;
           BreakPoss bp = null; // proposed BreakPoss
   
           ArrayList vecPossEnd = new ArrayList();
  @@ -146,22 +146,22 @@
           LayoutContext inlineLC = new LayoutContext(context);
   
           clearPrevIPD();
  -        int iPrevLineEnd = m_vecInlineBreaks.size();
  +        int iPrevLineEnd = vecInlineBreaks.size();
   
  -        m_prevBP = null;
  +        prevBP = null;
   
           while ((curLM = getChildLM()) != null) {
               // INITIALIZE LAYOUT CONTEXT FOR CALL TO CHILD LM
               // First break for the child LM in each of its areas
  -            boolean bFirstBPforLM = (m_vecInlineBreaks.isEmpty() ||
  -                                     (((BreakPoss) 
m_vecInlineBreaks.get(m_vecInlineBreaks.size() - 1)).
  +            boolean bFirstBPforLM = (vecInlineBreaks.isEmpty() ||
  +                                     (((BreakPoss) 
vecInlineBreaks.get(vecInlineBreaks.size() - 1)).
                                         getLayoutManager() != curLM));
   
               // Need previous breakpoint! ATTENTION when backing up for hyphenation!
  -            prevBP = (m_vecInlineBreaks.isEmpty()) ? null :
  -                     (BreakPoss) m_vecInlineBreaks.get(m_vecInlineBreaks.size() - 
1);
  -            initChildLC(inlineLC, prevBP,
  -                        (m_vecInlineBreaks.size() == iPrevLineEnd),
  +            prev = (vecInlineBreaks.isEmpty()) ? null :
  +                     (BreakPoss) vecInlineBreaks.get(vecInlineBreaks.size() - 1);
  +            initChildLC(inlineLC, prev,
  +                        (vecInlineBreaks.size() == iPrevLineEnd),
                           bFirstBPforLM, new SpaceSpecifier(true));
   
   
  @@ -170,17 +170,17 @@
                * then set the SUPPRESS_LEADING_SPACE flag.
                */
               inlineLC.setFlags(LayoutContext.SUPPRESS_LEADING_SPACE,
  -                              (m_vecInlineBreaks.size() == iPrevLineEnd &&
  -                               !m_vecInlineBreaks.isEmpty() &&
  -                               ((BreakPoss) 
m_vecInlineBreaks.get(m_vecInlineBreaks.size() - 1)).
  +                              (vecInlineBreaks.size() == iPrevLineEnd &&
  +                               !vecInlineBreaks.isEmpty() &&
  +                               ((BreakPoss) 
vecInlineBreaks.get(vecInlineBreaks.size() - 1)).
                                  isForcedBreak() == false));
   
               // GET NEXT POSSIBLE BREAK FROM CHILD LM
               // prevBP = bp;
               if ((bp = curLM.getNextBreakPoss(inlineLC)) != null) {
                   // Add any space before and previous content dimension
  -                MinOptMax prevIPD = updatePrevIPD(bp, prevBP,
  -                                                  (m_vecInlineBreaks.size() == 
iPrevLineEnd),
  +                MinOptMax prevIPD = updatePrevIPD(bp, prev,
  +                                                  (vecInlineBreaks.size() == 
iPrevLineEnd),
                                                     inlineLC.isFirstArea());
                   MinOptMax bpDim =
                     MinOptMax.add(bp.getStackingSize(), prevIPD);
  @@ -206,7 +206,7 @@
   
                       // This break position doesn't fit
                       // TODO: If we are in nowrap, we use it as is!
  -                    if (bTextAlignment == TextAlign.JUSTIFY || m_prevBP == null) {
  +                    if (bTextAlignment == TextAlign.JUSTIFY || prevBP == null) {
                           // If we are already in a hyphenation loop, then stop.
   
                           if (inlineLC.tryHyphenate()) {
  @@ -215,12 +215,12 @@
                           // Otherwise, prepare to try hyphenation
                           if (!bBreakOK) {
                               // Make sure we collect the entire word!
  -                            m_vecInlineBreaks.add(bp);
  +                            vecInlineBreaks.add(bp);
                               continue;
                           }
   
                           inlineLC.setHyphContext(
  -                          getHyphenContext(m_prevBP, bp));
  +                          getHyphenContext(prevBP, bp));
                           if (inlineLC.getHyphContext() == null)
                               break;
                           inlineLC.setFlags(LayoutContext.TRY_HYPHENATE,
  @@ -236,10 +236,10 @@
                       }
                   } else {
                       // Add the BP to the list whether or not we can break
  -                    m_vecInlineBreaks.add(bp);
  +                    vecInlineBreaks.add(bp);
                       // Handle end of this LM's areas
                       if (bBreakOK) {
  -                        m_prevBP = bp; // Save reference to this BP
  +                        prevBP = bp; // Save reference to this BP
                           if (bp.isForcedBreak()) {
                               break;
                           }
  @@ -279,22 +279,22 @@
   
           if (bp == null)
               return null;
  -        if (m_prevBP == null)
  -            m_prevBP = bp;
  +        if (prevBP == null)
  +            prevBP = bp;
   
           // Choose the best break
           if (!bp.isForcedBreak() && vecPossEnd.size() > 0) {
  -            m_prevBP = getBestBP(vecPossEnd);
  +            prevBP = getBestBP(vecPossEnd);
           }
           // Backup child LM if necessary
  -        if (bp != m_prevBP && !bp.couldEndLine()) {
  +        if (bp != prevBP && !bp.couldEndLine()) {
               reset();
           }
   
           // Don't justify last line in the sequence or if forced line-end
           int talign = bTextAlignment;
           if ((bTextAlignment == TextAlign.JUSTIFY
  -                             && (m_prevBP.isForcedBreak()
  +                             && (prevBP.isForcedBreak()
                                || isFinished()))) {
               talign = TextAlign.START;
           }
  @@ -303,10 +303,10 @@
   
   
       private void reset() {
  -        while (m_vecInlineBreaks.get(m_vecInlineBreaks.size() - 1) != m_prevBP) {
  -            m_vecInlineBreaks.remove(m_vecInlineBreaks.size() - 1);
  +        while (vecInlineBreaks.get(vecInlineBreaks.size() - 1) != prevBP) {
  +            vecInlineBreaks.remove(vecInlineBreaks.size() - 1);
           }
  -        reset(m_prevBP.getPosition());
  +        reset(prevBP.getPosition());
       }
   
       protected boolean couldEndLine(BreakPoss bp) {
  @@ -354,34 +354,34 @@
           return true;
       }
   
  -    private HyphContext getHyphenContext(BreakPoss prevBP,
  +    private HyphContext getHyphenContext(BreakPoss prev,
                                            BreakPoss newBP) {
           // Get a "word" to hyphenate by getting characters from all
  -        // pending break poss which are in m_vecInlineBreaks, starting
  -        // with the position just AFTER prevBP.getPosition()
  +        // pending break poss which are in vecInlineBreaks, starting
  +        // with the position just AFTER prev.getPosition()
   
  -        m_vecInlineBreaks.add(newBP);
  +        vecInlineBreaks.add(newBP);
           ListIterator bpIter =
  -          m_vecInlineBreaks. listIterator(m_vecInlineBreaks.size());
  -        while (bpIter.hasPrevious() && bpIter.previous() != prevBP)
  -            ;
  -        if (bpIter.next() != prevBP) {
  +          vecInlineBreaks. listIterator(vecInlineBreaks.size());
  +        while (bpIter.hasPrevious() && bpIter.previous() != prev) {
  +        }
  +        if (bpIter.next() != prev) {
               //log.error("findHyphenPoss: problem!");
               return null;
           }
           StringBuffer sbChars = new StringBuffer(30);
           while (bpIter.hasNext()) {
               BreakPoss bp = (BreakPoss) bpIter.next();
  -            if (bp.getLayoutManager() == prevBP.getLayoutManager()) {
  +            if (bp.getLayoutManager() == prev.getLayoutManager()) {
                   bp.getLayoutManager().getWordChars(sbChars,
  -                                                   prevBP.getPosition(), 
bp.getPosition());
  +                                                   prev.getPosition(), 
bp.getPosition());
               } else {
                   bp.getLayoutManager().getWordChars(sbChars, null,
                                                      bp.getPosition());
               }
  -            prevBP = bp;
  +            prev = bp;
           }
  -        m_vecInlineBreaks.remove(m_vecInlineBreaks.size() - 1); // remove last
  +        vecInlineBreaks.remove(vecInlineBreaks.size() - 1); // remove last
           //log.debug("Word to hyphenate: " + sbChars.toString());
   
           // Now find all hyphenation points in this word (get in an array of offsets)
  @@ -393,12 +393,12 @@
           // TextLM which generate the hyphenation buffer, since these properties
           // inherit and could be specified on an inline or wrapper below the block
           // level.
  -        Hyphenation hyph = Hyphenator.hyphenate(m_hyphProps.language,
  -                                                m_hyphProps.country, 
sbChars.toString(),
  -                                                
m_hyphProps.hyphenationRemainCharacterCount,
  -                                                
m_hyphProps.hyphenationPushCharacterCount);
  +        Hyphenation hyph = Hyphenator.hyphenate(hyphProps.language,
  +                                                hyphProps.country, 
sbChars.toString(),
  +                                                
hyphProps.hyphenationRemainCharacterCount,
  +                                                
hyphProps.hyphenationPushCharacterCount);
           // They hyph structure contains the information we need
  -        // Now start from prevBP: reset to that position, ask that LM to get
  +        // Now start from prev: reset to that position, ask that LM to get
           // a Position for the first hyphenation offset. If the offset isn't in
           // its characters, it returns null, but must tell how many chars it had.
           // Keep looking at currentBP using next hyphenation point until the
  @@ -442,7 +442,7 @@
           MinOptMax actual = new MinOptMax();
           BreakPoss lastBP = null;
           LayoutManager lastLM = null;
  -        for(Iterator iter = m_vecInlineBreaks.listIterator(prevLineEnd);
  +        for(Iterator iter = vecInlineBreaks.listIterator(prevLineEnd);
                   iter.hasNext(); ) {
               BreakPoss bp = (BreakPoss)iter.next();
               if (bp.getLead() > lineLead) {
  @@ -530,7 +530,7 @@
   
           LineBreakPosition lbp;
           lbp = new LineBreakPosition(this,
  -                                    m_vecInlineBreaks.size() - 1,
  +                                    vecInlineBreaks.size() - 1,
                                       ipdAdjust, dAdjust, indent,
                                       lineLead + middlefollow, lineLead);
           BreakPoss curLineBP = new BreakPoss(lbp);
  @@ -549,15 +549,15 @@
           if (resetPos == null) {
               iStartPos = 0;
               reset(null);
  -            m_vecInlineBreaks.clear();
  -            m_prevBP = null;
  +            vecInlineBreaks.clear();
  +            prevBP = null;
           } else {
  -            m_prevBP = 
(BreakPoss)m_vecInlineBreaks.get(((LineBreakPosition)resetPos).getLeafPos());
  -            while (m_vecInlineBreaks.get(m_vecInlineBreaks.size() - 1) != m_prevBP)
  +            prevBP = 
(BreakPoss)vecInlineBreaks.get(((LineBreakPosition)resetPos).getLeafPos());
  +            while (vecInlineBreaks.get(vecInlineBreaks.size() - 1) != prevBP)
   {
  -                m_vecInlineBreaks.remove(m_vecInlineBreaks.size() - 1);
  +                vecInlineBreaks.remove(vecInlineBreaks.size() - 1);
               }
  -            reset(m_prevBP.getPosition());
  +            reset(prevBP.getPosition());
           }
       }
   
  @@ -571,8 +571,8 @@
                            LayoutContext context) {
           addAreas(parentIter, 0.0);
   
  -        //m_vecInlineBreaks.clear();
  -        m_prevBP = null;
  +        //vecInlineBreaks.clear();
  +        prevBP = null;
       }
   
       // Generate and add areas to parent area
  @@ -598,10 +598,10 @@
               setCurrentArea(lineArea);
               // Add the inline areas to lineArea
               PositionIterator inlinePosIter =
  -              new BreakPossPosIter(m_vecInlineBreaks, iStartPos,
  +              new BreakPossPosIter(vecInlineBreaks, iStartPos,
                                      lbp.getLeafPos() + 1);
               iStartPos = lbp.getLeafPos() + 1;
  -            lc.setSpaceAdjust(lbp.m_dAdjust);
  +            lc.setSpaceAdjust(lbp.dAdjust);
               lc.setIPDAdjust(lbp.ipdAdjust);
               lc.setLeadingSpace(new SpaceSpecifier(true));
               lc.setFlags(LayoutContext.RESOLVE_LEADING_SPACE, true);
  
  
  
  1.4       +5 -5      xml-fop/src/org/apache/fop/layoutmgr/NonLeafPosition.java
  
  Index: NonLeafPosition.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/NonLeafPosition.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NonLeafPosition.java      3 Sep 2002 11:45:13 -0000       1.3
  +++ NonLeafPosition.java      13 Nov 2002 10:25:48 -0000      1.4
  @@ -9,15 +9,15 @@
   
   public class NonLeafPosition extends Position {
   
  -    private Position m_subPos ;
  +    private Position subPos;
   
  -    public NonLeafPosition(LayoutManager lm, Position subPos) {
  +    public NonLeafPosition(LayoutManager lm, Position sub) {
           super(lm);
  -        m_subPos = subPos;
  +        subPos = sub;
       }
   
       public Position getPosition() {
  -        return m_subPos;
  +        return subPos;
       }
   }
   
  
  
  
  1.24      +5 -7      xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java
  
  Index: PageLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- PageLayoutManager.java    6 Nov 2002 10:02:28 -0000       1.23
  +++ PageLayoutManager.java    13 Nov 2002 10:25:48 -0000      1.24
  @@ -293,16 +293,15 @@
        *
        * @param childArea the child area to add
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (childArea == null) {
  -            return false;
  +            return;
           }
           if (childArea.getAreaClass() == Area.CLASS_NORMAL) {
               placeFlowRefArea(childArea);
           } else {
               ; // todo: all the others!
           }
  -        return false;
       }
   
       /**
  @@ -399,7 +398,7 @@
                   while (!lm.isFinished()) {
                       BreakPoss bp = lm.getNextBreakPoss(childLC);
                       if (bp != null) {
  -                        ArrayList vecBreakPoss = new ArrayList();
  +                        List vecBreakPoss = new ArrayList();
                           vecBreakPoss.add(bp);
                           lm.addAreas(new BreakPossPosIter(vecBreakPoss, 0,
                                                             vecBreakPoss.size()), 
null);
  @@ -614,9 +613,8 @@
       }
   
       // See finishPage...
  -    protected boolean flush() {
  +    protected void flush() {
           finishPage();
  -        return false;
       }
   
   }
  
  
  
  1.4       +4 -4      xml-fop/src/org/apache/fop/layoutmgr/Position.java
  
  Index: Position.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/Position.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Position.java     3 Sep 2002 11:45:13 -0000       1.3
  +++ Position.java     13 Nov 2002 10:25:48 -0000      1.4
  @@ -8,14 +8,14 @@
   package org.apache.fop.layoutmgr;
   
   public class Position {
  -    private LayoutManager m_lm;
  +    private LayoutManager layoutManager;
   
       public Position(LayoutManager lm) {
  -        m_lm = lm;
  +        layoutManager = lm;
       }
   
       public LayoutManager getLM() {
  -        return m_lm;
  +        return layoutManager;
       }
   
       /**
  
  
  
  1.9       +27 -27    xml-fop/src/org/apache/fop/layoutmgr/PositionIterator.java
  
  Index: PositionIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/PositionIterator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PositionIterator.java     25 Oct 2002 09:29:45 -0000      1.8
  +++ PositionIterator.java     13 Nov 2002 10:25:48 -0000      1.9
  @@ -12,24 +12,24 @@
   import java.util.NoSuchElementException;
   
   public abstract class PositionIterator implements Iterator {
  -    Iterator m_parentIter;
  -    Object m_nextObj;
  -    LayoutManager m_childLM;
  -    boolean m_bHasNext;
  +    Iterator parentIter;
  +    Object nextObj;
  +    LayoutManager childLM;
  +    boolean bHasNext;
   
  -    PositionIterator(Iterator parentIter) {
  -        m_parentIter = parentIter;
  +    PositionIterator(Iterator pIter) {
  +        parentIter = pIter;
           lookAhead();
           //checkNext();
       }
   
       public LayoutManager getNextChildLM() {
           // Move to next "segment" of iterator, ie: new childLM
  -        if (m_childLM == null && m_nextObj != null) {
  -            m_childLM = getLM(m_nextObj);
  -            m_bHasNext = true;
  +        if (childLM == null && nextObj != null) {
  +            childLM = getLM(nextObj);
  +            bHasNext = true;
           }
  -        return m_childLM;
  +        return childLM;
       }
   
       protected abstract LayoutManager getLM(Object nextObj);
  @@ -37,41 +37,41 @@
       protected abstract Position getPos(Object nextObj);
   
       private void lookAhead() {
  -        if (m_parentIter.hasNext()) {
  -            m_bHasNext = true;
  -            m_nextObj = m_parentIter.next();
  +        if (parentIter.hasNext()) {
  +            bHasNext = true;
  +            nextObj = parentIter.next();
           } else {
               endIter();
           }
       }
   
       protected boolean checkNext() {
  -        LayoutManager lm = getLM(m_nextObj);
  -        if (m_childLM == null) {
  -            m_childLM = lm;
  -        } else if (m_childLM != lm) {
  +        LayoutManager lm = getLM(nextObj);
  +        if (childLM == null) {
  +            childLM = lm;
  +        } else if (childLM != lm) {
               // End of this sub-sequence with same child LM
  -            m_bHasNext = false;
  -            m_childLM = null;
  +            bHasNext = false;
  +            childLM = null;
               return false;
           }
           return true;
       }
   
       protected void endIter() {
  -        m_bHasNext = false;
  -        m_nextObj = null;
  -        m_childLM = null;
  +        bHasNext = false;
  +        nextObj = null;
  +        childLM = null;
       }
   
       public boolean hasNext() {
  -        return (m_bHasNext && checkNext());
  +        return (bHasNext && checkNext());
       }
   
   
       public Object next() throws NoSuchElementException {
  -        if (m_bHasNext) {
  -            Object retObj = getPos(m_nextObj);
  +        if (bHasNext) {
  +            Object retObj = getPos(nextObj);
               lookAhead();
               return retObj;
           } else {
  @@ -80,7 +80,7 @@
       }
   
       protected Object peekNext() {
  -        return m_nextObj;
  +        return nextObj;
       }
   
       public void remove() throws UnsupportedOperationException {
  
  
  
  1.8       +24 -23    xml-fop/src/org/apache/fop/layoutmgr/SpaceSpecifier.java
  
  Index: SpaceSpecifier.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/SpaceSpecifier.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SpaceSpecifier.java       9 Aug 2002 07:11:16 -0000       1.7
  +++ SpaceSpecifier.java       13 Nov 2002 10:25:48 -0000      1.8
  @@ -10,6 +10,7 @@
   import org.apache.fop.area.MinOptMax;
   import org.apache.fop.traits.SpaceVal;
   import java.util.ArrayList;
  +import java.util.List;
   
   /**
    * Accumulate a sequence of space-specifiers (XSL space type) on
  @@ -19,21 +20,21 @@
   public class SpaceSpecifier implements Cloneable {
   
   
  -    private boolean m_bStartsRefArea;
  -    private boolean m_bHasForcing = false;
  -    private ArrayList m_vecSpaceVals = new ArrayList();
  +    private boolean bStartsRefArea;
  +    private boolean bHasForcing = false;
  +    private List vecSpaceVals = new ArrayList();
   
   
  -    public SpaceSpecifier(boolean bStartsRefArea) {
  -        m_bStartsRefArea = bStartsRefArea;
  +    public SpaceSpecifier(boolean bStarts) {
  +        bStartsRefArea = bStarts;
       }
   
       public Object clone() {
           try {
               SpaceSpecifier ss = (SpaceSpecifier) super.clone();
               // Clone the vector, but share the objects in it!
  -            ss.m_vecSpaceVals = new ArrayList();
  -            ss.m_vecSpaceVals.addAll(this.m_vecSpaceVals);
  +            ss.vecSpaceVals = new ArrayList();
  +            ss.vecSpaceVals.addAll(this.vecSpaceVals);
               return ss;
           } catch (CloneNotSupportedException cnse) {
               return null;
  @@ -45,14 +46,14 @@
        * Clear all space specifiers
        */
       public void clear() {
  -        m_bHasForcing = false;
  -        m_vecSpaceVals.clear();
  +        bHasForcing = false;
  +        vecSpaceVals.clear();
       }
   
   
       /** Return true if any space-specifiers have been added. */
       public boolean hasSpaces() {
  -        return (m_vecSpaceVals.size() > 0);
  +        return (vecSpaceVals.size() > 0);
       }
   
       /**
  @@ -62,20 +63,20 @@
        * add it to the sequence.
        */
       public void addSpace(SpaceVal moreSpace) {
  -        if (!m_bStartsRefArea || !moreSpace.bConditional ||
  -                !m_vecSpaceVals.isEmpty()) {
  +        if (!bStartsRefArea || !moreSpace.bConditional ||
  +                !vecSpaceVals.isEmpty()) {
               if (moreSpace.bForcing) {
  -                if (m_bHasForcing == false) {
  +                if (bHasForcing == false) {
                       // Remove all other values (must all be non-forcing)
  -                    m_vecSpaceVals.clear();
  -                    m_bHasForcing = true;
  +                    vecSpaceVals.clear();
  +                    bHasForcing = true;
                   }
  -                m_vecSpaceVals.add(moreSpace);
  -            } else if (m_bHasForcing == false) {
  +                vecSpaceVals.add(moreSpace);
  +            } else if (bHasForcing == false) {
                   // Don't bother adding all 0 space-specifier if not forcing
                   if (moreSpace.space.min != 0 || moreSpace.space.opt != 0 ||
                           moreSpace.space.max != 0) {
  -                    m_vecSpaceVals.add(moreSpace);
  +                    vecSpaceVals.add(moreSpace);
                   }
               }
           }
  @@ -90,12 +91,12 @@
        * @return The resolved value as a min/opt/max triple.
        */
       public MinOptMax resolve(boolean bEndsReferenceArea) {
  -        int lastIndex = m_vecSpaceVals.size();
  +        int lastIndex = vecSpaceVals.size();
           if (bEndsReferenceArea) {
               // Start from the end and count conditional specifiers
               // Stop at first non-conditional
               for (; lastIndex > 0; --lastIndex) {
  -                SpaceVal sval = (SpaceVal) m_vecSpaceVals.get(
  +                SpaceVal sval = (SpaceVal) vecSpaceVals.get(
                                     lastIndex - 1);
                   if (!sval.bConditional) {
                       break;
  @@ -105,8 +106,8 @@
           MinOptMax resSpace = new MinOptMax(0);
           int iMaxPrec = -1;
           for (int index = 0; index < lastIndex; index++) {
  -            SpaceVal sval = (SpaceVal) m_vecSpaceVals.get(index);
  -            if (m_bHasForcing) {
  +            SpaceVal sval = (SpaceVal) vecSpaceVals.get(index);
  +            if (bHasForcing) {
                   resSpace.add(sval.space);
               } else if (sval.iPrecedence > iMaxPrec) {
                   iMaxPrec = sval.iPrecedence;
  
  
  
  1.5       +4 -4      
xml-fop/src/org/apache/fop/layoutmgr/StaticContentLayoutManager.java
  
  Index: StaticContentLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/StaticContentLayoutManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StaticContentLayoutManager.java   13 Sep 2002 08:21:54 -0000      1.4
  +++ StaticContentLayoutManager.java   13 Nov 2002 10:25:48 -0000      1.5
  @@ -13,6 +13,7 @@
   import org.apache.fop.area.Block;
   
   import java.util.ArrayList;
  +import java.util.List;
   
   /**
    * LayoutManager for an fo:flow object.
  @@ -23,7 +24,7 @@
   public class StaticContentLayoutManager extends BlockStackingLayoutManager {
   
       private RegionReference region;
  -    private ArrayList blockBreaks = new ArrayList();      
  +    private List blockBreaks = new ArrayList();      
     
       public StaticContentLayoutManager(FObj fobj) {
           super(fobj);
  @@ -88,9 +89,8 @@
        * area class. A Flow can fill at most one area container of any class
        * at any one time. The actual work is done by BlockStackingLM.
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           region.addBlock((Block)childArea);
  -        return true;
       }
   
       public Area getParentArea(Area childArea) {
  
  
  
  1.16      +84 -83    xml-fop/src/org/apache/fop/layoutmgr/TextLayoutManager.java
  
  Index: TextLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/TextLayoutManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TextLayoutManager.java    5 Nov 2002 09:05:41 -0000       1.15
  +++ TextLayoutManager.java    13 Nov 2002 10:25:48 -0000      1.16
  @@ -23,6 +23,7 @@
   //import org.apache.fop.fo.properties.*;
   
   import java.util.ArrayList;
  +import java.util.List;
   
   /**
    * LayoutManager for text (a sequence of characters) which generates one
  @@ -37,22 +38,22 @@
        * Number of word-spaces?
        */
       private class AreaInfo {
  -        short m_iStartIndex;
  -        short m_iBreakIndex;
  -        short m_iWScount;
  -        MinOptMax m_ipdArea;
  -        AreaInfo(short iStartIndex, short iBreakIndex, short iWScount,
  -                 MinOptMax ipdArea) {
  -            m_iStartIndex = iStartIndex;
  -            m_iBreakIndex = iBreakIndex;
  -            m_iWScount = iWScount;
  -            m_ipdArea = ipdArea;
  +        short iStartIndex;
  +        short iBreakIndex;
  +        short iWScount;
  +        MinOptMax ipdArea;
  +        AreaInfo(short iSIndex, short iBIndex, short iWS,
  +                 MinOptMax ipd) {
  +            iStartIndex = iSIndex;
  +            iBreakIndex = iBIndex;
  +            iWScount = iWS;
  +            ipdArea = ipd;
           }
       }
   
   
       // Hold all possible breaks for the text in this LM's FO.
  -    private ArrayList m_vecAreaInfo;
  +    private ArrayList vecAreaInfo;
   
       /** Non-space characters on which we can end a line. */
       private static final String s_breakChars = "-/" ;
  @@ -69,21 +70,21 @@
       private static final char ZERO_WIDTH_NOBREAK_SPACE = '\uFEFF';
   
       /** Start index of first character in this parent Area */
  -    private short m_iAreaStart = 0;
  +    private short iAreaStart = 0;
       /** Start index of next "word" */
  -    private short m_iNextStart = 0;
  +    private short iNextStart = 0;
       /** Size since last makeArea call, except for last break */
  -    private MinOptMax m_ipdTotal ;
  +    private MinOptMax ipdTotal;
       /** Size including last break possibility returned */
  -    // private MinOptMax m_nextIPD= new MinOptMax(0);
  +    // private MinOptMax nextIPD = new MinOptMax(0);
       /** size of a space character (U+0020) glyph in current font */
  -    private int m_spaceIPD;
  +    private int spaceCharIPD;
       /** size of the hyphen character glyph in current font */
  -    private int m_hyphIPD;
  +    private int hyphIPD;
       /** 1/2 of word-spacing value */
  -    private SpaceVal m_halfWS;
  +    private SpaceVal halfWS;
       /** Number of space characters after previous possible break position. */
  -    private int m_iNbSpacesPending;
  +    private int iNbSpacesPending;
   
       /**
        * Create a Text layout manager.
  @@ -96,15 +97,15 @@
           super(fobj);
           this.chars = chars;
           this.textInfo = textInfo;
  -        this.m_vecAreaInfo = new ArrayList();
  +        this.vecAreaInfo = new ArrayList();
   
           // With CID fonts, space isn't neccesary currentFontState.width(32)
  -        m_spaceIPD = CharUtilities.getCharWidth(' ', textInfo.fs);
  +        spaceCharIPD = CharUtilities.getCharWidth(' ', textInfo.fs);
           // Use hyphenationChar property
  -        m_hyphIPD = CharUtilities.getCharWidth('-', textInfo.fs);
  +        hyphIPD = CharUtilities.getCharWidth('-', textInfo.fs);
           // Make half-space: <space> on either side of a word-space)
           SpaceVal ws = textInfo.wordSpacing;
  -        m_halfWS = new SpaceVal(MinOptMax.multiply(ws.space, 0.5),
  +        halfWS = new SpaceVal(MinOptMax.multiply(ws.space, 0.5),
                                   ws.bConditional, ws.bForcing, ws.iPrecedence);
       }
   
  @@ -129,13 +130,13 @@
                                Position bp2) {
           LeafPosition endPos = (LeafPosition) bp2;
           AreaInfo ai =
  -          (AreaInfo) m_vecAreaInfo.get(endPos.getLeafPos());
  +          (AreaInfo) vecAreaInfo.get(endPos.getLeafPos());
           // Skip all leading spaces for hyphenation
           int i;
  -        for (i = ai.m_iStartIndex; i < ai.m_iBreakIndex &&
  +        for (i = ai.iStartIndex; i < ai.iBreakIndex &&
                   CharUtilities.isAnySpace(chars[i]) == true ; i++)
               ;
  -        sbChars.append(new String(chars, i, ai.m_iBreakIndex - i));
  +        sbChars.append(new String(chars, i, ai.iBreakIndex - i));
       }
   
       /**
  @@ -148,7 +149,7 @@
        * @return true if can break before this text
        */
       public boolean canBreakBefore(LayoutContext context) {
  -        char c = chars[m_iNextStart];
  +        char c = chars[iNextStart];
           return ((c == NEWLINE) || (textInfo.bWrap &&
                                      (CharUtilities.isSpace(c) ||
                                       s_breakChars.indexOf(c) >= 0)));
  @@ -168,19 +169,19 @@
               }
               LeafPosition tbp = (LeafPosition) prevPos;
               AreaInfo ai =
  -              (AreaInfo) m_vecAreaInfo.get(tbp.getLeafPos());
  -            if (ai.m_iBreakIndex != m_iNextStart) {
  -                m_iNextStart = ai.m_iBreakIndex;
  -                m_vecAreaInfo.ensureCapacity(tbp.getLeafPos() + 1);
  +              (AreaInfo) vecAreaInfo.get(tbp.getLeafPos());
  +            if (ai.iBreakIndex != iNextStart) {
  +                iNextStart = ai.iBreakIndex;
  +                vecAreaInfo.ensureCapacity(tbp.getLeafPos() + 1);
                   // TODO: reset or recalculate total IPD = sum of all word IPD
                   // up to the break position
  -                m_ipdTotal = ai.m_ipdArea;
  +                ipdTotal = ai.ipdArea;
                   setFinished(false);
               }
           } else {
               // Reset to beginning!
  -            m_vecAreaInfo.clear();
  -            m_iNextStart = 0;
  +            vecAreaInfo.clear();
  +            iNextStart = 0;
               setFinished(false);
           }
       }
  @@ -190,16 +191,16 @@
       private boolean getHyphenIPD(HyphContext hc, MinOptMax hyphIPD) {
           // Skip leading word-space before calculating count?
           boolean bCanHyphenate = true;
  -        int iStopIndex = m_iNextStart + hc.getNextHyphPoint();
  +        int iStopIndex = iNextStart + hc.getNextHyphPoint();
   
           if (chars.length < iStopIndex || textInfo.bCanHyphenate == false) {
               iStopIndex = chars.length;
               bCanHyphenate = false;
           }
  -        hc.updateOffset(iStopIndex - m_iNextStart);
  +        hc.updateOffset(iStopIndex - iNextStart);
   
  -        for (; m_iNextStart < iStopIndex; m_iNextStart++) {
  -            char c = chars[m_iNextStart];
  +        for (; iNextStart < iStopIndex; iNextStart++) {
  +            char c = chars[iNextStart];
               hyphIPD.opt += CharUtilities.getCharWidth(c, textInfo.fs);
               // letter-space?
           }
  @@ -235,7 +236,7 @@
               /* This could be first call on this LM, or the first call
                * in a new (possible) LineArea.
                */
  -            m_ipdTotal = new MinOptMax(0);
  +            ipdTotal = new MinOptMax(0);
               iFlags |= BreakPoss.ISFIRST;
           }
   
  @@ -248,11 +249,11 @@
            * retained.
            */
           if (context.suppressLeadingSpace()) {
  -            for (; m_iNextStart < chars.length &&
  -                    chars[m_iNextStart] == SPACE; m_iNextStart++)
  -                ;
  +            for (; iNextStart < chars.length
  +                    && chars[iNextStart] == SPACE; iNextStart++) {
  +            }
               // If now at end, nothing to compose here!
  -            if (m_iNextStart >= chars.length) {
  +            if (iNextStart >= chars.length) {
                   setFinished(true);
                   return null; // Or an "empty" BreakPoss?
               }
  @@ -266,37 +267,37 @@
            */
   
           SpaceSpecifier pendingSpace = new SpaceSpecifier(false);
  -        short iThisStart = m_iNextStart; // Index of first character counted
  +        short iThisStart = iNextStart; // Index of first character counted
           MinOptMax spaceIPD = new MinOptMax(0); // Extra IPD from word-spacing
           // Sum of glyph IPD of all characters in a word, inc. leading space
           int wordIPD = 0;
           short iWScount = 0; // Count of word spaces
           boolean bSawNonSuppressible = false;
   
  -        for (; m_iNextStart < chars.length; m_iNextStart++) {
  -            char c = chars[m_iNextStart];
  +        for (; iNextStart < chars.length; iNextStart++) {
  +            char c = chars[iNextStart];
               if (CharUtilities.isAnySpace(c) == false)
                   break;
               if (c == SPACE || c == NBSPACE) {
                   ++iWScount;
                   // Counted as word-space
  -                if (m_iNextStart == iThisStart &&
  +                if (iNextStart == iThisStart &&
                           (iFlags & BreakPoss.ISFIRST) != 0) {
                       // If possible, treat as normal inter-word space
                       if (context.getLeadingSpace().hasSpaces()) {
  -                        context.getLeadingSpace().addSpace(m_halfWS);
  +                        context.getLeadingSpace().addSpace(halfWS);
                       } else {
                           // Doesn't combine with any other leading spaces
                           // from ancestors
  -                        spaceIPD.add(m_halfWS.space);
  +                        spaceIPD.add(halfWS.space);
                       }
                   } else {
  -                    pendingSpace.addSpace(m_halfWS);
  +                    pendingSpace.addSpace(halfWS);
                       spaceIPD.add(pendingSpace.resolve(false));
                   }
  -                wordIPD += m_spaceIPD; // Space glyph IPD
  +                wordIPD += spaceCharIPD; // Space glyph IPD
                   pendingSpace.clear();
  -                pendingSpace.addSpace(m_halfWS);
  +                pendingSpace.addSpace(halfWS);
                   if (c == NBSPACE) {
                       bSawNonSuppressible = true;
                   }
  @@ -310,7 +311,7 @@
               }
           }
   
  -        if (m_iNextStart < chars.length) {
  +        if (iNextStart < chars.length) {
               spaceIPD.add(pendingSpace.resolve(false));
           } else {
               // This FO ended with spaces. Return the BP
  @@ -334,15 +335,15 @@
               // Look for a legal line-break: breakable white-space and certain
               // characters such as '-' which can serve as word breaks.
               // Don't look for hyphenation points here though
  -            for (; m_iNextStart < chars.length; m_iNextStart++) {
  -                char c = chars[m_iNextStart];
  +            for (; iNextStart < chars.length; iNextStart++) {
  +                char c = chars[iNextStart];
                   if ((c == NEWLINE) || // Include any breakable white-space as break 
char
                           //  even if fixed width
                           (textInfo.bWrap && (CharUtilities.isSpace(c) ||
                                               s_breakChars.indexOf(c) >= 0))) {
                       iFlags |= BreakPoss.CAN_BREAK_AFTER;
                       if (c != SPACE) {
  -                        m_iNextStart++;
  +                        iNextStart++;
                           if (c != NEWLINE) {
                               wordIPD += CharUtilities.getCharWidth(c,
                                                                     textInfo.fs);
  @@ -353,7 +354,7 @@
                       // If all remaining characters would be suppressed at
                       // line-end, set a flag for parent LM.
                       int iLastChar;
  -                    for (iLastChar = m_iNextStart;
  +                    for (iLastChar = iNextStart;
                               iLastChar < chars.length &&
                               chars[iLastChar] == SPACE; iLastChar++)
                           ;
  @@ -379,21 +380,21 @@
                                       int flags, short iWScount) {
           MinOptMax ipd = new MinOptMax(wordDim);
           ipd.add(spaceIPD);
  -        if (m_ipdTotal != null) {
  -            ipd.add(m_ipdTotal); // sum of all words so far in line
  +        if (ipdTotal != null) {
  +            ipd.add(ipdTotal); // sum of all words so far in line
           }
           // Note: break position now stores total size to here
   
           // Position is the index of the info for this word in the vector
  -        m_vecAreaInfo.add(
  -          new AreaInfo(iWordStart, m_iNextStart, iWScount, ipd));
  +        vecAreaInfo.add(
  +          new AreaInfo(iWordStart, iNextStart, iWScount, ipd));
           BreakPoss bp = new BreakPoss(
  -                         new LeafPosition(this, m_vecAreaInfo.size() - 1));
  -        m_ipdTotal = ipd;
  +                         new LeafPosition(this, vecAreaInfo.size() - 1));
  +        ipdTotal = ipd;
           if ((flags & BreakPoss.HYPHENATED) != 0) {
               // Add the hyphen size, but don't change total IPD!
               bp.setStackingSize(
  -              MinOptMax.add(ipd, new MinOptMax(m_hyphIPD)));
  +              MinOptMax.add(ipd, new MinOptMax(hyphIPD)));
           } else {
               bp.setStackingSize(ipd);
           }
  @@ -406,7 +407,7 @@
            */
           //bp.setDescender(textInfo.fs.getDescender());
           //bp.setAscender(textInfo.fs.getAscender());
  -        if (m_iNextStart == chars.length) {
  +        if (iNextStart == chars.length) {
               flags |= BreakPoss.ISLAST;
               setFinished(true);
           }
  @@ -447,11 +448,11 @@
            */
           while (posIter.hasNext()) {
               LeafPosition tbpNext = (LeafPosition) posIter.next();
  -            ai = (AreaInfo) m_vecAreaInfo.get(tbpNext.getLeafPos());
  +            ai = (AreaInfo) vecAreaInfo.get(tbpNext.getLeafPos());
               if (iStart == -1) {
  -                iStart = ai.m_iStartIndex;
  +                iStart = ai.iStartIndex;
               }
  -            iWScount += ai.m_iWScount;
  +            iWScount += ai.iWScount;
           }
           if(ai == null) {
               return;
  @@ -462,15 +463,15 @@
           if (dSpaceAdjust > 0.0) {
               // Stretch by factor
               //     System.err.println("Potential stretch = " +
  -            //        (ai.m_ipdArea.max - ai.m_ipdArea.opt));
  -            iAdjust = (int)((double)(ai.m_ipdArea.max -
  -                                     ai.m_ipdArea.opt) * dSpaceAdjust);
  +            //        (ai.ipdArea.max - ai.ipdArea.opt));
  +            iAdjust = (int)((double)(ai.ipdArea.max -
  +                                     ai.ipdArea.opt) * dSpaceAdjust);
           } else if (dSpaceAdjust < 0.0) {
               // Shrink by factor
               //     System.err.println("Potential shrink = " +
  -            //        (ai.m_ipdArea.opt - ai.m_ipdArea.min));
  -            iAdjust = (int)((double)(ai.m_ipdArea.opt -
  -                                     ai.m_ipdArea.min) * dSpaceAdjust);
  +            //        (ai.ipdArea.opt - ai.ipdArea.min));
  +            iAdjust = (int)((double)(ai.ipdArea.opt -
  +                                     ai.ipdArea.min) * dSpaceAdjust);
           }
           // System.err.println("Text adjustment factor = " + dSpaceAdjust +
           //    " total=" + iAdjust);
  @@ -479,14 +480,14 @@
           Word word = null;
           int adjust = 0;
           // ingnore newline character
  -        if(chars[ai.m_iBreakIndex - 1] == NEWLINE) {
  +        if(chars[ai.iBreakIndex - 1] == NEWLINE) {
               adjust = 1;
           }
  -        String str = new String(chars, iStart, ai.m_iBreakIndex - iStart - adjust);
  +        String str = new String(chars, iStart, ai.iBreakIndex - iStart - adjust);
           //if(!"".equals(str.trim())) {
               word = createWord(
                         str,
  -                      ai.m_ipdArea.opt + iAdjust, context.getBaseline());
  +                      ai.ipdArea.opt + iAdjust, context.getBaseline());
               if (iWScount > 0) {
                   //log.error("Adjustment per word-space= " +
                   //                   iAdjust / iWScount);
  @@ -495,11 +496,11 @@
           //}
           if ((chars[iStart] == SPACE || chars[iStart] == NBSPACE) &&
                   context.getLeadingSpace().hasSpaces()) {
  -            context.getLeadingSpace().addSpace(m_halfWS);
  +            context.getLeadingSpace().addSpace(halfWS);
           }
           // Set LAST flag if done making characters
           int iLastChar;
  -        for (iLastChar = ai.m_iBreakIndex;
  +        for (iLastChar = ai.iBreakIndex;
                   iLastChar < chars.length && chars[iLastChar] == SPACE;
                   iLastChar++)
               ;
  @@ -508,9 +509,9 @@
   
           // Can we have any trailing space? Yes, if last char was a space!
           context.setTrailingSpace(new SpaceSpecifier(false));
  -        if (chars[ai.m_iBreakIndex - 1] == SPACE ||
  -                chars[ai.m_iBreakIndex - 1] == NBSPACE) {
  -            context.getTrailingSpace().addSpace(m_halfWS);
  +        if (chars[ai.iBreakIndex - 1] == SPACE ||
  +                chars[ai.iBreakIndex - 1] == NBSPACE) {
  +            context.getTrailingSpace().addSpace(halfWS);
           }
           if(word != null) {
               parentLM.addChild(word);
  
  
  
  1.3       +4 -5      xml-fop/src/org/apache/fop/layoutmgr/list/Item.java
  
  Index: Item.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/list/Item.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Item.java 6 Nov 2002 15:46:55 -0000       1.2
  +++ Item.java 13 Nov 2002 10:25:58 -0000      1.3
  @@ -24,6 +24,7 @@
   import org.apache.fop.layout.BackgroundProps;
   
   import java.util.ArrayList;
  +import java.util.List;
   
   /**
    * LayoutManager for a table-cell FO.
  @@ -36,7 +37,7 @@
   
       private Block curBlockArea;
   
  -    private ArrayList childBreaks = new ArrayList();
  +    private List childBreaks = new ArrayList();
   
       private int xoffset;
       private int itemIPD;
  @@ -205,12 +206,10 @@
        * @param childArea the child to add to the cell
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
               curBlockArea.addBlock((Block) childArea);
  -            return false;
           }
  -        return false;
       }
   
       /**
  
  
  
  1.3       +12 -24    
xml-fop/src/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
  
  Index: ListBlockLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ListBlockLayoutManager.java       6 Nov 2002 15:46:55 -0000       1.2
  +++ ListBlockLayoutManager.java       13 Nov 2002 10:25:58 -0000      1.3
  @@ -27,22 +27,17 @@
   import java.util.List;
   
   /**
  - * LayoutManager for a table FO.
  - * A table consists of columns, table header, table footer and multiple
  - * table bodies.
  - * The header, footer and body add the areas created from the table cells.
  - * The table then creates areas for the columns, bodies and rows
  - * the render background.
  + * LayoutManager for a list-block FO.
  + * A list block contains list items which are stacked within
  + * the list block area..
    */
   public class ListBlockLayoutManager extends BlockStackingLayoutManager {
  -    private List columns = null;
  -
       private BorderAndPadding borderProps = null;
       private BackgroundProps backgroundProps;
   
       private Block curBlockArea;
   
  -    private ArrayList bodyBreaks = new ArrayList();
  +    private List bodyBreaks = new ArrayList();
   
       private class SectionPosition extends LeafPosition {
           protected List list;
  @@ -75,14 +70,14 @@
        * @return the next break possibility
        */
       public BreakPoss getNextBreakPoss(LayoutContext context) {
  -        ListItemLayoutManager curLM; // currently active LM
  +        LayoutManager curLM; // currently active LM
   
           MinOptMax stackSize = new MinOptMax();
           // if starting add space before
           // stackSize.add(spaceBefore);
           BreakPoss lastPos = null;
   
  -        while ((curLM = (ListItemLayoutManager)getChildLM()) != null) {
  +        while ((curLM = (LayoutManager)getChildLM()) != null) {
               // Make break positions
               // Set up a LayoutContext
               int ipd = context.getRefIPD();
  @@ -138,7 +133,7 @@
   
           int listHeight = 0;
   
  -        ListItemLayoutManager childLM;
  +        LayoutManager childLM;
           int iStartPos = 0;
           LayoutContext lc = new LayoutContext(0);
           while (parentIter.hasNext()) {
  @@ -148,16 +143,11 @@
                 new BreakPossPosIter(bodyBreaks, iStartPos,
                                      lfp.getLeafPos() + 1);
               iStartPos = lfp.getLeafPos() + 1;
  -            while ((childLM = (ListItemLayoutManager)breakPosIter.getNextChildLM()) 
!= null) {
  +            while ((childLM = (LayoutManager)breakPosIter.getNextChildLM()) != 
null) {
                   childLM.addAreas(breakPosIter, lc);
  -                listHeight += childLM.getListItemHeight();
               }
           }
   
  -        // add footer areas
  -
  -        curBlockArea.setHeight(listHeight);
  -
           if(borderProps != null) { 
               addBorders(curBlockArea, borderProps);
           }
  @@ -204,13 +194,10 @@
        * @param childArea the child area to add
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
  -                curBlockArea.addBlock((Block) childArea);
  -
  -                return false;
  +            curBlockArea.addBlock((Block) childArea);
           }
  -        return false;
       }
   
       /**
  @@ -220,6 +207,7 @@
        */
       public void resetPosition(Position resetPos) {
           if (resetPos == null) {
  +            bodyBreaks.clear();
               reset(null);
           }
       }
  
  
  
  1.3       +4 -6      
xml-fop/src/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
  
  Index: ListItemLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ListItemLayoutManager.java        6 Nov 2002 15:46:55 -0000       1.2
  +++ ListItemLayoutManager.java        13 Nov 2002 10:25:58 -0000      1.3
  @@ -85,7 +85,7 @@
           Item curLM; // currently active LM
   
           BreakPoss lastPos = null;
  -        ArrayList breakList = new ArrayList();
  +        List breakList = new ArrayList();
   
           int min = 0;
           int opt = 0;
  @@ -100,7 +100,7 @@
               } else {
                   break;
               }
  -            ArrayList childBreaks = new ArrayList();
  +            List childBreaks = new ArrayList();
               MinOptMax stackSize = new MinOptMax();
   
               // Set up a LayoutContext
  @@ -248,12 +248,10 @@
        * @param childArea the child area
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
               curBlockArea.addBlock((Block) childArea);
  -            return false;
           }
  -        return false;
       }
   
       /**
  
  
  
  1.6       +4 -4      xml-fop/src/org/apache/fop/layoutmgr/table/Body.java
  
  Index: Body.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/table/Body.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Body.java 6 Nov 2002 15:46:55 -0000       1.5
  +++ Body.java 13 Nov 2002 10:25:58 -0000      1.6
  @@ -42,7 +42,7 @@
   
       private Block curBlockArea;
   
  -    private ArrayList childBreaks = new ArrayList();
  +    private List childBreaks = new ArrayList();
   
       /**
        * Create a new body layout manager.
  @@ -212,8 +212,8 @@
        * @param childArea the child area to add
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  -        return parentLM.addChild(childArea);
  +    public void addChild(Area childArea) {
  +        parentLM.addChild(childArea);
       }
   
       /**
  
  
  
  1.3       +4 -7      xml-fop/src/org/apache/fop/layoutmgr/table/Caption.java
  
  Index: Caption.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/table/Caption.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Caption.java      6 Nov 2002 15:46:55 -0000       1.2
  +++ Caption.java      13 Nov 2002 10:25:58 -0000      1.3
  @@ -21,6 +21,7 @@
   import org.apache.fop.area.MinOptMax;
   
   import java.util.ArrayList;
  +import java.util.List;
   
   /**
    * LayoutManager for a table-caption FO.
  @@ -31,7 +32,7 @@
   
       private Block curBlockArea;
   
  -    private ArrayList childBreaks = new ArrayList();
  +    private List childBreaks = new ArrayList();
   
       /**
        * Create a new Caption layout manager.
  @@ -166,14 +167,10 @@
        * @param childArea the child area to add
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
                   curBlockArea.addBlock((Block) childArea);
  -                //return super.addChild(childArea);
  -
  -                return false;
           }
  -        return false;
       }
   
       /**
  
  
  
  1.6       +4 -5      xml-fop/src/org/apache/fop/layoutmgr/table/Cell.java
  
  Index: Cell.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/table/Cell.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Cell.java 6 Nov 2002 15:46:55 -0000       1.5
  +++ Cell.java 13 Nov 2002 10:25:58 -0000      1.6
  @@ -24,6 +24,7 @@
   import org.apache.fop.layout.BackgroundProps;
   
   import java.util.ArrayList;
  +import java.util.List;
   
   /**
    * LayoutManager for a table-cell FO.
  @@ -36,7 +37,7 @@
   
       private Block curBlockArea;
   
  -    private ArrayList childBreaks = new ArrayList();
  +    private List childBreaks = new ArrayList();
   
       private int xoffset;
       private int yoffset;
  @@ -228,12 +229,10 @@
        * @param childArea the child to add to the cell
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
               curBlockArea.addBlock((Block) childArea);
  -            return false;
           }
  -        return false;
       }
   
       /**
  
  
  
  1.6       +10 -10    xml-fop/src/org/apache/fop/layoutmgr/table/Row.java
  
  Index: Row.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/table/Row.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Row.java  6 Nov 2002 15:46:55 -0000       1.5
  +++ Row.java  13 Nov 2002 10:25:58 -0000      1.6
  @@ -82,11 +82,11 @@
       private void setupCells() {
           cellList = new ArrayList();
           // add cells to list
  -        while (m_childLMiter.hasNext()) {
  -            m_curChildLM = (LayoutManager) m_childLMiter.next();
  -            m_curChildLM.setParentLM(this);
  -            m_curChildLM.init();
  -            cellList.add(m_curChildLM);
  +        while (childLMiter.hasNext()) {
  +            curChildLM = (LayoutManager) childLMiter.next();
  +            curChildLM.setParentLM(this);
  +            curChildLM.init();
  +            cellList.add(curChildLM);
           }
       }
   
  @@ -118,7 +118,7 @@
           LayoutManager curLM; // currently active LM
   
           BreakPoss lastPos = null;
  -        ArrayList breakList = new ArrayList();
  +        List breakList = new ArrayList();
   
           int min = 0;
           int opt = 0;
  @@ -127,7 +127,7 @@
           int cellcount = 0;
           while ((curLM = getCellLM(cellcount++)) != null) {
   
  -            ArrayList childBreaks = new ArrayList();
  +            List childBreaks = new ArrayList();
               MinOptMax stackSize = new MinOptMax();
   
               // Set up a LayoutContext
  @@ -289,8 +289,8 @@
        * @param childArea the child area
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  -        return parentLM.addChild(childArea);
  +    public void addChild(Area childArea) {
  +        parentLM.addChild(childArea);
       }
   
       /**
  
  
  
  1.3       +5 -8      
xml-fop/src/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
  
  Index: TableAndCaptionLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TableAndCaptionLayoutManager.java 6 Nov 2002 15:46:55 -0000       1.2
  +++ TableAndCaptionLayoutManager.java 13 Nov 2002 10:25:58 -0000      1.3
  @@ -21,6 +21,7 @@
   import org.apache.fop.area.MinOptMax;
   
   import java.util.ArrayList;
  +import java.util.List;
   
   /**
    * LayoutManager for a table-and-caption FO.
  @@ -33,7 +34,7 @@
   
       private Block curBlockArea;
   
  -    private ArrayList childBreaks = new ArrayList();
  +    private List childBreaks = new ArrayList();
   
       /**
        * Create a new table and caption layout manager.
  @@ -168,14 +169,10 @@
        * @param childArea the area to add
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
  -                curBlockArea.addBlock((Block) childArea);
  -                //return super.addChild(childArea);
  -
  -                return false;
  +            curBlockArea.addBlock((Block) childArea);
           }
  -        return false;
       }
   
       /**
  
  
  
  1.4       +5 -8      
xml-fop/src/org/apache/fop/layoutmgr/table/TableLayoutManager.java
  
  Index: TableLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layoutmgr/table/TableLayoutManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TableLayoutManager.java   1 Nov 2002 10:49:34 -0000       1.3
  +++ TableLayoutManager.java   13 Nov 2002 10:25:58 -0000      1.4
  @@ -44,7 +44,7 @@
   
       private Block curBlockArea;
   
  -    private ArrayList bodyBreaks = new ArrayList();
  +    private List bodyBreaks = new ArrayList();
       private BreakPoss headerBreak;
       private BreakPoss footerBreak;
   
  @@ -186,7 +186,7 @@
   
           lm.setColumns(columns);
   
  -        ArrayList breaks = new ArrayList();
  +        List breaks = new ArrayList();
           while (!lm.isFinished()) {
               if ((bp = lm.getNextBreakPoss(childLC)) != null) {
                   stackSize.add(bp.getStackingSize());
  @@ -286,13 +286,10 @@
        * @param childArea the child area to add
        * @return unused
        */
  -    public boolean addChild(Area childArea) {
  +    public void addChild(Area childArea) {
           if (curBlockArea != null) {
  -                curBlockArea.addBlock((Block) childArea);
  -
  -                return false;
  +            curBlockArea.addBlock((Block) childArea);
           }
  -        return false;
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to