jeremias    2005/01/28 03:03:19

  Modified:    src/java/org/apache/fop/datatypes LengthBase.java
  Log:
  Fixed CONTAINING_REFAREA (for list indents)
  
  Revision  Changes    Path
  1.11      +12 -6     xml-fop/src/java/org/apache/fop/datatypes/LengthBase.java
  
  Index: LengthBase.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/datatypes/LengthBase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- LengthBase.java   3 Jan 2005 13:06:27 -0000       1.10
  +++ LengthBase.java   28 Jan 2005 11:03:19 -0000      1.11
  @@ -19,6 +19,7 @@
   package org.apache.fop.datatypes;
   
   import org.apache.fop.fo.Constants;
  +import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.PropertyList;
   import org.apache.fop.fo.expr.PropertyException;
  @@ -127,11 +128,16 @@
           case BLOCK_HEIGHT:
               return 
parentFO.getLayoutDimension(PercentBase.BLOCK_BPD).intValue();
           case CONTAINING_REFAREA:    // example: start-indent, end-indent
  -            //FONode fo;
  -            //for (fo = parentFO; fo != null && 
!fo.generatesReferenceAreas();
  -            //        fo = fo.getParent());
  -            //return (((fo != null) && (fo instanceof FObj)) ? 
((FObj)fo).getContentWidth() : 0);
  -            return 0;
  +            FObj fo;
  +            fo = parentFO;
  +            while (fo != null && !fo.generatesReferenceAreas()) {
  +                fo = fo.findNearestAncestorFObj();
  +            }
  +            if (fo != null && fo instanceof FObj) {
  +                return 
fo.getLayoutDimension(PercentBase.BLOCK_IPD).intValue();
  +            } else {
  +                return 0;
  +            }
           case IMAGE_INTRINSIC_WIDTH:
               return propertyList.getFObj()
                   
.getLayoutDimension(PercentBase.IMAGE_INTRINSIC_WIDTH).intValue();
  @@ -142,7 +148,7 @@
               //log.debug("!!! LengthBase.getBaseLength() called on 
CUSTOM_BASE type !!!");
               return 0;
           default:
  -            //log.error("Unknown base type for LengthBase.");
  +            parentFO.getLogger().error("Unknown base type for LengthBase.");
               return 0;
           }
       }
  
  
  

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

Reply via email to