* (e.g., currently unsupported properties)
* @param problem text to display that indicates the problem
*/
- protected void attributeWarning(String problem) {
+ public void attributeWarning(String problem) {
log.warn(warningText(locator) + getName() + ", " + problem);
}
import java.util.List;
import java.util.ListIterator;
+import org.apache.fop.fo.Constants;
import org.apache.fop.fo.ValidationException;
}
/** {@inheritDoc} */
- void endRow(TableCellContainer container) {
+ void endRow(TableRow row) {
+ if (currentRowIndex > 0 && row.getBreakBefore() != Constants.EN_AUTO) {
+ row.attributeWarning("break-before ignored because of row spanning "
+ + "in progress (See XSL 1.1, 7.20.2)");
+ }
+ if (currentRowIndex < rows.size() - 1 && row.getBreakAfter() != Constants.EN_AUTO) {
+ row.attributeWarning("break-after ignored because of row spanning "
+ + "in progress (See XSL 1.1, 7.20.1)");
+ }
+ handleRowEnd(row);
+ }
+
+ /** {@inheritDoc} */
+ void endRow(TableBody body) {
+ handleRowEnd(body);
+ }
+
+ private void handleRowEnd(TableCellContainer container) {
List currentRow = (List) rows.get(currentRowIndex);
lastRow = currentRow;
// Fill gaps with empty grid units
/**
* Receives notification of the end of the current row. If the current row finishes
* the row group, the {@link TableBody#addRowGroup(List)} method of the parent table
- * part (i.e., the given container itself or its parent if this is a table-row) will
- * be called
+ * part will be called.
*
- * @param container the parent element of the current row
+ * @param row the row being finished
*/
- abstract void endRow(TableCellContainer container);
+ abstract void endRow(TableRow row);
+
+ /**
+ * Receives notification of the end of the current row, when the source contains no
+ * fo:table-row element. If the current row finishes the row group, the
+ * {@link TableBody#addRowGroup(List)} method of the given table part will be called.
+ *
+ * <p>If the source does contain explicit fo:table-row elements, then the
+ * {@link #endRow(TableRow)} method will be called instead.</p>
+ *
+ * @param part the part containing the current row
+ */
+ abstract void endRow(TableBody part);
/**
* Receives notification of the start of a table-header/footer/body.
}
/** {@inheritDoc} */
- void endRow(final TableCellContainer container) {
+ void endRow(final TableRow row) {
events.add(new Event() {
public void play(RowGroupBuilder rowGroupBuilder) {
- rowGroupBuilder.endRow(container);
+ rowGroupBuilder.endRow(row);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ void endRow(final TableBody part) {
+ events.add(new Event() {
+ public void play(RowGroupBuilder rowGroupBuilder) {
+ rowGroupBuilder.endRow(part);
}
});
}
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.FONode;
import org.apache.fop.fo.flow.table.EffRow;
import org.apache.fop.fo.flow.table.GridUnit;
import org.apache.fop.fo.flow.table.PrimaryGridUnit;
-import org.apache.fop.fo.flow.table.TableRow;
import org.apache.fop.layoutmgr.BreakElement;
import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.KnuthGlue;
*/
private void prepareNextRow() {
if (activeRowIndex < rowGroup.length - 1) {
- TableRow rowFO = rowGroup[activeRowIndex].getTableRow();
- if (rowFO != null && rowFO.getBreakAfter() != Constants.EN_AUTO) {
- log.warn(FONode.decorateWithContextInfo(
- "break-after ignored on table-row because of row spanning "
- + "in progress (See XSL 1.0, 7.19.1)", rowFO));
- }
previousRowsLength += rowGroup[activeRowIndex].getHeight().opt;
activateCells(nextActiveCells, activeRowIndex + 1);
- rowFO = rowGroup[activeRowIndex + 1].getTableRow();
- if (rowFO != null && rowFO.getBreakBefore() != Constants.EN_AUTO) {
- log.warn(FONode.decorateWithContextInfo(
- "break-before ignored on table-row because of row spanning "
- + "in progress (See XSL 1.0, 7.19.2)", rowFO));
- }
if (log.isTraceEnabled()) {
log.trace("Computing first step for row " + (activeRowIndex + 2));
}
<changes>
<release version="FOP Trunk">
+ <action context="Layout" dev="VH" type="fix" fixes-bug="44321">
+ Moved to the FO tree stage the check for break-before/after on table-row while spanning in
+ progress.
+ </action>
<action context="Layout" dev="VH" type="add">
Added full support for breaks before and after table cells (that is, break-before/after set
on the first/last child of a cell).
<info>
<p>
This test checks breaks on tables. Breaks on table-row during row spanning are ignored
- (XSL 1.0, 7.19.1 and 7.19.2).
+ (XSL 1.1, 7.20.1 and 7.20.2).
</p>
</info>
<fo>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
<fo:table table-layout="fixed" width="100%">
- <fo:table-column/>
- <fo:table-column/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
- <fo:table-row>
+ <fo:table-row break-after="page">
<fo:table-cell number-rows-spanned="2" background-color="orange">
<fo:block>cell1 line 1</fo:block>
<fo:block>cell1 line 2</fo:block>