You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Fotis Jannidis <fo...@lrz.uni-muenchen.de> on 2000/11/17 11:43:40 UTC

bugs and test files

There is now a test case for each of the following bugs:

- lists containing list do not keep their indentation correctly over a   
  page boundary (see page 11/12 in list.fo)

- border width in fo:table is added to the start position of the next   
  block or  table (see page 6 in table.fo for a test case)

Fotis


Re: bugs and test files, consistent with spec?

Posted by Corinna Hischke <co...@infix.de>.
Hi Doro, hi all,

> I get only two vertical lines, positioned just beneath one another with
> the patch applied and  offset by the border-width without the patch
> applied.

up to now I used block-container always with a width and height setting.
With these settings your example shows up fine.

As the default value for width is auto, I tried the following:

I added these lines in BlockContainer.java:

*** BlockContainer.java~ Sat Nov 11 00:16:00 2000
--- BlockContainer.java Tue Nov 21 19:04:57 2000
***************
*** 220,225 ****
--- 220,230 ----
            width = right - left;
            height = bottom - top;
          }
+  // if dimensions are still 0, use existing space
+         if ((this.width == 0) && (this.height == 0)) {
+    width = area.getAllocationWidth();
+    height = area.spaceLeft();
+  }
   this.areaContainer =
            new AreaContainer(fs, container.getXPosition() + left,
container.getYPosition() - top, width, height,
                              position);

With this, I interpret the value "auto" as "take all the space that's
available from your parent".

But I don't know, if this is consistent with the spec. Could anybody comment
on that?

Thanks,

Corinna


Re: bugs and test files

Posted by Dorothea Wiarda <wi...@vic.com>.
Fotis Jannidis wrote:
> 
> - border width in fo:table is added to the start position of the next
>   block or  table (see page 6 in table.fo for a test case)
> 

I tried to find this bug. I can fix it by applying the following patch,
which resets  the 
currentAreaContainerXPosition in the Render subclasses for all position
types not only if postion is not STATIC.

The only other object, besides Table, which may generates AreaContainer 
instances with position STATIC is:
<fo:block-container position="static" ..
which I did not get to work, very possibly because I did not understand
static positioning:
Trying the following 

<?xml version="1.0" encoding="utf-8"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">


  <!-- defines the layout master -->
  <fo:layout-master-set>
    <fo:simple-page-master master-name="first" 
                           page-height="29.7cm" 
                           page-width="21cm" 
                           margin-top="1cm" 
                           margin-bottom="2cm" 
                           margin-left="2.5cm" 
                           margin-right="2.5cm">
      <fo:region-body margin-top="3cm"/>
      <fo:region-before extent="3cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <!-- starts actual layout -->
  <fo:page-sequence master-name="first">

  <fo:flow flow-name="xsl-region-body">

      <fo:block-container  border-width="1.5mm" position="static">
         <fo:block>test test</fo:block>
      </fo:block-container>

      <fo:block-container 
             border-width="1.5mm" position="static">
        <fo:block>test</fo:block>
      </fo:block-container>


    </fo:flow>
  </fo:page-sequence>
</fo:root>

I get only two vertical lines, positioned just beneath one another with
the patch applied and  offset by the border-width without the patch
applied.

  Doro

-- 
________________________________________________________
Dorothea Wiarda

E-Mail:    wiarda@dwiarda.com
Web-Home:  http://www.dwiarda.com
           http://www.techno-info.com

Re: bugs and test files

Posted by Dorothea Wiarda <wi...@vic.com>.
Fotis Jannidis wrote:
> 
> I committed that fix. I am not sure about Doro's other bug fix,
> because I didn't check the static stuff. Maybe Arved or somebody
> who has been there could check her fix and commit it. If it is lost I
> can repost it.

Thank you,
  I am not so sure about the other fix either, precisely because I did
not understand what exactly static position is. However, I thought
pinpointing where the error occurs might somebody else give an idea how
to solve it.

   Any suggestion where I should turn my attention next. I was thinking
maybe AWTRenderer and SVG, but I take other suggestions. 

  Doro

________________________________________________________
Dorothea Wiarda

E-Mail:    wiarda@dwiarda.com
Web-Home:  http://www.dwiarda.com
           http://www.techno-info.com

Re: bugs and test files

Posted by Fotis Jannidis <fo...@lrz.uni-muenchen.de>.
I committed that fix. I am not sure about Doro's other bug fix, 
because I didn't check the static stuff. Maybe Arved or somebody 
who has been there could check her fix and commit it. If it is lost I 
can repost it.

Fotis






From:           	Dorothea Wiarda <wi...@vic.com>

> Happy Thanksgiving to all:
> 
> Fotis Jannidis wrote:
> > - lists containing list do not keep their indentation correctly over a
> >   page boundary (see page 11/12 in list.fo)
> > 
> This is due to the fact that ListBlock, ListItem and so on set
> bodyIndent in a different place then 
> setBodyIndent.
> Specifically, ListBlock sets:
>    
>             if (this.isInListBody) {
> 		startIndent += bodyIndent + distanceBetweenStarts;
> 		bodyIndent = startIndent;
> 	    }
> 
> This works fine until a new page is encountered. Then  setBodyIndent is
> called and bodyIndent is set to 0 and we lose the indentation.
> 
> The indentation gets propagated correctly if I override setBodyIndent in
> src/org/apache/fop/fo/flow/ListBlock, i.e.,
> add the following method to it:
> 
>        public void setBodyIndent(int indent) {
> 	    if (! this.isInListBody) {
>                 super.setBodyIndent(indent);
> 	    }
>        }
> 
> This way the independenly set bodyIndent in ListBlock, ListItem  is not
> affected by the page break.
> 
> 
>  Doro
> 
> -- 
> ________________________________________________________
> Dorothea Wiarda
> 
> E-Mail:    wiarda@dwiarda.com
> Web-Home:  http://www.dwiarda.com
>            http://www.techno-info.com



Re: bugs and test files

Posted by Dorothea Wiarda <wi...@vic.com>.
Happy Thanksgiving to all:

Fotis Jannidis wrote:
> - lists containing list do not keep their indentation correctly over a
>   page boundary (see page 11/12 in list.fo)
> 
This is due to the fact that ListBlock, ListItem and so on set
bodyIndent in a different place then 
setBodyIndent.
Specifically, ListBlock sets:
   
            if (this.isInListBody) {
		startIndent += bodyIndent + distanceBetweenStarts;
		bodyIndent = startIndent;
	    }

This works fine until a new page is encountered. Then  setBodyIndent is
called and bodyIndent is set to 0 and we lose the indentation.

The indentation gets propagated correctly if I override setBodyIndent in
src/org/apache/fop/fo/flow/ListBlock, i.e.,
add the following method to it:

       public void setBodyIndent(int indent) {
	    if (! this.isInListBody) {
                super.setBodyIndent(indent);
	    }
       }

This way the independenly set bodyIndent in ListBlock, ListItem  is not
affected by the page break.


 Doro

-- 
________________________________________________________
Dorothea Wiarda

E-Mail:    wiarda@dwiarda.com
Web-Home:  http://www.dwiarda.com
           http://www.techno-info.com