Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-12 Thread Jeremias Maerki
I think I got it. As soon as I started working with start|end-indent
wherever possible everthing started clicking in place and got simpler.

Thanks again for your patience and for your helpful advice!


Jeremias Maerki



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-11 Thread Jeremias Maerki
Funny! I just came to the same conclusion a few minutes ago. Simon's
last comment brought me to that.

Simon:
"I see no mention in section 5 of the spec that the trait value for
start-indent is different from the computed property value."

I then checked the BlockLayoutManager and realized that what Finn is now
saying is exactly what's suboptimal about the current approach. I'm just
now reworking the code to implement what Finn suggests. It also lets me
forget about that silly and complicated MarginPropertyMaker I started to
write.

Thanks Guys helping me on the right track!

On 12.01.2005 08:42:24 Finn Bock wrote:
> [Simon]
> 
> >>>There does not seem to be a need to add
> >>>the inherited value later; the property maker already has done so. See
> >>>IndentPropertyMaker.compute(PropertyList). It uses
> >>>propertyList.getInherited(baseMaker.propId).getNumeric()) to get the
> >>>inherited value. Earlier FOP developers understood this part well.
> 
> [Jeremias]
> 
> >>I understand, but I think you're talking exclusively about the property
> >>resolution phase (right?) while I found that I need the computed value
> >>of the margin property (not only the explicit one as is currently the
> >>case) and the inherited start-indent for the layout manager code and to
> >>set traits correctly.
> 
> [Simon]
> 
> > PropertyList().get(Constants.PR_START_INDENT) gets the computed value,
> > that is, the value after property refinement. It is not the raw value
> > stated in the FO file; FOP does not store that at all. FOP tries to do
> > property refinement immediately. If that is not possible because the
> > computed value depends on a trait of an area, FOP stores an
> > expression, which can be computed at layout time.
> > 
> > I see no mention in section 5 of the spec that the trait value for
> > start-indent is different from the computed property value.
> 
> The problem that Jeremias is trying to address is computing 
> space-[start,end] traits. Since only start-indent was computed correctly 
> he tried to compute space-[start,end] traits based on the 
> [start,end]-indent and to do that the inherited indent values (which has 
> just been added in IndentPropertyMaker) must be substracted.
> 
> Which may indicate that calculating space-[start,end] traits based on 
> indents is probably not the right approach.
> 
> I think the solution would be to:
> - Store the [start,end]-indent traits.
> - Let LayoutContent.refIPD be the reference IPD rather than the content
>ipd of the parent.
> - let the renderer keep track of the reference rect and use the
>start-indent trait to locate the position of the content rectangle.



Jeremias Maerki



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-11 Thread Finn Bock
[Simon]
There does not seem to be a need to add
the inherited value later; the property maker already has done so. See
IndentPropertyMaker.compute(PropertyList). It uses
propertyList.getInherited(baseMaker.propId).getNumeric()) to get the
inherited value. Earlier FOP developers understood this part well.
[Jeremias]
I understand, but I think you're talking exclusively about the property
resolution phase (right?) while I found that I need the computed value
of the margin property (not only the explicit one as is currently the
case) and the inherited start-indent for the layout manager code and to
set traits correctly.
[Simon]
PropertyList().get(Constants.PR_START_INDENT) gets the computed value,
that is, the value after property refinement. It is not the raw value
stated in the FO file; FOP does not store that at all. FOP tries to do
property refinement immediately. If that is not possible because the
computed value depends on a trait of an area, FOP stores an
expression, which can be computed at layout time.
I see no mention in section 5 of the spec that the trait value for
start-indent is different from the computed property value.
The problem that Jeremias is trying to address is computing 
space-[start,end] traits. Since only start-indent was computed correctly 
he tried to compute space-[start,end] traits based on the 
[start,end]-indent and to do that the inherited indent values (which has 
just been added in IndentPropertyMaker) must be substracted.

Which may indicate that calculating space-[start,end] traits based on 
indents is probably not the right approach.

I think the solution would be to:
- Store the [start,end]-indent traits.
- Let LayoutContent.refIPD be the reference IPD rather than the content
  ipd of the parent.
- let the renderer keep track of the reference rect and use the
  start-indent trait to locate the position of the content rectangle.
regards,
finn


Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-11 Thread Simon Pepping
On Tue, Jan 11, 2005 at 09:25:50AM +0100, Jeremias Maerki wrote:
> 
> On 10.01.2005 22:00:01 Simon Pepping wrote:
> > There does not seem to be a need to add
> > the inherited value later; the property maker already has done so. See
> > IndentPropertyMaker.compute(PropertyList). It uses
> > propertyList.getInherited(baseMaker.propId).getNumeric()) to get the
> > inherited value. Earlier FOP developers understood this part well.
> 
> I understand, but I think you're talking exclusively about the property
> resolution phase (right?) while I found that I need the computed value
> of the margin property (not only the explicit one as is currently the
> case) and the inherited start-indent for the layout manager code and to
> set traits correctly.

PropertyList().get(Constants.PR_START_INDENT) gets the computed value,
that is, the value after property refinement. It is not the raw value
stated in the FO file; FOP does not store that at all. FOP tries to do
property refinement immediately. If that is not possible because the
computed value depends on a trait of an area, FOP stores an
expression, which can be computed at layout time.

I see no mention in section 5 of the spec that the trait value for
start-indent is different from the computed property value.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-11 Thread Jeremias Maerki

On 10.01.2005 22:00:01 Simon Pepping wrote:
> Section 5.3.2 of the spec is really hard to understand. I combine it
> with 5.1.4 about Inheritance. Then my guess is this:
> 
> A test file
>   
> A test file
>   
> 
> 
> The computed value of start-indent on the outer block is 'start-indent
> = inherited_value_of(start-indent) + margin-corresponding +
> padding-corresponding + border-corresponding-width' = 0 + 1pc + 0 +
> 0. The computed value of start-indent on the inner block is
> 'start-indent = inherited_value_of(start-indent) +
> margin-corresponding + padding-corresponding +
> border-corresponding-width' = 1.5pc + 1pc + 0 + 0.
> 
> In this case:
> 
> A test file
>   
> A test file
>   
> 
> 
> the computed value of start-indent on the outer block is 'start-indent
> = inherited_value_of(start-indent) + margin-corresponding +
> padding-corresponding + border-corresponding-width' = 0 + 1pc + 0 +
> 0. The computed value of start-indent on the inner block is
> 'start-indent = inherited_value_of(start-indent) +
> margin-corresponding + padding-corresponding +
> border-corresponding-width' = 1pc + 1pc + 0 + 0. The inherited value
> uses the calculated value (sect. 5.1.4). That is the value that should
> be returned by
> pList.getParentPropertyList().get(Constants.PR_START_INDENT).getLength().

I agree with your interpretation.

> The inherited value should not be stored, but used in the computation
> of the property value. This should be implemented by the property
> maker.

In the meantime I've rewritten that part and removed the two fields I
introduced on CommonMarginBlock. But the code needs some more work until
I'm ready to check in. All testcases pass again but I don't have any
tests for writing mode changes which is important for the
MarginPropertyMaker I wrote to get the computed margin values.

> When I run the above examples in a debugger, I find that the computed
> start-indent values CommonMarginBlock.startIndent are exactly like I
> argue above they should be.

Yes.

> There does not seem to be a need to add
> the inherited value later; the property maker already has done so. See
> IndentPropertyMaker.compute(PropertyList). It uses
> propertyList.getInherited(baseMaker.propId).getNumeric()) to get the
> inherited value. Earlier FOP developers understood this part well.

I understand, but I think you're talking exclusively about the property
resolution phase (right?) while I found that I need the computed value
of the margin property (not only the explicit one as is currently the
case) and the inherited start-indent for the layout manager code and to
set traits correctly.

> If you find wrong results, then the problem must be elsewhere.

Yes, in the layout managers.

> Is there a book or treatise on these subjects, where we can read how a
> knowledgeable author interprets these difficult parts of the spec?

I don't know. We're probably stuck with the FO-related mailing lists.

Please have patience with me while I'm learning my way into layout. I
can already feel my understanding of the whole thing growing from hour
to hour and I'm grateful for any insight you can provide. I'm sorry for
being a moving target.

It's too bad that the ICLayoutManager is still empty so your examples
above cannot be tested, yet, but I have other examples that help show
similar effects with what already works.

Jeremias Maerki



RE: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-10 Thread Goel, Nitesh
In the region body I am making a table. I want the table header(that
row) to be repeated on subsequent pages. How to do that?

-Original Message-
From: Glen Mazza [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 11, 2005 2:55 AM
To: fop-dev@xml.apache.org
Subject: Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr
TraitSetter.java BlockLayoutManager.java

BTW, would Jeremias' proposal effect future
implementation of the property value functions[1]?

Thanks,
Glen

[1]
http://www.w3.org/TR/2001/REC-xsl-20011015/slice5.html#section-N8624-Pro
perty-Value-Functions

--- Simon Pepping <[EMAIL PROTECTED]> wrote:

> Section 5.3.2 of the spec is really hard to
> understand. I combine it
> with 5.1.4 about Inheritance. Then my guess is this:
> 
> A test file
>   
> A test
> file
>   
> 
> 
> The computed value of start-indent on the outer
> block is 'start-indent
> = inherited_value_of(start-indent) +
> margin-corresponding +
> padding-corresponding + border-corresponding-width'
> = 0 + 1pc + 0 +
> 0. The computed value of start-indent on the inner
> block is
> 'start-indent = inherited_value_of(start-indent) +
> margin-corresponding + padding-corresponding +
> border-corresponding-width' = 1.5pc + 1pc + 0 + 0.
> 
> In this case:
> 
> A test file
>   
> A test
> file
>   
> 
> 
> the computed value of start-indent on the outer
> block is 'start-indent
> = inherited_value_of(start-indent) +
> margin-corresponding +
> padding-corresponding + border-corresponding-width'
> = 0 + 1pc + 0 +
> 0. The computed value of start-indent on the inner
> block is
> 'start-indent = inherited_value_of(start-indent) +
> margin-corresponding + padding-corresponding +
> border-corresponding-width' = 1pc + 1pc + 0 + 0. The
> inherited value
> uses the calculated value (sect. 5.1.4). That is the
> value that should
> be returned by
>
pList.getParentPropertyList().get(Constants.PR_START_INDENT).getLength()
.
> 
> The inherited value should not be stored, but used
> in the computation
> of the property value. This should be implemented by
> the property
> maker.
> 
> When I run the above examples in a debugger, I find
> that the computed
> start-indent values CommonMarginBlock.startIndent
> are exactly like I
> argue above they should be. There does not seem to
> be a need to add
> the inherited value later; the property maker
> already has done so. See
> IndentPropertyMaker.compute(PropertyList). It uses
>
propertyList.getInherited(baseMaker.propId).getNumeric())
> to get the
> inherited value. Earlier FOP developers understood
> this part well.
> 
> If you find wrong results, then the problem must be
> elsewhere.
> 
> Is there a book or treatise on these subjects, where
> we can read how a
> knowledgeable author interprets these difficult
> parts of the spec?
> 
> Regards, Simon
> 
> On Fri, Jan 07, 2005 at 09:26:15AM +0100, Jeremias
> Maerki wrote:
> > Finn or Simon,
> > 
> > would you please check if it is acceptable to put
> the inherited values
> > directly into the CommonMarginBlock? It might have
> been cleaner to
> > always get the value via the parent FO but I think
> in this case it helps
> > simplifying the code in TraitSetter and
> BlockLayoutManager.
> > 
> > On 07.01.2005 09:21:21 jeremias wrote:
> > > jeremias2005/01/07 00:21:21
> > > 
> > >   Modified:   
> src/java/org/apache/fop/fo/properties
> CommonMarginBlock.java
> > >src/java/org/apache/fop/layoutmgr
> TraitSetter.java
> > > BlockLayoutManager.java
> > >   Log:
> > >   Bugfix for start-indent calculation for nested
> blocks. The inherited start-indent wasn't taken into
> account as described in 5.3.2 of the spec.
> > >   Minor style and javadoc improvements on the
> way.
> > 
> > 
> > 
> > >   Revision  ChangesPath
> > >   1.5   +34 -2
>
xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
> > >   
> > >   Index: CommonMarginBlock.java
> > >  
>
===
> > >   RCS file:
>
/home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBloc
k.java,v
> > >   retrieving revision 1.4
> > >   retrieving revision 1.5
> > >   diff -u -r1.4 -r1.5
> > >   --- CommonMarginBlock.java  28 Oct 2004
> 10:00:24 -1.4
> > >   +++ CommonMarginBlock.java  7 Jan 2005 08:21:21
> - 1.5
> > >   @@ -1,5 +1,5 @@
> > > 

Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-10 Thread Glen Mazza
--- Glen Mazza <[EMAIL PROTECTED]> wrote:

> BTW, would Jeremias' proposal 
> effect future
  ^^

oopsaffect ;)

Glen



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-10 Thread Glen Mazza
BTW, would Jeremias' proposal effect future
implementation of the property value functions[1]?

Thanks,
Glen

[1]
http://www.w3.org/TR/2001/REC-xsl-20011015/slice5.html#section-N8624-Property-Value-Functions

--- Simon Pepping <[EMAIL PROTECTED]> wrote:

> Section 5.3.2 of the spec is really hard to
> understand. I combine it
> with 5.1.4 about Inheritance. Then my guess is this:
> 
> A test file
>   
> A test
> file
>   
> 
> 
> The computed value of start-indent on the outer
> block is 'start-indent
> = inherited_value_of(start-indent) +
> margin-corresponding +
> padding-corresponding + border-corresponding-width'
> = 0 + 1pc + 0 +
> 0. The computed value of start-indent on the inner
> block is
> 'start-indent = inherited_value_of(start-indent) +
> margin-corresponding + padding-corresponding +
> border-corresponding-width' = 1.5pc + 1pc + 0 + 0.
> 
> In this case:
> 
> A test file
>   
> A test
> file
>   
> 
> 
> the computed value of start-indent on the outer
> block is 'start-indent
> = inherited_value_of(start-indent) +
> margin-corresponding +
> padding-corresponding + border-corresponding-width'
> = 0 + 1pc + 0 +
> 0. The computed value of start-indent on the inner
> block is
> 'start-indent = inherited_value_of(start-indent) +
> margin-corresponding + padding-corresponding +
> border-corresponding-width' = 1pc + 1pc + 0 + 0. The
> inherited value
> uses the calculated value (sect. 5.1.4). That is the
> value that should
> be returned by
>
pList.getParentPropertyList().get(Constants.PR_START_INDENT).getLength().
> 
> The inherited value should not be stored, but used
> in the computation
> of the property value. This should be implemented by
> the property
> maker.
> 
> When I run the above examples in a debugger, I find
> that the computed
> start-indent values CommonMarginBlock.startIndent
> are exactly like I
> argue above they should be. There does not seem to
> be a need to add
> the inherited value later; the property maker
> already has done so. See
> IndentPropertyMaker.compute(PropertyList). It uses
>
propertyList.getInherited(baseMaker.propId).getNumeric())
> to get the
> inherited value. Earlier FOP developers understood
> this part well.
> 
> If you find wrong results, then the problem must be
> elsewhere.
> 
> Is there a book or treatise on these subjects, where
> we can read how a
> knowledgeable author interprets these difficult
> parts of the spec?
> 
> Regards, Simon
> 
> On Fri, Jan 07, 2005 at 09:26:15AM +0100, Jeremias
> Maerki wrote:
> > Finn or Simon,
> > 
> > would you please check if it is acceptable to put
> the inherited values
> > directly into the CommonMarginBlock? It might have
> been cleaner to
> > always get the value via the parent FO but I think
> in this case it helps
> > simplifying the code in TraitSetter and
> BlockLayoutManager.
> > 
> > On 07.01.2005 09:21:21 jeremias wrote:
> > > jeremias2005/01/07 00:21:21
> > > 
> > >   Modified:   
> src/java/org/apache/fop/fo/properties
> CommonMarginBlock.java
> > >src/java/org/apache/fop/layoutmgr
> TraitSetter.java
> > > BlockLayoutManager.java
> > >   Log:
> > >   Bugfix for start-indent calculation for nested
> blocks. The inherited start-indent wasn't taken into
> account as described in 5.3.2 of the spec.
> > >   Minor style and javadoc improvements on the
> way.
> > 
> > 
> > 
> > >   Revision  ChangesPath
> > >   1.5   +34 -2
>
xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
> > >   
> > >   Index: CommonMarginBlock.java
> > >  
>
===
> > >   RCS file:
>
/home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java,v
> > >   retrieving revision 1.4
> > >   retrieving revision 1.5
> > >   diff -u -r1.4 -r1.5
> > >   --- CommonMarginBlock.java  28 Oct 2004
> 10:00:24 -1.4
> > >   +++ CommonMarginBlock.java  7 Jan 2005 08:21:21
> - 1.5
> > >   @@ -1,5 +1,5 @@
> > >/*
> > >   - * Copyright 1999-2004 The Apache Software
> Foundation.
> > >   + * Copyright 1999-2005 The Apache Software
> Foundation.
> > > * 
> > > * Licensed under the Apache License, Version
> 2.0 (the "License");
> > > * you may not use this file except in
> compliance with the License.
> > >   @@ -70,6 +70,16 @@
> > >public Length endIndent;
> > >
> > >/**
> > >   + * The inherited "start-indent" property.
> > >   + */
> > >   +public Length inheritedStartIndent;
> > >   +
> > >   +/**
> > >   + * The inherited "end-indent" property.
> > >   + */
> > >   +public Length inheritedEndIndent;
> > >   +
> > >   +/**
> > > * Create a CommonMarginBlock object.
> > > * @param pList The PropertyList with
> propery values.
> > > */
> > >   @@ -84,5 +94,27 @@
> > >
> > >startIndent =
> pList.get(Constants.PR_START_INDENT).getLength();
> > >endIndent =
> 

Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-10 Thread Simon Pepping
Section 5.3.2 of the spec is really hard to understand. I combine it
with 5.1.4 about Inheritance. Then my guess is this:

A test file
  
A test file
  


The computed value of start-indent on the outer block is 'start-indent
= inherited_value_of(start-indent) + margin-corresponding +
padding-corresponding + border-corresponding-width' = 0 + 1pc + 0 +
0. The computed value of start-indent on the inner block is
'start-indent = inherited_value_of(start-indent) +
margin-corresponding + padding-corresponding +
border-corresponding-width' = 1.5pc + 1pc + 0 + 0.

In this case:

A test file
  
A test file
  


the computed value of start-indent on the outer block is 'start-indent
= inherited_value_of(start-indent) + margin-corresponding +
padding-corresponding + border-corresponding-width' = 0 + 1pc + 0 +
0. The computed value of start-indent on the inner block is
'start-indent = inherited_value_of(start-indent) +
margin-corresponding + padding-corresponding +
border-corresponding-width' = 1pc + 1pc + 0 + 0. The inherited value
uses the calculated value (sect. 5.1.4). That is the value that should
be returned by
pList.getParentPropertyList().get(Constants.PR_START_INDENT).getLength().

The inherited value should not be stored, but used in the computation
of the property value. This should be implemented by the property
maker.

When I run the above examples in a debugger, I find that the computed
start-indent values CommonMarginBlock.startIndent are exactly like I
argue above they should be. There does not seem to be a need to add
the inherited value later; the property maker already has done so. See
IndentPropertyMaker.compute(PropertyList). It uses
propertyList.getInherited(baseMaker.propId).getNumeric()) to get the
inherited value. Earlier FOP developers understood this part well.

If you find wrong results, then the problem must be elsewhere.

Is there a book or treatise on these subjects, where we can read how a
knowledgeable author interprets these difficult parts of the spec?

Regards, Simon

On Fri, Jan 07, 2005 at 09:26:15AM +0100, Jeremias Maerki wrote:
> Finn or Simon,
> 
> would you please check if it is acceptable to put the inherited values
> directly into the CommonMarginBlock? It might have been cleaner to
> always get the value via the parent FO but I think in this case it helps
> simplifying the code in TraitSetter and BlockLayoutManager.
> 
> On 07.01.2005 09:21:21 jeremias wrote:
> > jeremias2005/01/07 00:21:21
> > 
> >   Modified:src/java/org/apache/fop/fo/properties CommonMarginBlock.java
> >src/java/org/apache/fop/layoutmgr TraitSetter.java
> > BlockLayoutManager.java
> >   Log:
> >   Bugfix for start-indent calculation for nested blocks. The inherited 
> > start-indent wasn't taken into account as described in 5.3.2 of the spec.
> >   Minor style and javadoc improvements on the way.
> 
> 
> 
> >   Revision  ChangesPath
> >   1.5   +34 -2 
> > xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
> >   
> >   Index: CommonMarginBlock.java
> >   ===
> >   RCS file: 
> > /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java,v
> >   retrieving revision 1.4
> >   retrieving revision 1.5
> >   diff -u -r1.4 -r1.5
> >   --- CommonMarginBlock.java28 Oct 2004 10:00:24 -  1.4
> >   +++ CommonMarginBlock.java7 Jan 2005 08:21:21 -   1.5
> >   @@ -1,5 +1,5 @@
> >/*
> >   - * Copyright 1999-2004 The Apache Software Foundation.
> >   + * Copyright 1999-2005 The Apache Software Foundation.
> > * 
> > * Licensed under the Apache License, Version 2.0 (the "License");
> > * you may not use this file except in compliance with the License.
> >   @@ -70,6 +70,16 @@
> >public Length endIndent;
> >
> >/**
> >   + * The inherited "start-indent" property.
> >   + */
> >   +public Length inheritedStartIndent;
> >   +
> >   +/**
> >   + * The inherited "end-indent" property.
> >   + */
> >   +public Length inheritedEndIndent;
> >   +
> >   +/**
> > * Create a CommonMarginBlock object.
> > * @param pList The PropertyList with propery values.
> > */
> >   @@ -84,5 +94,27 @@
> >
> >startIndent = pList.get(Constants.PR_START_INDENT).getLength();
> >endIndent = pList.get(Constants.PR_END_INDENT).getLength();
> >   +
> >   +if (!pList.getFObj().generatesReferenceAreas()) {
> >   +inheritedStartIndent = pList.getParentPropertyList()
> >   +.get(Constants.PR_START_INDENT).getLength();
> >   +inheritedEndIndent = pList.getParentPropertyList()
> >   +.get(Constants.PR_END_INDENT).getLength();
> >   +}
> >   +}
> 
> 
> 
> 
> 
> Jeremias Maerki
> 

-- 
Simon Pepping
home page: http://www.leverkruid.nl



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-07 Thread Jeremias Maerki

On 07.01.2005 10:49:02 Finn Bock wrote:
> [Jeremias]
> 
> > would you please check if it is acceptable to put the inherited values
> > directly into the CommonMarginBlock? It might have been cleaner to
> > always get the value via the parent FO but I think in this case it helps
> > simplifying the code in TraitSetter and BlockLayoutManager.
> 
> It looks wrong, it feels wrong, but I'm not at all sure if it is wrong.

Same here. :-)

> But I would be tempted to drop the use of space-[start,end] traits and 
> instead let the renderers use [start,end]-indent traits and the 
> reference rectangle to calculate the start position of the content 
> rectangle.
>
> Alternatively calculate space-[start,end] based on the 
> [start,end]-indent traits on the parent area rather then the parent fo.

I'll see what I can do. I got a great environment to test now. ;-)
Thanks for your insight.

Jeremias Maerki



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-07 Thread Finn Bock
[Jeremias]
would you please check if it is acceptable to put the inherited values
directly into the CommonMarginBlock? It might have been cleaner to
always get the value via the parent FO but I think in this case it helps
simplifying the code in TraitSetter and BlockLayoutManager.
It looks wrong, it feels wrong, but I'm not at all sure if it is wrong.
But I would be tempted to drop the use of space-[start,end] traits and 
instead let the renderers use [start,end]-indent traits and the 
reference rectangle to calculate the start position of the content 
rectangle.

Alternatively calculate space-[start,end] based on the 
[start,end]-indent traits on the parent area rather then the parent fo.

regards,
finn


Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr TraitSetter.java BlockLayoutManager.java

2005-01-07 Thread Jeremias Maerki
Finn or Simon,

would you please check if it is acceptable to put the inherited values
directly into the CommonMarginBlock? It might have been cleaner to
always get the value via the parent FO but I think in this case it helps
simplifying the code in TraitSetter and BlockLayoutManager.

On 07.01.2005 09:21:21 jeremias wrote:
> jeremias2005/01/07 00:21:21
> 
>   Modified:src/java/org/apache/fop/fo/properties CommonMarginBlock.java
>src/java/org/apache/fop/layoutmgr TraitSetter.java
> BlockLayoutManager.java
>   Log:
>   Bugfix for start-indent calculation for nested blocks. The inherited 
> start-indent wasn't taken into account as described in 5.3.2 of the spec.
>   Minor style and javadoc improvements on the way.



>   Revision  ChangesPath
>   1.5   +34 -2 
> xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
>   
>   Index: CommonMarginBlock.java
>   ===
>   RCS file: 
> /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- CommonMarginBlock.java  28 Oct 2004 10:00:24 -  1.4
>   +++ CommonMarginBlock.java  7 Jan 2005 08:21:21 -   1.5
>   @@ -1,5 +1,5 @@
>/*
>   - * Copyright 1999-2004 The Apache Software Foundation.
>   + * Copyright 1999-2005 The Apache Software Foundation.
> * 
> * Licensed under the Apache License, Version 2.0 (the "License");
> * you may not use this file except in compliance with the License.
>   @@ -70,6 +70,16 @@
>public Length endIndent;
>
>/**
>   + * The inherited "start-indent" property.
>   + */
>   +public Length inheritedStartIndent;
>   +
>   +/**
>   + * The inherited "end-indent" property.
>   + */
>   +public Length inheritedEndIndent;
>   +
>   +/**
> * Create a CommonMarginBlock object.
> * @param pList The PropertyList with propery values.
> */
>   @@ -84,5 +94,27 @@
>
>startIndent = pList.get(Constants.PR_START_INDENT).getLength();
>endIndent = pList.get(Constants.PR_END_INDENT).getLength();
>   +
>   +if (!pList.getFObj().generatesReferenceAreas()) {
>   +inheritedStartIndent = pList.getParentPropertyList()
>   +.get(Constants.PR_START_INDENT).getLength();
>   +inheritedEndIndent = pList.getParentPropertyList()
>   +.get(Constants.PR_END_INDENT).getLength();
>   +}
>   +}





Jeremias Maerki