Parcourir la source

Merged revisions 654563,654600,654654 via svnmerge from

https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r654563 | pietsch | 2008-05-08 16:53:23 +0100 (Thu, 08 May 2008) | 1 line
  
  Fix validation errors
........
  r654600 | vhennebert | 2008-05-08 20:29:55 +0100 (Thu, 08 May 2008) | 2 lines
  
  In collapsed borders, the 'nonLeadingTrailing' case actually corresponds to the usual, 'normal' case, when no break occurs in the table. Renamed fields and parameters accordingly for readability and simplicity
........
  r654654 | adelmelle | 2008-05-09 00:46:45 +0100 (Fri, 09 May 2008) | 1 line
  
  Quick-fix to avoid creating unnecessarily large ArrayLists when adding inline ids to the page
........


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@654753 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Adrian Cumiskey il y a 16 ans
Parent
révision
d972250786

+ 6
- 2
src/java/org/apache/fop/area/IDTracker.java Voir le fichier

tryIDResolution(id, pv, pvList); tryIDResolution(id, pv, pvList);
} }
} else { } else {
pvList.add(pv);
/* TODO: The check is a quick-fix to avoid a waste
* when adding inline-ids to the page */
if (!pvList.contains(pv)) {
pvList.add(pv);
}
} }
} }


* *
* @param id ID to resolve * @param id ID to resolve
* @param pv page viewport whose ID refs to resolve * @param pv page viewport whose ID refs to resolve
* @param List of PageViewports
* @param pvList of PageViewports
*/ */
private void tryIDResolution(String id, PageViewport pv, List pvList) { private void tryIDResolution(String id, PageViewport pv, List pvList) {
Set todo = (Set) unresolvedIDRefs.get(id); Set todo = (Set) unresolvedIDRefs.get(id);

+ 34
- 35
src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java Voir le fichier

* *
* @param row the first row of the table (in the header, or in the body if the * @param row the first row of the table (in the header, or in the body if the
* table has no header) * table has no header)
* @param withNormal
* @param withLeadingTrailing * @param withLeadingTrailing
* @param withNonLeadingTrailing
* @param withRest * @param withRest
*/ */
void resolveBordersFirstRowInTable(List/*<GridUnit>*/ row, boolean withLeadingTrailing,
boolean withNonLeadingTrailing, boolean withRest) {
void resolveBordersFirstRowInTable(List/*<GridUnit>*/ row, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
assert firstInTable; assert firstInTable;
for (int i = 0; i < row.size(); i++) { for (int i = 0; i < row.size(); i++) {
TableColumn column = table.getColumn(i); TableColumn column = table.getColumn(i);
((GridUnit) row.get(i)).integrateBorderSegment( ((GridUnit) row.get(i)).integrateBorderSegment(
CommonBorderPaddingBackground.BEFORE, column, withLeadingTrailing,
withNonLeadingTrailing, withRest);
CommonBorderPaddingBackground.BEFORE, column, withNormal,
withLeadingTrailing, withRest);
} }
firstInTable = false; firstInTable = false;
} }
} }


/** Integrates the border-after of the part. */ /** Integrates the border-after of the part. */
void resolveBordersLastRowInPart(List/*<GridUnit>*/ row, boolean withLeadingTrailing,
boolean withNonLeadingTrailing, boolean withRest) {
void resolveBordersLastRowInPart(List/*<GridUnit>*/ row, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
for (int i = 0; i < row.size(); i++) { for (int i = 0; i < row.size(); i++) {
((GridUnit) row.get(i)).integrateBorderSegment(CommonBorderPaddingBackground.AFTER, ((GridUnit) row.get(i)).integrateBorderSegment(CommonBorderPaddingBackground.AFTER,
tablePart, withLeadingTrailing, withNonLeadingTrailing, withRest);
tablePart, withNormal, withLeadingTrailing, withRest);
} }
} }


* *
* @param row the last row of the footer, or of the last body if the table has no * @param row the last row of the footer, or of the last body if the table has no
* footer * footer
* @param withNormal
* @param withLeadingTrailing * @param withLeadingTrailing
* @param withNonLeadingTrailing
* @param withRest * @param withRest
*/ */
void resolveBordersLastRowInTable(List/*<GridUnit>*/ row, boolean withLeadingTrailing,
boolean withNonLeadingTrailing, boolean withRest) {
void resolveBordersLastRowInTable(List/*<GridUnit>*/ row, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
for (int i = 0; i < row.size(); i++) { for (int i = 0; i < row.size(); i++) {
TableColumn column = table.getColumn(i); TableColumn column = table.getColumn(i);
((GridUnit) row.get(i)).integrateBorderSegment(CommonBorderPaddingBackground.AFTER, ((GridUnit) row.get(i)).integrateBorderSegment(CommonBorderPaddingBackground.AFTER,
column, withLeadingTrailing, withNonLeadingTrailing, withRest);
column, withNormal, withLeadingTrailing, withRest);
} }
} }


GridUnit gu = (GridUnit) row.get(i); GridUnit gu = (GridUnit) row.get(i);
ConditionalBorder border = (ConditionalBorder) leadingBorders.get(i); ConditionalBorder border = (ConditionalBorder) leadingBorders.get(i);
gu.integrateCompetingBorder(CommonBorderPaddingBackground.BEFORE, border, gu.integrateCompetingBorder(CommonBorderPaddingBackground.BEFORE, border,
true, false, true);
false, true, true);
} }
} }


GridUnit gu = (GridUnit) row.get(i); GridUnit gu = (GridUnit) row.get(i);
ConditionalBorder border = (ConditionalBorder) trailingBorders.get(i); ConditionalBorder border = (ConditionalBorder) trailingBorders.get(i);
gu.integrateCompetingBorder(CommonBorderPaddingBackground.AFTER, border, gu.integrateCompetingBorder(CommonBorderPaddingBackground.AFTER, border,
true, false, true);
false, true, true);
} }
} }


* The two only sensible values for border-before on the header's first row are: * The two only sensible values for border-before on the header's first row are:
* - at the beginning of the table (normal case) * - at the beginning of the table (normal case)
* - if the header is repeated after each page break * - if the header is repeated after each page break
* To represent those values we (ab)use the nonLeadingTrailing and the rest
* fields of ConditionalBorder. But strictly speaking this is not their
* purposes.
* To represent those values we (ab)use the normal and the rest fields of
* ConditionalBorder. But strictly speaking this is not their purposes.
*/ */
for (Iterator guIter = row.iterator(); guIter.hasNext();) { for (Iterator guIter = row.iterator(); guIter.hasNext();) {
ConditionalBorder borderBefore = ((GridUnit) guIter.next()).borderBefore; ConditionalBorder borderBefore = ((GridUnit) guIter.next()).borderBefore;
borderBefore.leadingTrailing = borderBefore.nonLeadingTrailing;
borderBefore.rest = borderBefore.nonLeadingTrailing;
borderBefore.leadingTrailing = borderBefore.normal;
borderBefore.rest = borderBefore.normal;
} }
resolveBordersFirstRowInTable(row, false, true, true);
resolveBordersFirstRowInTable(row, true, false, true);
} }
previousRow = row; previousRow = row;
} }
* The border-after of a header is always the same. Leading and rest don't * The border-after of a header is always the same. Leading and rest don't
* apply to cells in the header since they are never broken. To ease * apply to cells in the header since they are never broken. To ease
* resolution we override the (normally unused) leadingTrailing and rest * resolution we override the (normally unused) leadingTrailing and rest
* fields of ConditionalBorder with the only sensible nonLeadingTrailing
* field. That way grid units from the body will always resolve against the
* same, normal header border.
* fields of ConditionalBorder with the only sensible normal field. That way
* grid units from the body will always resolve against the same, normal
* header border.
*/ */
for (Iterator guIter = previousRow.iterator(); guIter.hasNext();) { for (Iterator guIter = previousRow.iterator(); guIter.hasNext();) {
ConditionalBorder borderAfter = ((GridUnit) guIter.next()).borderAfter; ConditionalBorder borderAfter = ((GridUnit) guIter.next()).borderAfter;
borderAfter.leadingTrailing = borderAfter.nonLeadingTrailing;
borderAfter.rest = borderAfter.nonLeadingTrailing;
borderAfter.leadingTrailing = borderAfter.normal;
borderAfter.rest = borderAfter.normal;
leadingBorders.add(borderAfter); leadingBorders.add(borderAfter);
} }
/* TODO Temporary hack for resolved borders in header */ /* TODO Temporary hack for resolved borders in header */
// See same method in ResolverInHeader for an explanation of the hack // See same method in ResolverInHeader for an explanation of the hack
for (Iterator guIter = footerFirstRow.iterator(); guIter.hasNext();) { for (Iterator guIter = footerFirstRow.iterator(); guIter.hasNext();) {
ConditionalBorder borderBefore = ((GridUnit) guIter.next()).borderBefore; ConditionalBorder borderBefore = ((GridUnit) guIter.next()).borderBefore;
borderBefore.leadingTrailing = borderBefore.nonLeadingTrailing;
borderBefore.rest = borderBefore.nonLeadingTrailing;
borderBefore.leadingTrailing = borderBefore.normal;
borderBefore.rest = borderBefore.normal;
trailingBorders.add(borderBefore); trailingBorders.add(borderBefore);
} }
} }
// See endRow method in ResolverInHeader for an explanation of the hack // See endRow method in ResolverInHeader for an explanation of the hack
for (Iterator guIter = footerLastRow.iterator(); guIter.hasNext();) { for (Iterator guIter = footerLastRow.iterator(); guIter.hasNext();) {
ConditionalBorder borderAfter = ((GridUnit) guIter.next()).borderAfter; ConditionalBorder borderAfter = ((GridUnit) guIter.next()).borderAfter;
borderAfter.leadingTrailing = borderAfter.nonLeadingTrailing;
borderAfter.rest = borderAfter.nonLeadingTrailing;
borderAfter.leadingTrailing = borderAfter.normal;
borderAfter.rest = borderAfter.normal;
} }
resolveBordersLastRowInTable(footerLastRow, false, true, true);
resolveBordersLastRowInTable(footerLastRow, true, false, true);
} }
} }


firstInBody = false; firstInBody = false;
for (Iterator iter = row.iterator(); iter.hasNext();) { for (Iterator iter = row.iterator(); iter.hasNext();) {
GridUnit gu = (GridUnit) iter.next(); GridUnit gu = (GridUnit) iter.next();
gu.borderBefore.leadingTrailing = gu.borderBefore.nonLeadingTrailing;
gu.borderBefore.leadingTrailing = gu.borderBefore.normal;
} }
} }
} }
resolverInFooter.endTable(); resolverInFooter.endTable();
} else { } else {
// Trailing and rest borders already resolved with integrateTrailingBorders // Trailing and rest borders already resolved with integrateTrailingBorders
resolveBordersLastRowInTable(previousRow, false, true, false);
resolveBordersLastRowInTable(previousRow, true, false, false);
} }
for (Iterator iter = previousRow.iterator(); iter.hasNext();) { for (Iterator iter = previousRow.iterator(); iter.hasNext();) {
GridUnit gu = (GridUnit) iter.next(); GridUnit gu = (GridUnit) iter.next();
gu.borderAfter.leadingTrailing = gu.borderAfter.nonLeadingTrailing;
gu.borderAfter.leadingTrailing = gu.borderAfter.normal;
} }
} }
} }
if (headerLastRow != null) { if (headerLastRow != null) {
for (Iterator iter = headerLastRow.iterator(); iter.hasNext();) { for (Iterator iter = headerLastRow.iterator(); iter.hasNext();) {
GridUnit gu = (GridUnit) iter.next(); GridUnit gu = (GridUnit) iter.next();
gu.borderAfter.leadingTrailing = gu.borderAfter.nonLeadingTrailing;
gu.borderAfter.leadingTrailing = gu.borderAfter.normal;
} }
} }
if (footerLastRow != null) { if (footerLastRow != null) {
for (Iterator iter = footerLastRow.iterator(); iter.hasNext();) { for (Iterator iter = footerLastRow.iterator(); iter.hasNext();) {
GridUnit gu = (GridUnit) iter.next(); GridUnit gu = (GridUnit) iter.next();
gu.borderAfter.leadingTrailing = gu.borderAfter.nonLeadingTrailing;
gu.borderAfter.leadingTrailing = gu.borderAfter.normal;
} }
} }
/* End of temporary hack */ /* End of temporary hack */

+ 38
- 41
src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java Voir le fichier

* in the collapsing model. These three values are (for border-before, similar for * in the collapsing model. These three values are (for border-before, similar for
* border-after): * border-after):
* <ul> * <ul>
* <li>non-leading: common case, when a cell follows the cell before on a same page;</li>
* <li>normal: common case, when a cell follows the cell before on a same page;</li>
* <li>leading: when the table is broken and the cell appears at the top of a page, in * <li>leading: when the table is broken and the cell appears at the top of a page, in
* which case its border must be resolved with the header (or the top of the table) * which case its border must be resolved with the header (or the top of the table)
* instead of with the previous cell;</li> * instead of with the previous cell;</li>


public static final int REST = 2; public static final int REST = 2;


/** Normal case, no break. */
BorderSpecification normal;

/** Special case: the cell is at the top or the bottom of the page. */ /** Special case: the cell is at the top or the bottom of the page. */
BorderSpecification leadingTrailing; BorderSpecification leadingTrailing;


/** Normal case, no break. */
BorderSpecification nonLeadingTrailing;

/** Special case: break inside the cell. */ /** Special case: break inside the cell. */
BorderSpecification rest; BorderSpecification rest;


/** The model used to resolve borders. */ /** The model used to resolve borders. */
private CollapsingBorderModel collapsingBorderModel; private CollapsingBorderModel collapsingBorderModel;


private ConditionalBorder(BorderSpecification leadingTrailing,
BorderSpecification nonLeadingTrailing, BorderSpecification rest,
private ConditionalBorder(BorderSpecification normal,
BorderSpecification leadingTrailing, BorderSpecification rest,
CollapsingBorderModel collapsingBorderModel) { CollapsingBorderModel collapsingBorderModel) {
this.normal = normal;
this.leadingTrailing = leadingTrailing; this.leadingTrailing = leadingTrailing;
this.nonLeadingTrailing = nonLeadingTrailing;
this.rest = rest; this.rest = rest;
this.collapsingBorderModel = collapsingBorderModel; this.collapsingBorderModel = collapsingBorderModel;
} }
*/ */
ConditionalBorder(BorderSpecification borderSpecification, ConditionalBorder(BorderSpecification borderSpecification,
CollapsingBorderModel collapsingBorderModel) { CollapsingBorderModel collapsingBorderModel) {
leadingTrailing = borderSpecification;
nonLeadingTrailing = leadingTrailing;
normal = borderSpecification;
leadingTrailing = normal;
if (borderSpecification.getBorderInfo().getWidth().isDiscard()) { if (borderSpecification.getBorderInfo().getWidth().isDiscard()) {
rest = BorderSpecification.getDefaultBorder(); rest = BorderSpecification.getDefaultBorder();
} else { } else {
* Resolves and updates the relevant parts of this border as well as the given one. * Resolves and updates the relevant parts of this border as well as the given one.
* *
* @param competitor * @param competitor
* @param withNormal
* @param withLeadingTrailing * @param withLeadingTrailing
* @param withNonLeadingTrailing
* @param withRest * @param withRest
*/ */
void resolve(ConditionalBorder competitor, boolean withLeadingTrailing,
boolean withNonLeadingTrailing, boolean withRest) {
if (withLeadingTrailing) {
void resolve(ConditionalBorder competitor, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
if (withNormal) {
BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner( BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner(
leadingTrailing, competitor.leadingTrailing);
normal, competitor.normal);
if (resolvedBorder != null) { if (resolvedBorder != null) {
leadingTrailing = resolvedBorder;
competitor.leadingTrailing = resolvedBorder;
normal = resolvedBorder;
competitor.normal = resolvedBorder;
} }
} }
if (withNonLeadingTrailing) {
if (withLeadingTrailing) {
BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner( BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner(
nonLeadingTrailing, competitor.nonLeadingTrailing);
leadingTrailing, competitor.leadingTrailing);
if (resolvedBorder != null) { if (resolvedBorder != null) {
nonLeadingTrailing = resolvedBorder;
competitor.nonLeadingTrailing = resolvedBorder;
leadingTrailing = resolvedBorder;
competitor.leadingTrailing = resolvedBorder;
} }
} }
if (withRest) { if (withRest) {
* keeping the components to their old values. * keeping the components to their old values.
* *
* @param competitor * @param competitor
* @param withNormal
* @param withLeadingTrailing * @param withLeadingTrailing
* @param withNonLeadingTrailing
* @param withRest * @param withRest
*/ */
void integrateCompetingSegment(ConditionalBorder competitor, boolean withLeadingTrailing,
boolean withNonLeadingTrailing, boolean withRest) {
if (withLeadingTrailing) {
void integrateCompetingSegment(ConditionalBorder competitor, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
if (withNormal) {
BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner( BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner(
leadingTrailing, competitor.leadingTrailing);
normal, competitor.normal);
if (resolvedBorder != null) { if (resolvedBorder != null) {
leadingTrailing = resolvedBorder;
normal = resolvedBorder;
} }
} }
if (withNonLeadingTrailing) {
if (withLeadingTrailing) {
BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner( BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner(
nonLeadingTrailing, competitor.nonLeadingTrailing);
leadingTrailing, competitor.leadingTrailing);
if (resolvedBorder != null) { if (resolvedBorder != null) {
nonLeadingTrailing = resolvedBorder;
leadingTrailing = resolvedBorder;
} }
} }
if (withRest) { if (withRest) {
* CollapsingBorderModel is not expected to return null. * CollapsingBorderModel is not expected to return null.
* *
* @param segment * @param segment
* @param withNormal
* @param withLeadingTrailing * @param withLeadingTrailing
* @param withNonLeadingTrailing
* @param withRest * @param withRest
*/ */
void integrateSegment(ConditionalBorder segment, boolean withLeadingTrailing,
boolean withNonLeadingTrailing, boolean withRest) {
void integrateSegment(ConditionalBorder segment, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
if (withNormal) {
normal = collapsingBorderModel.determineWinner(normal, segment.normal);
assert normal != null;
}
if (withLeadingTrailing) { if (withLeadingTrailing) {
leadingTrailing = collapsingBorderModel.determineWinner(leadingTrailing, leadingTrailing = collapsingBorderModel.determineWinner(leadingTrailing,
segment.leadingTrailing); segment.leadingTrailing);
assert leadingTrailing != null; assert leadingTrailing != null;
} }
if (withNonLeadingTrailing) {
nonLeadingTrailing = collapsingBorderModel.determineWinner(nonLeadingTrailing,
segment.nonLeadingTrailing);
assert nonLeadingTrailing != null;
}
if (withRest) { if (withRest) {
rest = collapsingBorderModel.determineWinner(rest, segment.rest); rest = collapsingBorderModel.determineWinner(rest, segment.rest);
assert rest != null; assert rest != null;
* @return a copy of this border * @return a copy of this border
*/ */
ConditionalBorder copy() { ConditionalBorder copy() {
return new ConditionalBorder(leadingTrailing, nonLeadingTrailing, rest,
collapsingBorderModel);
return new ConditionalBorder(normal, leadingTrailing, rest, collapsingBorderModel);
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
public String toString() { public String toString() {
return "{non-leading: " + nonLeadingTrailing + ", leading: " + leadingTrailing + ", rest: "
+ rest + "}";
return "{normal: " + normal + ", leading: " + leadingTrailing + ", rest: " + rest + "}";
} }


/** /**

+ 17
- 17
src/java/org/apache/fop/fo/flow/table/GridUnit.java Voir le fichier

protected void setBordersFromCell() { protected void setBordersFromCell() {
borderBefore = cell.borderBefore.copy(); borderBefore = cell.borderBefore.copy();
if (rowSpanIndex > 0) { if (rowSpanIndex > 0) {
borderBefore.nonLeadingTrailing = BorderSpecification.getDefaultBorder();
borderBefore.normal = BorderSpecification.getDefaultBorder();
} }
borderAfter = cell.borderAfter.copy(); borderAfter = cell.borderAfter.copy();
if (!isLastGridUnitRowSpan()) { if (!isLastGridUnitRowSpan()) {
borderAfter.nonLeadingTrailing = BorderSpecification.getDefaultBorder();
borderAfter.normal = BorderSpecification.getDefaultBorder();
} }
if (colSpanIndex == 0) { if (colSpanIndex == 0) {
borderStart = cell.borderStart; borderStart = cell.borderStart;
public BorderInfo getBorderBefore(int which) { public BorderInfo getBorderBefore(int which) {
switch (which) { switch (which) {
case ConditionalBorder.NORMAL: case ConditionalBorder.NORMAL:
return borderBefore.nonLeadingTrailing.getBorderInfo();
return borderBefore.normal.getBorderInfo();
case ConditionalBorder.LEADING_TRAILING: case ConditionalBorder.LEADING_TRAILING:
return borderBefore.leadingTrailing.getBorderInfo(); return borderBefore.leadingTrailing.getBorderInfo();
case ConditionalBorder.REST: case ConditionalBorder.REST:
public BorderInfo getBorderAfter(int which) { public BorderInfo getBorderAfter(int which) {
switch (which) { switch (which) {
case ConditionalBorder.NORMAL: case ConditionalBorder.NORMAL:
return borderAfter.nonLeadingTrailing.getBorderInfo();
return borderAfter.normal.getBorderInfo();
case ConditionalBorder.LEADING_TRAILING: case ConditionalBorder.LEADING_TRAILING:
return borderAfter.leadingTrailing.getBorderInfo(); return borderAfter.leadingTrailing.getBorderInfo();
case ConditionalBorder.REST: case ConditionalBorder.REST:
void resolveBorder(GridUnit other, int side) { void resolveBorder(GridUnit other, int side) {
switch (side) { switch (side) {
case CommonBorderPaddingBackground.BEFORE: case CommonBorderPaddingBackground.BEFORE:
borderBefore.resolve(other.borderAfter, false, true, false);
borderBefore.resolve(other.borderAfter, true, false, false);
break; break;
case CommonBorderPaddingBackground.AFTER: case CommonBorderPaddingBackground.AFTER:
borderAfter.resolve(other.borderBefore, false, true, false);
borderAfter.resolve(other.borderBefore, true, false, false);
break; break;
case CommonBorderPaddingBackground.START: case CommonBorderPaddingBackground.START:
BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner( BorderSpecification resolvedBorder = collapsingBorderModel.determineWinner(
* @param parent a table element whose corresponding border coincides on the given * @param parent a table element whose corresponding border coincides on the given
* side * side
*/ */
void integrateBorderSegment(int side, TableFObj parent, boolean withLeadingTrailing,
boolean withNonLeadingTrailing, boolean withRest) {
void integrateBorderSegment(int side, TableFObj parent, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
switch (side) { switch (side) {
case CommonBorderPaddingBackground.BEFORE: case CommonBorderPaddingBackground.BEFORE:
borderBefore.integrateSegment(parent.borderBefore, withLeadingTrailing,
withNonLeadingTrailing, withRest);
borderBefore.integrateSegment(parent.borderBefore, withNormal,
withLeadingTrailing, withRest);
break; break;
case CommonBorderPaddingBackground.AFTER: case CommonBorderPaddingBackground.AFTER:
borderAfter.integrateSegment(parent.borderAfter, withLeadingTrailing,
withNonLeadingTrailing, withRest);
borderAfter.integrateSegment(parent.borderAfter, withNormal,
withLeadingTrailing, withRest);
break; break;
default: assert false; default: assert false;
} }
} }


void integrateCompetingBorder(int side, ConditionalBorder competitor, void integrateCompetingBorder(int side, ConditionalBorder competitor,
boolean withLeadingTrailing, boolean withNonLeadingTrailing, boolean withRest) {
boolean withNormal, boolean withLeadingTrailing, boolean withRest) {
switch (side) { switch (side) {
case CommonBorderPaddingBackground.BEFORE: case CommonBorderPaddingBackground.BEFORE:
borderBefore.integrateCompetingSegment(competitor, withLeadingTrailing,
withNonLeadingTrailing, withRest);
borderBefore.integrateCompetingSegment(competitor, withNormal,
withLeadingTrailing, withRest);
break; break;
case CommonBorderPaddingBackground.AFTER: case CommonBorderPaddingBackground.AFTER:
borderAfter.integrateCompetingSegment(competitor, withLeadingTrailing,
withNonLeadingTrailing, withRest);
borderAfter.integrateCompetingSegment(competitor, withNormal,
withLeadingTrailing, withRest);
break; break;
default: assert false; default: assert false;
} }

+ 64
- 64
test/bugtests.xml Voir le fichier

<testsuite profile="Basic Conformance Tests"> <testsuite profile="Basic Conformance Tests">
<testcases profile="Characters"> <testcases profile="Characters">
<testcases profile="sizes" > <testcases profile="sizes" >
<test id="1" interaction="none" fo="block" xml="xml/bugtests/charwidth.fo" xsl="xsl/copy.xsl" level="basic">
<test id="cog1" interaction="none" fo="block" xml="xml/bugtests/charwidth.fo" xsl="xsl/copy.xsl" level="basic">
Checks the width of all the defined characters Checks the width of all the defined characters
</test> </test>
<testresult id="1" agreement="issues"> <testresult id="1" agreement="issues">
</testcases> </testcases>
<testcases profile="List Objects"> <testcases profile="List Objects">
<testcases profile="general" > <testcases profile="general" >
<test id="log1" interaction="none" fo="list" xml="xml/bugtests/list-mountjoy.fo" xsl="xsl/copy.xsl" level="basic">
<test id="log1" interaction="none" fo="list-block" xml="xml/bugtests/list-mountjoy.fo" xsl="xsl/copy.xsl" level="basic">
Some lists with nested list and large list item bodies. Some lists with nested list and large list item bodies.
</test> </test>
<testresult id="log1" agreement="full"> <testresult id="log1" agreement="full">
</testresult> </testresult>
<test id="log2" interaction="none" fo="list" xml="xml/bugtests/list-nested-breaks.fo" xsl="xsl/copy.xsl" level="basic">
<test id="log2" interaction="none" fo="list-block" xml="xml/bugtests/list-nested-breaks.fo" xsl="xsl/copy.xsl" level="basic">
Nested lists with page breaks inside list items. Used to show that it correctly places the list items and labels. Nested lists with page breaks inside list items. Used to show that it correctly places the list items and labels.
</test> </test>
<testresult id="log2" agreement="issues"> <testresult id="log2" agreement="issues">
The break before does not put the list item label on the correct page. The break before does not put the list item label on the correct page.
</testresult> </testresult>
<test id="log3" interaction="none" fo="list" xml="xml/bugtests/list-nested.fo" xsl="xsl/copy.xsl" level="basic">
<test id="log3" interaction="none" fo="list-block" xml="xml/bugtests/list-nested.fo" xsl="xsl/copy.xsl" level="basic">
Nested lists used to show that the indentation is correct for lists inside lists. Nested lists used to show that the indentation is correct for lists inside lists.
</test> </test>
<testresult id="log3" agreement="full"> <testresult id="log3" agreement="full">


<testcases profile="Block Objects"> <testcases profile="Block Objects">
<testcases profile="breaks" > <testcases profile="breaks" >
<test id="bbo1a1" interaction="none" fo="block" xml="xml/bugtests/background_color.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk1" interaction="none" fo="block" xml="xml/bugtests/background_color.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1a1" agreement="issues">
<testresult id="blk1" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/background_transparent.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk2" interaction="none" fo="block" xml="xml/bugtests/background_transparent.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk2" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/block-container.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk3" interaction="none" fo="block-container" xml="xml/bugtests/block-container.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk3" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/block.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk4" interaction="none" fo="block" xml="xml/bugtests/block.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk4" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/border.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk5" interaction="none" fo="block" xml="xml/bugtests/border.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk5" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/break-before.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk6" interaction="none" fo="block" xml="xml/bugtests/break-before.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk6" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/color.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk7" interaction="none" fo="block" xml="xml/bugtests/color.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk7" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/external-graphic.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk8" interaction="none" fo="external-graphic" xml="xml/bugtests/external-graphic.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk8" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/font-family.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk9" interaction="none" fo="block" xml="xml/bugtests/font-family.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk9" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/font-size.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk10" interaction="none" fo="block" xml="xml/bugtests/font-size.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk10" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/font.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk11" interaction="none" fo="block" xml="xml/bugtests/font.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk11" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/header_footer.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk12" interaction="none" fo="block" xml="xml/bugtests/header_footer.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk12" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/image.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk13" interaction="none" fo="external-graphic" xml="xml/bugtests/image.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk13" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/indent.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk14" interaction="none" fo="block" xml="xml/bugtests/indent.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk14" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/inline.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk15" interaction="none" fo="inline" xml="xml/bugtests/inline.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk15" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/keep-with-next.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk16" interaction="none" fo="block" xml="xml/bugtests/keep-with-next.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk16" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/leader.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk17" interaction="none" fo="leader" xml="xml/bugtests/leader.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk17" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/letter-spacing.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk18" interaction="none" fo="block" xml="xml/bugtests/letter-spacing.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk18" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/line-height.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk19" interaction="none" fo="block" xml="xml/bugtests/line-height.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk19" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/padding.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk20" interaction="none" fo="block" xml="xml/bugtests/padding.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk20" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/page-number.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk21" interaction="none" fo="page-number" xml="xml/bugtests/page-number.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk21" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/rule.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk22" interaction="none" fo="block" xml="xml/bugtests/rule.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk22" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/simple-link.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk23" interaction="none" fo="inline" xml="xml/bugtests/simple-link.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk23" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/space-treatment.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk24" interaction="none" fo="block" xml="xml/bugtests/space-treatment.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk24" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/space.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk25" interaction="none" fo="block" xml="xml/bugtests/space.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk25" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/text-align.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk26" interaction="none" fo="block" xml="xml/bugtests/text-align.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk26" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/text-decoration.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk27" interaction="none" fo="block" xml="xml/bugtests/text-decoration.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk27" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/text-indent.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk28" interaction="none" fo="block" xml="xml/bugtests/text-indent.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk28" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/word-spacing.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk29" interaction="none" fo="block" xml="xml/bugtests/word-spacing.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk29" agreement="issues">
</testresult> </testresult>
<test id="bbo1b1" interaction="none" fo="list" xml="xml/bugtests/wrap.fo" xsl="xsl/copy.xsl" level="basic">
<test id="blk230" interaction="none" fo="block" xml="xml/bugtests/wrap.fo" xsl="xsl/copy.xsl" level="basic">


</test> </test>
<testresult id="bbo1b1" agreement="issues">
<testresult id="blk30" agreement="issues">
</testresult> </testresult>


</testcases> </testcases>

+ 8
- 8
test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java Voir le fichier

GridUnit gu = getGridUnit(body); GridUnit gu = getGridUnit(body);


String errorMsge = baseErrorMsge + "border-before"; String errorMsge = baseErrorMsge + "border-before";
checkBorder(errorMsge, gu.borderBefore.nonLeadingTrailing, 8000, Color.black);
checkBorder(errorMsge, gu.borderBefore.normal, 8000, Color.black);
checkBorder(errorMsge, gu.borderBefore.leadingTrailing, 8000, Color.black); checkBorder(errorMsge, gu.borderBefore.leadingTrailing, 8000, Color.black);
checkBorder(errorMsge, gu.borderBefore.rest, resolvedBorders[tableNum][0]); checkBorder(errorMsge, gu.borderBefore.rest, resolvedBorders[tableNum][0]);


errorMsge = baseErrorMsge + "border-after"; errorMsge = baseErrorMsge + "border-after";
checkBorder(errorMsge, gu.borderAfter.nonLeadingTrailing, 8000, Color.black);
checkBorder(errorMsge, gu.borderAfter.normal, 8000, Color.black);
checkBorder(errorMsge, gu.borderAfter.leadingTrailing, 8000, Color.black); checkBorder(errorMsge, gu.borderAfter.leadingTrailing, 8000, Color.black);
checkBorder(errorMsge, gu.borderAfter.rest, resolvedBorders[tableNum][1]); checkBorder(errorMsge, gu.borderAfter.rest, resolvedBorders[tableNum][1]);




TableBody header = table.getTableHeader(); TableBody header = table.getTableHeader();
GridUnit gu = getGridUnit(header); GridUnit gu = getGridUnit(header);
checkBorder(errorMsge, gu.borderBefore.nonLeadingTrailing,
checkBorder(errorMsge, gu.borderBefore.normal,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderBefore.rest, checkBorder(errorMsge, gu.borderBefore.rest,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);


TableBody footer = table.getTableFooter(); TableBody footer = table.getTableFooter();
gu = getGridUnit(footer); gu = getGridUnit(footer);
checkBorder(errorMsge, gu.borderAfter.nonLeadingTrailing,
checkBorder(errorMsge, gu.borderAfter.normal,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderAfter.rest, checkBorder(errorMsge, gu.borderAfter.rest,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
FONodeIterator bodyIter = table.getChildNodes(); FONodeIterator bodyIter = table.getChildNodes();
TableBody body = (TableBody) bodyIter.nextNode(); TableBody body = (TableBody) bodyIter.nextNode();
gu = getGridUnit(body); gu = getGridUnit(body);
checkBorder(errorMsge, gu.borderBefore.nonLeadingTrailing,
checkBorder(errorMsge, gu.borderBefore.normal,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderBefore.leadingTrailing, checkBorder(errorMsge, gu.borderBefore.leadingTrailing,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderBefore.rest, checkBorder(errorMsge, gu.borderBefore.rest,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderAfter.nonLeadingTrailing,
checkBorder(errorMsge, gu.borderAfter.normal,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderAfter.leadingTrailing, checkBorder(errorMsge, gu.borderAfter.leadingTrailing,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);


body = (TableBody) bodyIter.nextNode(); body = (TableBody) bodyIter.nextNode();
gu = getGridUnit(body); gu = getGridUnit(body);
checkBorder(errorMsge, gu.borderBefore.nonLeadingTrailing,
checkBorder(errorMsge, gu.borderBefore.normal,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderBefore.leadingTrailing, checkBorder(errorMsge, gu.borderBefore.leadingTrailing,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderBefore.rest, checkBorder(errorMsge, gu.borderBefore.rest,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderAfter.nonLeadingTrailing,
checkBorder(errorMsge, gu.borderAfter.normal,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);
checkBorder(errorMsge, gu.borderAfter.leadingTrailing, checkBorder(errorMsge, gu.borderAfter.leadingTrailing,
resolvedBordersHF[tableNum][borderNum++]); resolvedBordersHF[tableNum][borderNum++]);

Chargement…
Annuler
Enregistrer