You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2005/08/05 21:14:24 UTC

svn commit: r230499 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf: ./ rtflib/interfaces/ rtflib/rtfdoc/ rtflib/tools/

Author: jeremias
Date: Fri Aug  5 12:14:10 2005
New Revision: 230499

URL: http://svn.apache.org/viewcvs?rev=230499&view=rev
Log:
Bugzilla #35998
Context classes into the tools package.
Lonely interface ITableColumnsInfo to the others.
Suggested by: Guillaume Déflache <guillaume.at.anyware-tech.com> 

Added:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java
      - copied, changed from r230447, xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/interfaces/ITableColumnsInfo.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java   (with props)
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java   (with props)
Removed:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/BuilderContext.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/TableContext.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/interfaces/ITableColumnsInfo.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/interfaces/package.html
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java?rev=230499&r1=230498&r2=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java Fri Aug  5 12:14:10 2005
@@ -82,6 +82,8 @@
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfTableContainer;
+import org.apache.fop.render.rtf.rtflib.tools.BuilderContext;
+import org.apache.fop.render.rtf.rtflib.tools.TableContext;
 import org.apache.fop.fonts.FontSetup;
 
 /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java?rev=230499&r1=230498&r2=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java Fri Aug  5 12:14:10 2005
@@ -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.
@@ -27,7 +27,6 @@
 package org.apache.fop.render.rtf.rtflib.rtfdoc;
 
 import java.io.IOException;
-import org.apache.fop.render.rtf.rtflib.interfaces.ITableColumnsInfo;
 
 /**
  *  Interface for RtfElements that can contain RtfTables

Copied: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java (from r230447, xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/interfaces/ITableColumnsInfo.java)
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java?p2=xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java&p1=xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/interfaces/ITableColumnsInfo.java&r1=230447&r2=230499&rev=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/interfaces/ITableColumnsInfo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java Fri Aug  5 12:14:10 2005
@@ -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.
@@ -24,7 +24,7 @@
  * the FOP project.
  */
 
-package org.apache.fop.render.rtf.rtflib.interfaces;
+package org.apache.fop.render.rtf.rtflib.rtfdoc;
 
 /**  Used to get information about tables, for example when handling nested tables
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java?rev=230499&r1=230498&r2=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java Fri Aug  5 12:14:10 2005
@@ -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.
@@ -28,7 +28,6 @@
 
 import java.io.Writer;
 import java.io.IOException;
-import org.apache.fop.render.rtf.rtflib.interfaces.ITableColumnsInfo;
 
 /** Common code for RtfAfter and RtfBefore
 *  @author Andreas Lambert <an...@cronidesoft.com>

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java?rev=230499&r1=230498&r2=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java Fri Aug  5 12:14:10 2005
@@ -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.
@@ -32,7 +32,6 @@
 import java.util.LinkedList;
 import java.util.Iterator;
 import java.util.Collections;
-import org.apache.fop.render.rtf.rtflib.interfaces.ITableColumnsInfo;
 
 
 /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java?rev=230499&r1=230498&r2=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java Fri Aug  5 12:14:10 2005
@@ -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.
@@ -28,7 +28,6 @@
 
 import java.io.Writer;
 import java.io.IOException;
-import org.apache.fop.render.rtf.rtflib.interfaces.ITableColumnsInfo;
 
 /**  Models a section in an RTF document
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java?rev=230499&r1=230498&r2=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java Fri Aug  5 12:14:10 2005
@@ -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.
@@ -28,7 +28,6 @@
 
 import java.io.Writer;
 import java.io.IOException;
-import org.apache.fop.render.rtf.rtflib.interfaces.ITableColumnsInfo;
 
 /**  Container for RtfRow elements
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java?rev=230499&r1=230498&r2=230499&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java Fri Aug  5 12:14:10 2005
@@ -29,7 +29,6 @@
 import java.io.Writer;
 import java.io.IOException;
 import java.util.Iterator;
-import org.apache.fop.render.rtf.rtflib.interfaces.ITableColumnsInfo;
 
 /**  A cell in an RTF table, container for paragraphs, lists, etc.
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java?rev=230499&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java Fri Aug  5 12:14:10 2005
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id: BuilderContext.java 227252 2005-08-03 19:30:55Z jeremias $ */
+
+package org.apache.fop.render.rtf.rtflib.tools;
+
+import java.util.Stack;
+
+import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfOptions;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer;
+
+
+/**  A BuilderContext holds context information when building an RTF document
+ *
+ *  @author Bertrand Delacretaz <bd...@codeconsult.ch>
+ *  @author putzi
+ *  @author Peter Herweg <ph...@web.de>
+ *
+ *  This class was originally developed by Bertrand Delacretaz bdelacretaz@codeconsult.ch
+ *  for the JFOR project and is now integrated into FOP.
+ */
+
+public class BuilderContext {
+    /** stack of RtfContainers */
+    private final Stack containers = new Stack();
+
+    /** stack of TableContexts */
+    private final Stack tableContexts = new Stack();
+
+    /** stack of IBuilders */
+    private final Stack builders = new Stack();
+
+    /** Rtf options */
+    private IRtfOptions options;
+
+    public BuilderContext(IRtfOptions rtfOptions) {
+        options = rtfOptions;
+    }
+
+    /** find first object of given class from top of stack s
+     *  @return null if not found
+     */
+    private Object getObjectFromStack(Stack s, Class desiredClass) {
+        Object result = null;
+        final Stack copy = (Stack)s.clone();
+        while (!copy.isEmpty()) {
+            final Object o = copy.pop();
+            if (desiredClass.isAssignableFrom(o.getClass())) {
+                result = o;
+                break;
+            }
+        }
+        return result;
+    }
+
+    /* find the "nearest" IBuilder of given class /
+    public Object getBuilder(Class builderClass,boolean required)
+    throws Exception
+    {
+        final IBuilder result = (IBuilder)getObjectFromStack(builders,builderClass);
+        if(result == null && required) {
+            throw new Exception(
+                "IBuilder of class '" + builderClass.getName() + "' not found on builders stack"
+               );
+        }
+        return result;
+    }*/
+
+    /** find the "nearest" container that implements the given interface on our stack
+     *  @param required if true, ConverterException is thrown if no container found
+     *  @param forWhichBuilder used in error message if container not found
+     */
+    public RtfContainer getContainer(Class containerClass, boolean required,
+                              Object /*IBuilder*/ forWhichBuilder) throws Exception {
+        // TODO what to do if the desired container is not at the top of the stack?
+        // close top-of-stack container?
+        final RtfContainer result = (RtfContainer)getObjectFromStack(containers,
+                containerClass);
+
+        if (result == null && required) {
+            throw new Exception(
+                "No RtfContainer of class '" + containerClass.getName()
+                + "' available for '" + forWhichBuilder.getClass().getName() + "' builder"
+               );
+        }
+
+        return result;
+    }
+
+    /** push an RtfContainer on our stack */
+    public void pushContainer(RtfContainer c) {
+        containers.push(c);
+    }
+
+    /**
+     * In some cases an RtfContainer must be replaced by another one on the
+     * stack. This happens when handling nested fo:blocks for example: after
+     * handling a nested block the enclosing block must switch to a new
+     * paragraph container to handle what follows the nested block.
+     * TODO: what happens to elements that are "more on top" than oldC on the
+     * stack? shouldn't they be closed or something?
+     */
+    public void replaceContainer(RtfContainer oldC, RtfContainer newC)
+    throws Exception {
+        // treating the Stack as a Vector allows such manipulations (yes, I hear you screaming ;-)
+        final int index = containers.indexOf(oldC);
+        if (index < 0) {
+            throw new Exception("container to replace not found:" + oldC);
+        }
+        containers.setElementAt(newC, index);
+    }
+
+    /** pop the topmost RtfContainer from our stack */
+    public void popContainer() {
+        containers.pop();
+    }
+
+    /* push an IBuilder to our stack /
+    public void pushBuilder(IBuilder b)
+    {
+        builders.push(b);
+    }*/
+
+    /** pop the topmost IBuilder from our stack and return previous builder on stack
+     *  @return null if builders stack is empty
+
+    public IBuilder popBuilderAndGetPreviousOne()
+    {
+        IBuilder result = null;
+        builders.pop();
+        if(!builders.isEmpty()) {
+            result = (IBuilder)builders.peek();
+        }
+        return result;
+    }
+    */
+    /** return the current TableContext */
+    public TableContext getTableContext() {
+        return (TableContext)tableContexts.peek();
+    }
+
+    /** push a TableContext to our stack */
+    public void pushTableContext(TableContext tc) {
+        tableContexts.push(tc);
+    }
+
+    /** pop a TableContext from our stack */
+    public void popTableContext() {
+        tableContexts.pop();
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java?rev=230499&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java Fri Aug  5 12:14:10 2005
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id: TableContext.java 227252 2005-08-03 19:30:55Z jeremias $ */
+
+package org.apache.fop.render.rtf.rtflib.tools;
+
+import java.util.List;
+
+import org.apache.commons.logging.impl.SimpleLog;
+import org.apache.commons.logging.Log;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableColumnsInfo;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
+
+
+/** Used when handling fo:table to hold information to build the table.
+ *
+ *  Contributor(s):
+ *  @author Bertrand Delacretaz <bd...@codeconsult.ch>
+ *  @author Trembicki-Guy, Ed <Gu...@DNB.com>
+ *  @author Boris Poudérous <bo...@eads-telecom.com>
+ *  @author Peter Herweg <ph...@web.de>
+ *
+ *  This class was originally developed for the JFOR project and
+ *  is now integrated into FOP.
+ */
+
+public class TableContext implements ITableColumnsInfo {
+    private final Log log = new SimpleLog("FOP/RTF");
+    private final BuilderContext context;
+    private final List colWidths = new java.util.ArrayList();
+    private int colIndex;
+
+    /**
+     * Added by Peter Herweg on 2002-06-29
+     * This ArrayList contains one element for each column in the table.
+     * value == 0 means there is no row-spanning
+     * value >  0 means there is row-spanning
+     * Each value in the list is decreased by 1 after each finished table-row
+     */
+    private final List colRowSpanningNumber = new java.util.ArrayList();
+
+    /**
+     * Added by Peter Herweg on 2002-06-29
+     * If there has a vertical merged cell to be created, its attributes are
+     * inherited from the corresponding MERGE_START-cell.
+     * For this purpose the attributes of a cell are stored in this array, as soon
+     * as a number-rows-spanned attribute has been found.
+     */
+    private final List colRowSpanningAttrs = new java.util.ArrayList();
+
+    private boolean bNextRowBelongsToHeader = false;
+
+    public void setNextRowBelongsToHeader(boolean value) {
+        this.bNextRowBelongsToHeader = value;
+    }
+
+    public boolean getNextRowBelongsToHeader() {
+        return bNextRowBelongsToHeader;
+    }
+
+    public TableContext(BuilderContext ctx) {
+        context = ctx;
+    }
+
+    public void setNextColumnWidth(Float width)
+            throws Exception {
+        colWidths.add(width);
+    }
+
+    //Added by Peter Herweg on 2002-06-29
+    public RtfAttributes getColumnRowSpanningAttrs() {
+        return (RtfAttributes)colRowSpanningAttrs.get(colIndex);
+    }
+
+    //Added by Peter Herweg on 2002-06-29
+    public Integer getColumnRowSpanningNumber() {
+        return (Integer)colRowSpanningNumber.get(colIndex);
+    }
+
+    //Added by Peter Herweg on 2002-06-29
+    public void setCurrentColumnRowSpanning(Integer iRowSpanning,  RtfAttributes attrs)
+            throws Exception {
+
+        if (colIndex < colRowSpanningNumber.size()) {
+            colRowSpanningNumber.set(colIndex, iRowSpanning);
+            colRowSpanningAttrs.set(colIndex, attrs);
+        } else {
+            colRowSpanningNumber.add(iRowSpanning);
+            colRowSpanningAttrs.add(colIndex, attrs);
+        }
+    }
+
+    //Added by Peter Herweg on 2002-06-29
+    public void setNextColumnRowSpanning(Integer iRowSpanning,
+            RtfAttributes attrs) {
+        colRowSpanningNumber.add(iRowSpanning);
+        colRowSpanningAttrs.add(colIndex, attrs);
+    }
+
+    /**
+     * Added by Peter Herweg on 2002-06-29
+     * This function is called after each finished table-row.
+     * It decreases all values in colRowSpanningNumber by 1. If a value
+     * reaches 0 row-spanning is finished, and the value won't be decreased anymore.
+     */
+    public void decreaseRowSpannings() {
+        for (int z = 0; z < colRowSpanningNumber.size(); ++z) {
+            Integer i = (Integer)colRowSpanningNumber.get(z);
+
+            if (i.intValue() > 0) {
+                i = new Integer(i.intValue() - 1);
+            }
+
+            colRowSpanningNumber.set(z, i);
+
+            if (i.intValue() == 0) {
+                colRowSpanningAttrs.set(z, null);
+            }
+        }
+    }
+
+    /**
+     * Reset the column iteration index, meant to be called when creating a new row
+     * The 'public' modifier has been added by Boris Poudérous for
+     * 'number-columns-spanned' processing
+     */
+    public void selectFirstColumn() {
+        colIndex = 0;
+    }
+
+    /**
+     * Increment the column iteration index
+     * The 'public' modifier has been added by Boris Poudérous for
+     * 'number-columns-spanned' processing
+     */
+    public void selectNextColumn() {
+        colIndex++;
+    }
+
+    /**
+     * Get current column width according to column iteration index
+     * @return INVALID_COLUMN_WIDTH if we cannot find the value
+     * The 'public' modifier has been added by Boris Poudérous for
+     * 'number-columns-spanned' processing
+     */
+    public float getColumnWidth() {
+        try {
+            return ((Float)colWidths.get(colIndex)).floatValue();
+        } catch (IndexOutOfBoundsException ex) {
+            // this code contributed by Trembicki-Guy, Ed <Gu...@DNB.com>
+            log.warn("fo:table-column width not defined, using " + INVALID_COLUM_WIDTH);
+            return INVALID_COLUM_WIDTH;
+        }
+    }
+
+     /** Added by Boris Poudérous on 07/22/2002 */
+     public int getColumnIndex() {
+       return colIndex;
+     }
+     /** - end - */
+
+     /** Added by Boris Poudérous on 07/22/2002 */
+     public int getNumberOfColumns() {
+       return colWidths.size();
+     }
+     /** - end - */
+}
+

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org