You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2005/05/25 21:16:00 UTC

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/table TableStepper.java

jeremias    2005/05/25 12:16:00

  Modified:    src/java/org/apache/fop/layoutmgr/list
                        ListItemLayoutManager.java
               src/java/org/apache/fop/layoutmgr/table TableStepper.java
  Log:
  A glue at the beginning of the element list can't be a legal break point. Fixes an ArrayIndexOutOfBounds when there's a space-before at the beginning of the list.
  
  Revision  Changes    Path
  1.24      +6 -4      xml-fop/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
  
  Index: ListItemLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ListItemLayoutManager.java	24 May 2005 13:42:30 -0000	1.23
  +++ ListItemLayoutManager.java	25 May 2005 19:16:00 -0000	1.24
  @@ -304,10 +304,12 @@
                           break;
                       }
                   } else if (el.isGlue()) {
  -                    KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
  -                    if (prev.isBox()) {
  -                        //Second legal break point
  -                        break;
  +                    if (end[i] > 0) {
  +                        KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
  +                        if (prev.isBox()) {
  +                            //Second legal break point
  +                            break;
  +                        }
                       }
                       partialHeights[i] += el.getW();
                   } else {
  
  
  
  1.7       +7 -5      xml-fop/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
  
  Index: TableStepper.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/TableStepper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TableStepper.java	24 May 2005 09:41:32 -0000	1.6
  +++ TableStepper.java	25 May 2005 19:16:00 -0000	1.7
  @@ -354,10 +354,12 @@
                           break;
                       }
                   } else if (el.isGlue()) {
  -                    KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
  -                    if (prev.isBox()) {
  -                        //Second legal break point
  -                        break;
  +                    if (end[i] > 0) {
  +                        KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
  +                        if (prev.isBox()) {
  +                            //Second legal break point
  +                            break;
  +                        }
                       }
                       widths[i] += el.getW();
                   } else {
  
  
  

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