klease      2002/09/26 14:09:21

  Modified:    src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain
                        AbstractTableBody.java BasicLink.java Block.java
                        BlockContainer.java ExternalGraphic.java
                        FootnoteBody.java InstreamForeignObject.java
                        ListBlock.java ListItem.java StaticContent.java
                        Table.java TableCell.java TableRow.java
  Log:
  Improve link hotspot positioning
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +2 -5      xml-fop/src/org/apache/fop/fo/flow/Attic/AbstractTableBody.java
  
  Index: AbstractTableBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/AbstractTableBody.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- AbstractTableBody.java    2 Aug 2002 20:28:48 -0000       1.1.2.2
  +++ AbstractTableBody.java    26 Sep 2002 21:09:19 -0000      1.1.2.3
  @@ -124,6 +124,7 @@
           area.spaceLeft(), Position.RELATIVE);
           areaContainer.foCreator = this;                  // G Seshadri
           areaContainer.setPage(area.getPage());
  +     areaContainer.setParent(area);
           areaContainer.setBackground(propMgr.getBackgroundProps());
           areaContainer.setBorderAndPadding(propMgr.getBorderAndPadding());
           areaContainer.start();
  @@ -165,7 +166,6 @@
                       // areaContainer.end();
   
                       area.increaseHeight(areaContainer.getHeight());
  -                    area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
                       if (i == numChildren - 1) {
                           this.marker = BREAK_AFTER;
                           if (spaceAfter != 0) {
  @@ -202,7 +202,6 @@
                       // areaContainer.end();
   
                       area.increaseHeight(areaContainer.getHeight());
  -                    area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
                   }
   
                   // Fix for infinite loop bug if spanned rows are too big for page
  @@ -225,8 +224,6 @@
           areaContainer.end();
   
           area.increaseHeight(areaContainer.getHeight());
  -
  -        area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
   
           if (spaceAfter != 0) {
               area.increaseHeight(spaceAfter);
  
  
  
  1.8.2.4   +11 -3     xml-fop/src/org/apache/fop/fo/flow/BasicLink.java
  
  Index: BasicLink.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/BasicLink.java,v
  retrieving revision 1.8.2.3
  retrieving revision 1.8.2.4
  diff -u -r1.8.2.3 -r1.8.2.4
  --- BasicLink.java    31 Aug 2002 15:12:21 -0000      1.8.2.3
  +++ BasicLink.java    26 Sep 2002 21:09:19 -0000      1.8.2.4
  @@ -100,7 +100,15 @@
   
           Page p = area.getPage();
   
  -        AreaContainer ac = p.getBody().getCurrentColumnArea();
  +        //AreaContainer ac = p.getBody().getCurrentColumnArea();
  +        AreaContainer ac = area.getNearestAncestorAreaContainer();
  +     while (ac!=null && ac.getPosition()!=Position.ABSOLUTE) {
  +         ac = ac.getNearestAncestorAreaContainer();
  +     }
  +     if (ac == null) {
  +         ac = p.getBody().getCurrentColumnArea();
  +         //System.err.println("Using currentColumnArea as AC for link");
  +     }
           if (ac == null) {
               throw new FOPException("Couldn't get ancestor AreaContainer when 
processing basic-link");
           }
  @@ -121,7 +129,7 @@
   
           // pass on command line
           String mergeLinks = System.getProperty("links.merge");
  -        if ((null != mergeLinks) &&!mergeLinks.equalsIgnoreCase("no")) {
  +        if ((null == mergeLinks) || mergeLinks.equalsIgnoreCase("yes")) {
               ls.mergeLinks();
           }
   
  
  
  
  1.41.2.9  +6 -5      xml-fop/src/org/apache/fop/fo/flow/Block.java
  
  Index: Block.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
  retrieving revision 1.41.2.8
  retrieving revision 1.41.2.9
  diff -u -r1.41.2.8 -r1.41.2.9
  --- Block.java        10 Aug 2002 20:09:40 -0000      1.41.2.8
  +++ Block.java        26 Sep 2002 21:09:19 -0000      1.41.2.9
  @@ -210,7 +210,6 @@
                           area.setMaxHeight(area.getMaxHeight() - spaceLeft
                                             + blockArea.getMaxHeight());
                           area.increaseHeight(blockArea.getHeight());
  -                        area.setAbsoluteHeight(blockArea.getAbsoluteHeight());
                           anythingLaidOut = true;
   
                           return status;
  @@ -226,7 +225,6 @@
                   area.setMaxHeight(area.getMaxHeight() - spaceLeft
                                     + blockArea.getMaxHeight());
                   area.increaseHeight(blockArea.getHeight());
  -                area.setAbsoluteHeight(blockArea.getAbsoluteHeight());
                   anythingLaidOut = true;
                   return status;
               }
  @@ -243,8 +241,6 @@
           /* should this be combined into above? */
           area.increaseHeight(blockArea.getHeight());
   
  -        area.setAbsoluteHeight(blockArea.getAbsoluteHeight());
  -
           if (spaceAfter != 0) {
               area.addDisplaySpace(spaceAfter);
           }
  @@ -292,6 +288,11 @@
   
       public int getSpan() {
           return this.span;
  +    }
  +
  +    public void resetMarker() {
  +     anythingLaidOut = false;
  +        super.resetMarker();
       }
   
   }
  
  
  
  1.11.2.4  +3 -3      xml-fop/src/org/apache/fop/fo/flow/BlockContainer.java
  
  Index: BlockContainer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/BlockContainer.java,v
  retrieving revision 1.11.2.3
  retrieving revision 1.11.2.4
  diff -u -r1.11.2.3 -r1.11.2.4
  --- BlockContainer.java       2 Aug 2002 20:28:48 -0000       1.11.2.3
  +++ BlockContainer.java       26 Sep 2002 21:09:19 -0000      1.11.2.4
  @@ -118,7 +118,8 @@
           areaContainer.setBorderAndPadding(propMgr.getBorderAndPadding());
           areaContainer.start();
   
  -        areaContainer.setAbsoluteHeight(area.getAbsoluteHeight());
  +        //areaContainer.setAbsoluteHeight(top);
  +        areaContainer.setAbsoluteHeight(0);
           areaContainer.setIDReferences(area.getIDReferences());
   
           int numChildren = this.children.size();
  @@ -145,7 +146,6 @@
                   prevChildMustKeepWithNext = true;
               }
           }
  -        area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
   
           areaContainer.end();
           if (position == Position.ABSOLUTE)
  
  
  
  1.13.2.3  +2 -2      xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java
  
  Index: ExternalGraphic.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- ExternalGraphic.java      2 Aug 2002 20:28:48 -0000       1.13.2.2
  +++ ExternalGraphic.java      26 Sep 2002 21:09:19 -0000      1.13.2.3
  @@ -218,7 +218,7 @@
                           return new Status(Status.AREA_FULL_NONE);
                       }
                   }
  -                la.addInlineArea(imageArea);
  +                la.addInlineArea(imageArea, this.getLinkSet());
               } else {
                   area.addChild(imageArea);
                   area.increaseHeight(imageArea.getContentHeight());
  
  
  
  1.6.2.3   +2 -1      xml-fop/src/org/apache/fop/fo/flow/FootnoteBody.java
  
  Index: FootnoteBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/FootnoteBody.java,v
  retrieving revision 1.6.2.2
  retrieving revision 1.6.2.3
  diff -u -r1.6.2.2 -r1.6.2.3
  --- FootnoteBody.java 2 Aug 2002 20:28:48 -0000       1.6.2.2
  +++ FootnoteBody.java 26 Sep 2002 21:09:19 -0000      1.6.2.3
  @@ -57,6 +57,7 @@
                             alignLast, lineHeight);
           blockArea.setGeneratedBy(this);
           blockArea.isFirst(true);
  +        blockArea.setParent(area);
           blockArea.setPage(area.getPage());
           blockArea.start();
   
  
  
  
  1.14.2.3  +3 -2      xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java
  
  Index: InstreamForeignObject.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java,v
  retrieving revision 1.14.2.2
  retrieving revision 1.14.2.3
  diff -u -r1.14.2.2 -r1.14.2.3
  --- InstreamForeignObject.java        2 Aug 2002 20:28:48 -0000       1.14.2.2
  +++ InstreamForeignObject.java        26 Sep 2002 21:09:19 -0000      1.14.2.3
  @@ -238,7 +238,7 @@
                       return new Status(Status.AREA_FULL_NONE);
                   }
               }
  -            la.addInlineArea(areaCurrent);
  +            la.addInlineArea(areaCurrent, this.getLinkSet());
           } else {
               area.addChild(areaCurrent);
               area.increaseHeight(areaCurrent.getEffectiveHeight());
  @@ -297,3 +297,4 @@
       }
   
   }
  +
  
  
  
  1.21.2.4  +4 -3      xml-fop/src/org/apache/fop/fo/flow/ListBlock.java
  
  Index: ListBlock.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ListBlock.java,v
  retrieving revision 1.21.2.3
  retrieving revision 1.21.2.4
  diff -u -r1.21.2.3 -r1.21.2.4
  --- ListBlock.java    2 Aug 2002 20:28:48 -0000       1.21.2.3
  +++ ListBlock.java    26 Sep 2002 21:09:19 -0000      1.21.2.4
  @@ -117,6 +117,8 @@
                             area.getAllocationWidth(), area.spaceLeft(),
                             startIndent, endIndent, 0, align, alignLast,
                             lineHeight);
  +     // Fix links in lists in tables problem
  +     blockArea.setTableCellXOffset(area.getTableCellXOffset());
           blockArea.setGeneratedBy(this);
           this.areasGenerated++;
           if (this.areasGenerated == 1)
  @@ -129,6 +131,7 @@
               blockArea.addMarkers(this.getMarkers());
   
   
  +        blockArea.setParent(area);
           blockArea.setPage(area.getPage());
           blockArea.setBackground(propMgr.getBackgroundProps());
           blockArea.start();
  @@ -152,7 +155,6 @@
                   blockArea.end();
                   area.addChild(blockArea);
                   area.increaseHeight(blockArea.getHeight());
  -                area.setAbsoluteHeight(blockArea.getAbsoluteHeight());
                   return status;
               }
           }
  @@ -160,7 +162,6 @@
           blockArea.end();
           area.addChild(blockArea);
           area.increaseHeight(blockArea.getHeight());
  -        area.setAbsoluteHeight(blockArea.getAbsoluteHeight());
   
           if (spaceAfter != 0) {
               area.addDisplaySpace(spaceAfter);
  
  
  
  1.16.2.3  +6 -3      xml-fop/src/org/apache/fop/fo/flow/ListItem.java
  
  Index: ListItem.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ListItem.java,v
  retrieving revision 1.16.2.2
  retrieving revision 1.16.2.3
  diff -u -r1.16.2.2 -r1.16.2.3
  --- ListItem.java     2 Aug 2002 20:28:49 -0000       1.16.2.2
  +++ ListItem.java     26 Sep 2002 21:09:19 -0000      1.16.2.3
  @@ -104,6 +104,10 @@
               new BlockArea(propMgr.getFontState(area.getFontInfo()),
                             area.getAllocationWidth(), area.spaceLeft(), 0, 0,
                             0, align, alignLast, lineHeight);
  +
  +     // Fix links in lists in tables problem
  +     blockArea.setTableCellXOffset(area.getTableCellXOffset());
  +
           this.blockArea.setGeneratedBy(this);
           this.areasGenerated++;
           if (this.areasGenerated == 1)
  @@ -115,6 +119,7 @@
           if (this.hasMarkers())
               this.blockArea.addMarkers(this.getMarkers());
   
  +        blockArea.setParent(area);
           blockArea.setPage(area.getPage());
           blockArea.start();
   
  @@ -148,7 +153,6 @@
               blockArea.end();
               area.addChild(blockArea);
               area.increaseHeight(blockArea.getHeight());
  -            area.setAbsoluteHeight(blockArea.getAbsoluteHeight());
               this.marker = 1;
               return status;
           }
  @@ -156,7 +160,6 @@
           blockArea.end();
           area.addChild(blockArea);
           area.increaseHeight(blockArea.getHeight());
  -        area.setAbsoluteHeight(blockArea.getAbsoluteHeight());
   
           if (spaceAfter != 0) {
               area.addDisplaySpace(spaceAfter);
  
  
  
  1.18.2.4  +3 -6      xml-fop/src/org/apache/fop/fo/flow/StaticContent.java
  
  Index: StaticContent.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/StaticContent.java,v
  retrieving revision 1.18.2.3
  retrieving revision 1.18.2.4
  diff -u -r1.18.2.3 -r1.18.2.4
  --- StaticContent.java        2 Aug 2002 20:28:49 -0000       1.18.2.3
  +++ StaticContent.java        26 Sep 2002 21:09:19 -0000      1.18.2.4
  @@ -62,11 +62,8 @@
           if (area instanceof org.apache.fop.layout.AreaContainer)
               ((org.apache.fop.layout.AreaContainer)area).setAreaName(regionClass);
   
  -        if (regionClass.equals(RegionBefore.REGION_CLASS)) {
  -            area.setAbsoluteHeight(-area.getMaxHeight());
  -        } else if (regionClass.equals(RegionAfter.REGION_CLASS)) {
  -            area.setAbsoluteHeight(area.getPage().getBody().getMaxHeight());
  -        }
  +     area.setAbsoluteHeight(0); // Ytop relative to self!
  +
        setContentWidth(area.getContentWidth());
   
           for (int i = 0; i < numChildren; i++) {
  
  
  
  1.39.2.5  +2 -5      xml-fop/src/org/apache/fop/fo/flow/Table.java
  
  Index: Table.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v
  retrieving revision 1.39.2.4
  retrieving revision 1.39.2.5
  diff -u -r1.39.2.4 -r1.39.2.5
  --- Table.java        2 Aug 2002 20:28:49 -0000       1.39.2.4
  +++ Table.java        26 Sep 2002 21:09:19 -0000      1.39.2.5
  @@ -172,6 +172,7 @@
   
           areaContainer.foCreator = this;    // G Seshadri
           areaContainer.setPage(area.getPage());
  +        areaContainer.setParent(area);
           areaContainer.setBackground(propMgr.getBackgroundProps());
           areaContainer.setBorderAndPadding(propMgr.getBorderAndPadding());
           areaContainer.start();
  @@ -256,7 +257,6 @@
                       if (areaContainer.getContentHeight() > 0) {
                           area.addChild(areaContainer);
                           area.increaseHeight(areaContainer.getHeight());
  -                        area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
                           if (this.omitHeaderAtBreak) {
                               // remove header, no longer needed
                               tableHeader = null;
  @@ -295,7 +295,6 @@
                   log.warn("footer could not fit on page, moving last body row to 
next page");
                   area.addChild(areaContainer);
                   area.increaseHeight(areaContainer.getHeight());
  -                area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
                   if (this.omitHeaderAtBreak) {
                       // remove header, no longer needed
                       tableHeader = null;
  @@ -316,8 +315,6 @@
   
           /* should this be combined into above? */
           area.increaseHeight(areaContainer.getHeight());
  -
  -        area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
   
           if (spaceAfter != 0) {
               area.addDisplaySpace(spaceAfter);
  
  
  
  1.39.2.6  +4 -3      xml-fop/src/org/apache/fop/fo/flow/TableCell.java
  
  Index: TableCell.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableCell.java,v
  retrieving revision 1.39.2.5
  retrieving revision 1.39.2.6
  diff -u -r1.39.2.5 -r1.39.2.6
  --- TableCell.java    2 Aug 2002 20:28:49 -0000       1.39.2.5
  +++ TableCell.java    26 Sep 2002 21:09:19 -0000      1.39.2.6
  @@ -244,6 +244,7 @@
   
           cellArea.foCreator = this;    // G Seshadri
           cellArea.setPage(area.getPage());
  +     cellArea.setParent(area);
        try {
            cellArea.setBorderAndPadding((BorderAndPadding)
                                      propMgr.getBorderAndPadding().clone());
  @@ -256,8 +257,8 @@
   
           cellArea.setAbsoluteHeight(area.getAbsoluteHeight());    // ???
           cellArea.setIDReferences(area.getIDReferences());
  -        // ******** CHECK THIS: we've changed startOffset (KL)
  -        cellArea.setTableCellXOffset(startOffset);
  +     // Add adjust for padding and border to fix link alignment!
  +        cellArea.setTableCellXOffset(startOffset + startAdjust);
   
           int numChildren = this.children.size();
           for (int i = this.marker; bDone==false && i < numChildren; i++) {
  
  
  
  1.51.2.5  +2 -1      xml-fop/src/org/apache/fop/fo/flow/TableRow.java
  
  Index: TableRow.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableRow.java,v
  retrieving revision 1.51.2.4
  retrieving revision 1.51.2.5
  diff -u -r1.51.2.4 -r1.51.2.5
  --- TableRow.java     2 Aug 2002 20:28:49 -0000       1.51.2.4
  +++ TableRow.java     26 Sep 2002 21:09:19 -0000      1.51.2.5
  @@ -250,6 +250,7 @@
                                 Position.RELATIVE);
           areaContainer.foCreator = this;    // G Seshadri
           areaContainer.setPage(area.getPage());
  +     areaContainer.setParent(area);
   
           areaContainer.setBackground(propMgr.getBackgroundProps());
           areaContainer.start();
  
  
  

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

Reply via email to