diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-12-13 19:48:04 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-12-13 19:48:04 +0000 |
commit | 32521d94ac717c6f07f4d45607d1d049c839c42c (patch) | |
tree | 4c405a9bc0abee3e33031a242d9e0eb7dd2024c8 /src/java/org/apache/fop/layoutmgr/table | |
parent | 97233ecb13be21d14b04265c31023b6a759e9d71 (diff) | |
download | xmlgraphics-fop-32521d94ac717c6f07f4d45607d1d049c839c42c.tar.gz xmlgraphics-fop-32521d94ac717c6f07f4d45607d1d049c839c42c.zip |
New method: FONode.decorateWithContextInfo() adds context information to an error or log message by either providing the locator information or by gathering context information from the context FOs.
Improved log and error messages in a number of places by adding additional context information that should make it easier to find the location in the source files.
Added a check to detect inline overflows (LineLayoutManager).
Added a check to detect in-page overflows (PageBreakingAlgorithm).
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@356592 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/table')
3 files changed, 18 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java index c49c35760..00784fc5c 100644 --- a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java +++ b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java @@ -26,6 +26,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.fop.datatypes.PercentBaseContext; +import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableColumn; @@ -96,10 +97,11 @@ public class ColumnSetup { if (index > maxColIndexReferenced) { maxColIndexReferenced = index; if (!(size == 1 && getColumn(1).isDefaultColumn())) { - log.warn("There are fewer table-columns than are needed. Column " + log.warn(FONode.decorateWithContextInfo( + "There are fewer table-columns than are needed. Column " + index + " was accessed although only " + size + " columns have been defined. " - + "The last defined column will be reused."); + + "The last defined column will be reused.", table)); if (!table.isAutoLayout()) { log.warn("Please note that according XSL-FO 1.0 (7.26.9) says that " + "the 'column-width' property must be specified for every " diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 9b2d8e0f2..511c8559a 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -30,6 +30,7 @@ import org.apache.fop.area.Block; import org.apache.fop.area.Trait; import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.fo.Constants; +import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableBody; @@ -478,7 +479,7 @@ public class TableContentLayoutManager implements PercentBaseContext { if ((elems.size() > 0) && ((KnuthElement)elems.getLast()).isForcedBreak()) { // a descendant of this block has break-after - log.warn("Descendant of table-cell signals break: " + log.debug("Descendant of table-cell signals break: " + primary.getCellLM().isFinished()); } @@ -556,12 +557,14 @@ public class TableContentLayoutManager implements PercentBaseContext { row.setHeight(rowHeights[rgi]); row.setExplicitHeight(explicitRowHeights[rgi]); if (effRowContentHeight > row.getExplicitHeight().max) { - log.warn("The contents of row " + (row.getIndex() + 1) + log.warn(FONode.decorateWithContextInfo( + "The contents of row " + (row.getIndex() + 1) + " are taller than they should be (there is a" + " block-progression-dimension or height constraint on the indicated row)." + " Due to its contents the row grows" + " to " + effRowContentHeight + " millipoints, but the row shouldn't get" - + " any taller than " + row.getExplicitHeight() + " millipoints."); + + " any taller than " + row.getExplicitHeight() + " millipoints.", + row.getTableRow())); } } if (log.isDebugEnabled()) { diff --git a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java index f290c175a..554ae4069 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.Constants; -import org.apache.fop.fo.flow.Table; +import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.TableRow; import org.apache.fop.layoutmgr.BreakElement; import org.apache.fop.layoutmgr.ElementListUtils; @@ -418,8 +418,9 @@ public class TableStepper { if (activeRow < rowGroup.length - 1) { TableRow rowFO = getActiveRow().getTableRow(); if (rowFO != null && rowFO.getBreakAfter() != Constants.EN_AUTO) { - log.warn("break-after ignored on table-row because of row spanning " - + "in progress (See XSL 1.0, 7.19.1)"); + log.warn(FONode.decorateWithContextInfo( + "break-after ignored on table-row because of row spanning " + + "in progress (See XSL 1.0, 7.19.1)", rowFO)); } activeRow++; if (log.isDebugEnabled()) { @@ -433,8 +434,9 @@ public class TableStepper { } rowFO = getActiveRow().getTableRow(); if (rowFO != null && rowFO.getBreakBefore() != Constants.EN_AUTO) { - log.warn("break-before ignored on table-row because of row spanning " - + "in progress (See XSL 1.0, 7.19.2)"); + log.warn(FONode.decorateWithContextInfo( + "break-before ignored on table-row because of row spanning " + + "in progress (See XSL 1.0, 7.19.2)", rowFO)); } } } @@ -450,7 +452,7 @@ public class TableStepper { KnuthElement el = (KnuthElement)elementLists[i].get(end[i]); if (el.isPenalty()) { if (el.getP() <= -KnuthElement.INFINITE) { - log.warn("FORCED break encountered!"); + log.debug("FORCED break encountered!"); forcedBreaks[i] = true; break; } else if (el.getP() < KnuthElement.INFINITE) { |