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/03/18 14:21:39 UTC

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

jeremias    2005/03/18 05:21:39

  Modified:    src/java/org/apache/fop/layoutmgr Tag:
                        Temp_KnuthStylePageBreaking
                        BlockContainerLayoutManager.java
  Log:
  Code to handle "no content" conditions.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.36.2.2  +23 -13    xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
  
  Index: BlockContainerLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v
  retrieving revision 1.36.2.1
  retrieving revision 1.36.2.2
  diff -u -r1.36.2.1 -r1.36.2.2
  --- BlockContainerLayoutManager.java	18 Mar 2005 09:02:55 -0000	1.36.2.1
  +++ BlockContainerLayoutManager.java	18 Mar 2005 13:21:39 -0000	1.36.2.2
  @@ -424,21 +424,23 @@
           MinOptMax range = new MinOptMax(relDims.ipd);
           BlockContainerBreaker breaker = new BlockContainerBreaker(this, range);
           breaker.doLayout(relDims.bpd);
  -        boolean contentOverflows = (breaker.deferredAlg.getPageBreaks().size() > 1);
  -        usedBPD = relDims.bpd - breaker.getDifferenceOfFirstPart(); 
  -
  -        Position bcPosition = new BlockContainerPosition(this, breaker);
  +        boolean contentOverflows = breaker.isOverflow();
           LinkedList returnList = new LinkedList();
  -        returnList.add(new KnuthBox(0, bcPosition, false));
  +        if (!breaker.isEmpty()) {
  +            usedBPD = relDims.bpd - breaker.getDifferenceOfFirstPart(); 
   
  -        //TODO Maybe check for page overflow when autoHeight=true
  -        if (!autoHeight & (contentOverflows/*usedBPD > relDims.bpd*/)) {
  -            log.warn("Contents overflow block-container viewport: clipping");
  -            if (fobj.getOverflow() == EN_HIDDEN) {
  -                clip = true;
  -            } else if (fobj.getOverflow() == EN_ERROR_IF_OVERFLOW) {
  -                //TODO Throw layout exception
  -                clip = true;
  +            Position bcPosition = new BlockContainerPosition(this, breaker);
  +            returnList.add(new KnuthBox(0, bcPosition, false));
  +    
  +            //TODO Maybe check for page overflow when autoHeight=true
  +            if (!autoHeight & (contentOverflows/*usedBPD > relDims.bpd*/)) {
  +                log.warn("Contents overflow block-container viewport: clipping");
  +                if (fobj.getOverflow() == EN_HIDDEN) {
  +                    clip = true;
  +                } else if (fobj.getOverflow() == EN_ERROR_IF_OVERFLOW) {
  +                    //TODO Throw layout exception
  +                    clip = true;
  +                }
               }
           }
   
  @@ -481,6 +483,14 @@
               return pbp.difference;
           }
           
  +        public boolean isOverflow() {
  +            if (isEmpty()) {
  +                return false;
  +            } else {
  +                return (deferredAlg.getPageBreaks().size() > 1);
  +            }
  +        }
  +        
           protected LayoutManager getTopLevelLM() {
               return bclm;
           }
  
  
  

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