aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-05-20 15:46:22 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-05-20 15:46:22 +0000
commitd3fedf5ec86b2e16de41a9c2dd7420287f3e8911 (patch)
tree54408dc1f909b185147640990e790f9fcf45ad72 /src/java
parente217d5d5a7a7719ec9e5866911c65b54d3cbf7b2 (diff)
downloadxmlgraphics-fop-d3fedf5ec86b2e16de41a9c2dd7420287f3e8911.tar.gz
xmlgraphics-fop-d3fedf5ec86b2e16de41a9c2dd7420287f3e8911.zip
Merged revisions 657465,657521,657921 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r657465 | adelmelle | 2008-05-17 22:18:19 +0100 (Sat, 17 May 2008) | 1 line Corrected testcase: since the fo:flow's ID is correctly processed... ........ r657521 | maxberger | 2008-05-18 10:39:03 +0100 (Sun, 18 May 2008) | 1 line Updated as per suggestions in bug 45019 ........ r657921 | spepping | 2008-05-19 20:02:18 +0100 (Mon, 19 May 2008) | 6 lines Added event TableEventProducer.forceNextColumnNumber when TableFObj.ColumnNumberPropertyMaker forces a zero or negative column-number property to the next available column, because this is a FOP extension. Fixed TableFObj.ColumnNumberPropertyMaker.make to really report a cell overlap event. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@658286 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/fop/events/EventFormatter.xml1
-rw-r--r--src/java/org/apache/fop/fo/flow/table/TableEventProducer.java11
-rw-r--r--src/java/org/apache/fop/fo/flow/table/TableFObj.java9
3 files changed, 18 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/events/EventFormatter.xml b/src/java/org/apache/fop/events/EventFormatter.xml
index 4bff75f85..3e6cc181e 100644
--- a/src/java/org/apache/fop/events/EventFormatter.xml
+++ b/src/java/org/apache/fop/events/EventFormatter.xml
@@ -65,6 +65,7 @@ Any reference to it will be considered a reference to the first occurrence in th
<message key="org.apache.fop.fo.flow.table.TableEventProducer.warnImplicitColumns">table-layout=\"fixed\" and column-width unspecified =&gt; falling back to proportional-column-width(1){{locator}}</message>
<message key="org.apache.fop.fo.flow.table.TableEventProducer.paddingNotApplicable">padding-* properties are not applicable to {elementName}, but a non-zero value for padding was found.{{locator}}</message>
<message key="org.apache.fop.fo.flow.table.TableEventProducer.cellOverlap">{elementName} overlaps in column {column}.<!-- no locator here, exception will be wrapped --></message>
+ <message key="org.apache.fop.fo.flow.table.TableEventProducer.forceNextColumnNumber">Negative value {propValue} of property column-number of element {elementName} forced into the next available column number {columnNumber}.{{locator}}</message>
<message key="org.apache.fop.fo.flow.table.TableEventProducer.breakIgnoredDueToRowSpanning">{breakBefore,if,break-before,break-after} ignored on {elementName} because of row spanning in progress (See XSL 1.1, {breakBefore,if,7.20.2,7.20.1}){{locator}}</message>
<message key="org.apache.fop.events.ResourceEventProducer.imageNotFound">Image not found.[ URI: {uri}.]{{locator}}</message>
<message key="org.apache.fop.events.ResourceEventProducer.imageError">Image not available.[ URI: {uri}.] Reason:[ {reason}][ {e}]{{locator}}</message>
diff --git a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
index 44ddcc038..9c4a82dd6 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
@@ -145,6 +145,17 @@ public interface TableEventProducer extends EventProducer {
Locator loc) throws PropertyException;
/**
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param propValue the user-specified value of the column-number property
+ * @param columnNumber the generated value for the column-number property
+ * @param loc the location of the error or null
+ * @event.severity WARN
+ */
+ void forceNextColumnNumber(Object source, String elementName, Number propValue,
+ int columnNumber, Locator loc);
+
+ /**
* Break ignored due to row spanning.
* @param source the event source
* @param elementName the name of the context node
diff --git a/src/java/org/apache/fop/fo/flow/table/TableFObj.java b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
index 6bc113fd0..016046ae2 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableFObj.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
@@ -159,9 +159,8 @@ public abstract class TableFObj extends FObj {
int colSpan = propertyList.get(Constants.PR_NUMBER_COLUMNS_SPANNED)
.getNumeric().getValue();
- int i = columnIndex - 1;
- int lastIndex = (columnIndex + colSpan) - 1;
- while (++i < lastIndex) {
+ int lastIndex = columnIndex - 1 + colSpan;
+ for (int i = columnIndex; i <= lastIndex; ++i) {
if (columnIndexManager.isColumnNumberUsed(i)) {
/* if column-number is already in use by another
* cell/column => error!
@@ -195,6 +194,10 @@ public abstract class TableFObj extends FObj {
(ColumnNumberManagerHolder) propertyList.getParentFObj();
ColumnNumberManager columnIndexManager = parent.getColumnNumberManager();
i = columnIndexManager.getCurrentColumnNumber();
+ TableEventProducer eventProducer =
+ TableEventProducer.Provider.get(fo.getUserAgent().getEventBroadcaster());
+ eventProducer.forceNextColumnNumber(this, propertyList.getFObj().getName(),
+ val, i, fo.getLocator());
}
return NumberProperty.getInstance(i);
}