Index: xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java,v
retrieving revision 1.6
diff -w -u -r1.6 ListBlock.java
--- xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java	16 Sep 2003 05:21:05 -0000	1.6
+++ xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java	20 Nov 2003 12:46:47 -0000
@@ -50,6 +50,9 @@
  */
 package org.apache.fop.fo.flow;
 
+// XML
+import org.xml.sax.Attributes;
+
 // FOP
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
@@ -157,5 +160,19 @@
         fotv.serveListBlock(this);
     }
 
+    /**
+     * @see org.apache.fop.fo.FObj#handleAttrs
+     */
+    public void handleAttrs(Attributes attlist) throws FOPException {
+        super.handleAttrs(attlist);
+
+        getFOTreeControl().getFOInputHandler().startList(this);
+    }
+    
+    protected void end() {
+        super.end();
+        
+        getFOTreeControl().getFOInputHandler().endList(this);
+    }
 }
 
Index: xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java,v
retrieving revision 1.7
diff -w -u -r1.7 ListItem.java
--- xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java	19 Sep 2003 14:33:15 -0000	1.7
+++ xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java	20 Nov 2003 12:46:47 -0000
@@ -50,6 +50,11 @@
  */
 package org.apache.fop.fo.flow;
 
+// XML
+import org.xml.sax.Attributes;
+
+// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOTreeVisitor;
 import org.apache.fop.fo.FObj;
@@ -165,5 +170,19 @@
         fotv.serveListItem(this);
     }
 
+    /**
+     * @see org.apache.fop.fo.FObj#handleAttrs
+     */
+    public void handleAttrs(Attributes attlist) throws FOPException {
+        super.handleAttrs(attlist);
+
+        getFOTreeControl().getFOInputHandler().startListItem(this);
+    }
+    
+    protected void end() {
+        super.end();
+        
+        getFOTreeControl().getFOInputHandler().endListItem(this);
+    }
 }
 
Index: xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java,v
retrieving revision 1.9
diff -w -u -r1.9 ListItemLabel.java
--- xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java	16 Sep 2003 05:21:05 -0000	1.9
+++ xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java	20 Nov 2003 12:46:48 -0000
@@ -50,7 +50,11 @@
  */
 package org.apache.fop.fo.flow;
 
+// XML
+import org.xml.sax.Attributes;
+
 // FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FOTreeVisitor;
@@ -103,5 +107,19 @@
         fotv.serveListItemLabel(this);
     }
 
+    /**
+     * @see org.apache.fop.fo.FObj#handleAttrs
+     */
+    public void handleAttrs(Attributes attlist) throws FOPException {
+        super.handleAttrs(attlist);
+
+        getFOTreeControl().getFOInputHandler().startListLabel();
+    }
+    
+    protected void end() {
+        super.end();
+        
+        getFOTreeControl().getFOInputHandler().endListLabel();
+    }
 }
 
Index: xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v
retrieving revision 1.5
diff -w -u -r1.5 RTFHandler.java
--- xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java	9 Nov 2003 17:06:01 -0000	1.5
+++ xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java	20 Nov 2003 12:46:51 -0000
@@ -85,6 +85,7 @@
 import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfBeforeContainer;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfListContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfTextrunContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAfter;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
@@ -93,6 +94,9 @@
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem.RtfListItemLabel;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
@@ -608,36 +612,81 @@
      * @see org.apache.fop.fo.FOInputHandler#startList(ListBlock)
      */
     public void startList(ListBlock lb) {
+        try  {
+            // create an RtfList in the current list container
+            final IRtfListContainer c = (IRtfListContainer)builderContext.getContainer(IRtfListContainer.class,true,this);
+            final RtfList newList = c.newList(ListAttributesConverter.convertAttributes(lb.properties));
+            builderContext.pushContainer(newList);
+        } catch (IOException ioe) {
+            log.error("startList: " + ioe.getMessage());
+            throw new Error(ioe.getMessage());
+        } catch (FOPException fe) {
+            log.error("startList: " + fe.getMessage());
+            throw new Error(fe.getMessage());
+        } catch (Exception e) {
+            log.error("startList: " + e.getMessage());
+            throw new Error(e.getMessage());
+        }
     }
 
     /**
      * @see org.apache.fop.fo.FOInputHandler#endList(ListBlock)
      */
     public void endList(ListBlock lb) {
+        builderContext.popContainer();
     }
 
     /**
      * @see org.apache.fop.fo.FOInputHandler#startListItem(ListItem)
      */
     public void startListItem(ListItem li) {
+        // create an RtfListItem in the current RtfList
+        try {
+            final RtfList list = (RtfList)builderContext.getContainer(RtfList.class,true,this);
+            builderContext.pushContainer(list.newListItem());
+        } catch (IOException ioe) {
+            log.error("startList: " + ioe.getMessage());
+            throw new Error(ioe.getMessage());
+        } catch (FOPException fe) {
+            log.error("startList: " + fe.getMessage());
+            throw new Error(fe.getMessage());
+        } catch (Exception e) {
+            log.error("startList: " + e.getMessage());
+            throw new Error(e.getMessage());
+        }
     }
 
     /**
      * @see org.apache.fop.fo.FOInputHandler#endListItem(ListItem)
      */
     public void endListItem(ListItem li) {
+        builderContext.popContainer();
     }
 
     /**
      * @see org.apache.fop.fo.FOInputHandler#startListLabel()
      */
     public void startListLabel() {
+        try {
+            RtfListItem item
+                = (RtfListItem)builderContext.getContainer(RtfListItem.class, true, this);
+                
+            RtfListItemLabel label=item.new RtfListItemLabel(item);
+            builderContext.pushContainer(label);
+        } catch (IOException ioe) {
+            log.error("startPageNumber:" + ioe.getMessage());
+            throw new Error(ioe.getMessage());
+        } catch (Exception e) {
+            log.error("startPageNumber: " + e.getMessage());
+            throw new Error(e.getMessage());
+        }
     }
 
     /**
      * @see org.apache.fop.fo.FOInputHandler#endListLabel()
      */
     public void endListLabel() {
+        builderContext.popContainer();
     }
 
     /**
Index: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java,v
retrieving revision 1.2
diff -w -u -r1.2 RtfFile.java
--- xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java	8 Nov 2003 19:58:03 -0000	1.2
+++ xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java	20 Nov 2003 12:46:52 -0000
@@ -132,8 +132,21 @@
     public RtfListTable startListTable(RtfAttributes attr)
     throws IOException {
         listNum++;
+        if(listTable != null) {
+            return listTable;
+        } else {
         listTable = new RtfListTable(this, writer, new Integer(listNum), attr);
         listTableContainer.addChild(listTable);
+        }
+
+        return listTable;
+    }
+    
+    /**
+     * Get the list table.
+     * @return the RtfListTable
+     */
+    public RtfListTable getListTable() {
         return listTable;
     }
 
Index: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java,v
retrieving revision 1.1
diff -w -u -r1.1 RtfList.java
--- xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java	4 Nov 2003 23:59:11 -0000	1.1
+++ xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java	20 Nov 2003 12:46:52 -0000
@@ -60,140 +60,42 @@
 
 import java.io.Writer;
 import java.io.IOException;
+import java.util.Date;
+import java.util.Random;
 
 /**
  * Model of an RTF list, which can contain RTF list items
  * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  * @author Christopher Scott, scottc@westinghouse.com
+ * @author Peter Herweg, pherweg@web.de
  */
 public class RtfList extends RtfContainer {
     private RtfListItem item;
     private RtfListTable listTable;
     private final boolean hasTableParent;
-
-    /** list numbering style.
-     *  Could add more variables, for now we simply differentiate between bullets and numbering
-     */
-    private NumberingStyle numberingStyle;
-
-    /**
-     * Inner static class to handle numbering styles.
-     */
-    public static class NumberingStyle {
-        private boolean isBulletedList = true;
-
-        /**
-         * accessor for isBulletedList
-         * @return isBulletedList
-         */
-        public boolean getIsBulletedList() {
-            return isBulletedList;
-        }
-
-        /**
-         * set isBulletedList
-         * @param isBL boolean value to set
-         */
-        public void setIsBulletedList(boolean isBL) {
-            isBulletedList = isBL;
-        }
-    }
+    private RtfListStyle defaultListStyle;
+    private Integer listTemplateId = null;
+    private Integer listId = null;
 
     /** Create an RTF list as a child of given container with given attributes */
     RtfList(RtfContainer parent, Writer w, RtfAttributes attr) throws IOException {
         super((RtfContainer)parent, w, attr);
-        numberingStyle = new NumberingStyle();
+
+        //random number generator for ids
+        Date runTime = new Date();
+        Random listIdGenerator = new Random(runTime.getTime());
+        listId = new Integer(listIdGenerator.nextInt());
+        listTemplateId = new Integer(listIdGenerator.nextInt());
+
         //create a new list table entry for the list
-        listTable = (getRtfFile()).startListTable(attr);
-        listTable.setParentList(this);
+        listTable = getRtfFile().startListTable(attr);
+        listTable.addList(this);
 
         // find out if we are nested in a table
         hasTableParent = this.getParentOfClass(RtfTable.class) != null;
     }
 
     /**
-     * Change numbering style
-     * @param ns NumberingSytle to set
-     */
-    public void setNumberingStyle(NumberingStyle ns) {
-        numberingStyle = ns;
-    }
-
-    /**
-     * Overridden to setup the list: start a group with appropriate attributes
-     * @throws IOException for I/O problems
-     */
-    protected void writeRtfPrefix() throws IOException {
-        // pard causes word97 (and sometimes 2000 too) to crash if the list is nested in a table
-        if (!hasTableParent) {
-            writeControlWord("pard");
-        }
-
-        writeOneAttribute(RtfText.LEFT_INDENT_FIRST, attrib.getValue(RtfListTable.LIST_INDENT));
-        writeOneAttribute(RtfText.LEFT_INDENT_BODY, attrib.getValue(RtfText.LEFT_INDENT_BODY));
-
-        // put the whole list in a group
-        writeGroupMark(true);
-
-        // group for list setup info
-        writeGroupMark(true);
-
-        writeStarControlWord("pn");
-        //Modified by Chris Scott
-        //fixes second line indentation
-
-        if (numberingStyle.isBulletedList) {
-            // bulleted list
-            writeControlWord("pnlvlblt");
-            writeControlWord("ilvl0");
-            writeOneAttribute(RtfListTable.LIST_NUMBER,
-            (listTable.getListNumber()).toString());
-            writeOneAttribute("pnindent",
-            attrib.getValue(RtfListTable.LIST_INDENT));
-            writeControlWord("pnf1");
-            writeGroupMark(true);
-            writeControlWord("pndec");
-            writeOneAttribute(RtfListTable.LIST_FONT_TYPE, "2");
-            writeControlWord("pntxtb");
-            writeControlWord("'b7");
-            writeGroupMark(false);
-        } else {
-            // numbered list
-            writeControlWord("pnlvlbody");
-            writeControlWord("ilvl0");
-            writeOneAttribute(RtfListTable.LIST_NUMBER,
-            (numberingStyle.isBulletedList) ? "2" : "0");
-            writeControlWord("pndec");
-            writeOneAttribute("pnstart",
-            attrib.getValue(RtfListTable.LIST_START_AT));
-            writeOneAttribute("pnindent",
-            attrib.getValue(RtfListTable.LIST_INDENT));
-            writeControlWord("pntxta.");
-        }
-
-        writeGroupMark(false);
-        writeOneAttribute(RtfListTable.LIST_NUMBER,
-        (listTable.getListNumber()).toString());
-    }
-
-    /**
-     * End the list group
-     * @throws IOException for I/O problems
-     */
-    protected void writeRtfSuffix() throws IOException {
-        // close group that encloses the whole list
-        writeGroupMark(false);
-
-        /* reset paragraph defaults to make sure list ends
-         * but pard causes word97 (and sometimes 2000 too) to crash if the list
-         * is nested in a table
-         */
-        if (!hasTableParent) {
-            writeControlWord("pard");
-        }
-    }
-
-    /**
      * Close current list item and start a new one
      * @return new RtfListItem
      * @throws IOException for I/O problems
@@ -206,10 +108,31 @@
         return item;
     }
 
+    public Integer getListId() {
+        return listId;
+    }
+    
+    public Integer getListTemplateId() {
+        return listTemplateId;
+    }
+    
+    /**
+     * Change list style
+     * @param ls ListStyle to set
+     */
+    public void setRtfListStyle(RtfListStyle ls) {
+        defaultListStyle = ls;
+    }
+
     /**
-     * @return true if this is a bulleted list (as opposed to numbered list)
+     * Get list style
+     * @return ListSytle of the List
      */
-    public boolean isBulletedList() {
-        return numberingStyle.isBulletedList;
+    public RtfListStyle getRtfListStyle() {
+        return defaultListStyle;
+    }
+    
+    public boolean getHasTableParent() {
+        return hasTableParent;
     }
 }
Index: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java,v
retrieving revision 1.1
diff -w -u -r1.1 RtfListItem.java
--- xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java	4 Nov 2003 23:59:11 -0000	1.1
+++ xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java	20 Nov 2003 12:46:53 -0000
@@ -60,6 +60,7 @@
 
 import java.io.Writer;
 import java.io.IOException;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
 
 /**  Model of an RTF list item, which can contain RTF paragraphs
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
@@ -67,9 +68,14 @@
  */
 public class RtfListItem
 extends RtfContainer
-implements IRtfParagraphContainer {
+implements IRtfTextrunContainer,
+           IRtfListContainer,
+           IRtfParagraphContainer {
+
     private RtfList parentList;
     private RtfParagraph paragraph;
+    private RtfListStyle listStyle;
+    private int number=0;
 
     /** special RtfParagraph that writes list item setup code before its content */
     private class RtfListItemParagraph extends RtfParagraph {
@@ -81,21 +87,32 @@
 
         protected void writeRtfPrefix() throws IOException {
             super.writeRtfPrefix();
-            // for bulleted list, add list item setup group before paragraph contents
-            if (parentList.isBulletedList()) {
-                writeGroupMark(true);
-                writeControlWord("pntext");
-                writeControlWord("f" + RtfFontManager.getInstance().getFontNumber("Symbol"));
-                writeControlWord("'b7");
-                writeControlWord("tab");
-                writeGroupMark(false);
-            } else {
-                writeGroupMark(true);
-                writeControlWord("pntext");
-                writeGroupMark(false);
+            listStyle.writeParagraphPrefix(this);
+        }
             }
+
+    public class RtfListItemLabel extends RtfTextrun implements IRtfTextrunContainer {
+        RtfListItem rtfListItem;
+        
+        public RtfListItemLabel(RtfListItem item) throws IOException {
+            super(null, item.writer, null); 
+            
+            rtfListItem=item;
         }
 
+        public RtfTextrun getTextrun() throws IOException {
+            return this;
+        }
+        
+        public void addString(String s) throws IOException {
+            
+            final String label = s.trim();
+            if(label.length() > 0 && Character.isDigit(label.charAt(0))) {
+                rtfListItem.setRtfListStyle(new RtfListStyleNumber());
+            } else {
+                rtfListItem.setRtfListStyle(new RtfListStyleText(label));
+            }
+        }
     }
 
     /** Create an RTF list item as a child of given container with default attributes */
@@ -104,12 +121,6 @@
         parentList = parent;
     }
 
-    /** Create an RTF list item as a child of given container with given attributes */
-    RtfListItem(RtfList parent, Writer w, RtfAttributes attr) throws IOException {
-        super((RtfContainer)parent, w, attr);
-        parentList = parent;
-    }
-
     /**
      * Close current paragraph if any and start a new one
      * @param attrs attributes of new paragraph
@@ -133,4 +144,101 @@
         return newParagraph(null);
     }
 
+    /** Create an RTF list item as a child of given container with given attributes */
+    RtfListItem(RtfList parent, Writer w, RtfAttributes attr) throws IOException {
+        super((RtfContainer)parent, w, attr);
+        parentList = parent;
+    }
+
+    public RtfTextrun getTextrun()
+    throws IOException {
+        RtfTextrun textrun=RtfTextrun.getTextrun(this, writer, null);
+        textrun.setRtfListItem(this);
+        return textrun;
+    }
+    
+    /**
+     * Start a new list after closing current paragraph, list and table
+     * @param attrs attributes of new RftList object
+     * @return new RtfList
+     * @throws IOException for I/O problems
+     */
+    public RtfList newList(RtfAttributes attrs) throws IOException {
+        RtfList list = new RtfList(this, writer, attrs);
+        return list;
+    }
+    
+    /**
+     * Overridden to setup the list: start a group with appropriate attributes
+     * @throws IOException for I/O problems
+     */
+    protected void writeRtfPrefix() throws IOException {
+       
+        // pard causes word97 (and sometimes 2000 too) to crash if the list is nested in a table
+        if (!parentList.getHasTableParent()) {
+            writeControlWord("pard");
+        }
+
+        writeOneAttribute(RtfText.LEFT_INDENT_FIRST, attrib.getValue(RtfListTable.LIST_INDENT));
+        writeOneAttribute(RtfText.LEFT_INDENT_BODY, attrib.getValue(RtfText.LEFT_INDENT_BODY));
+
+        // group for list setup info
+        writeGroupMark(true);
+
+        writeStarControlWord("pn");
+        //Modified by Chris Scott
+        //fixes second line indentation
+        getRtfListStyle().writeListPrefix(this);
+
+        writeGroupMark(false);
+        writeOneAttribute(RtfListTable.LIST_NUMBER,new Integer(number));
+    }
+    
+    /**
+     * End the list group
+     * @throws IOException for I/O problems
+     */
+    protected void writeRtfSuffix() throws IOException {
+        super.writeRtfSuffix();
+
+        /* reset paragraph defaults to make sure list ends
+         * but pard causes word97 (and sometimes 2000 too) to crash if the list
+         * is nested in a table
+         */ 
+        if (!parentList.getHasTableParent()) {
+            writeControlWord("pard");
+        }
+        
+    }
+       
+    /**
+     * Change list style
+     * @param ls ListStyle to set
+     */
+    public void setRtfListStyle(RtfListStyle ls) {
+        listStyle = ls;
+        
+        listStyle.setRtfListItem(this);
+        number = getRtfFile().getListTable().addRtfListStyle(ls);
+    }
+
+    /**
+     * Get list style
+     * @return ListSytle of the List
+     */    
+    public RtfListStyle getRtfListStyle() {
+        if(listStyle==null) {
+            return parentList.getRtfListStyle();
+        } else {
+            return listStyle;
+        }
+    }
+  
+    public RtfList getParentList() {
+        return parentList;
+    }
+    
+    public int getNumber() {
+        return number;
+    }
 }
Index: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java,v
retrieving revision 1.1
diff -w -u -r1.1 RtfListTable.java
--- xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java	4 Nov 2003 23:59:11 -0000	1.1
+++ xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java	20 Nov 2003 12:46:53 -0000
@@ -58,8 +58,9 @@
 
 package org.apache.fop.render.rtf.rtflib.rtfdoc;
 
-import java.util.Date;
-import java.util.Random;
+import java.util.LinkedList;
+import java.util.Iterator;
+import java.util.LinkedList;
 import java.io.Writer;
 import java.io.IOException;
 //import org.apache.fop.render.rtf.rtflib.jfor.main.JForVersionInfo;
@@ -71,13 +72,9 @@
  * @author Christopher Scott, scottc@westinghouse.com
  */
 public class RtfListTable extends RtfContainer {
+    private LinkedList lists;
+    private LinkedList styles;
 
-    /** number of list in document */
-    private Integer listNum;
-    /** id of list */
-    private Integer listId;
-    private Integer listTemplateId;
-    private RtfList parentList;
 //static data members
     /** constant for a list table */
     public static final String LIST_TABLE = "listtable";
@@ -140,49 +137,22 @@
     public RtfListTable(RtfContainer parent, Writer w, Integer num, RtfAttributes attrs)
     throws IOException {
         super(parent, w, attrs);
-        listNum = new Integer(num.intValue());
-        //random number generator for ids
-        Date runTime = new Date();
-        Random listIdGenerator = new Random(runTime.getTime());
-        listId = new Integer(listIdGenerator.nextInt());
-        attrib.set(LIST_ID, listId.toString());
-        listTemplateId = new Integer(listIdGenerator.nextInt());
-        attrib.set(LIST_NUMBER_TYPE, 0);
-    }
 
-    /**
-     * Set parentList
-     * @param parent parentList to set
-     */
-    public void setParentList(RtfList parent) {
-        parentList = parent;
+        styles=new LinkedList();
     }
 
     /**
-     * Accessor for listNum
-     * @return listNum
-     */
-    public Integer getListNumber() {
-        return listNum;
-    }
-
-    /** Set whether the list is a bulleted list not, and set attributes
-     * accordingly */
-    private void setListType() {
-        if (parentList.isBulletedList()) {
-            // bullet definition for bulleted lists
-            // Chris Scott's version was "\\\'01\\u-3913 ?;"
-            // 'b7 is what was used in jfor V0.5.2
-            attrib.set(LIST_TEXT_FORM, "\\\'01\\'b7 ?;");
-            attrib.set(LIST_NUM_POSITION);
-            attrib.set(LIST_NUMBER_TYPE, 23);
-            attrib.set(LIST_FONT_TYPE, 2);
-        } else {
-            attrib.set(LIST_TEXT_FORM, "\\\'03\\\'00. ;");
-            attrib.set(LIST_NUM_POSITION, "\\\'01;");
-            attrib.set(LIST_NUMBER_TYPE, 0);
-            attrib.set(LIST_FONT_TYPE, 0);
+     * Add List
+     * @param list RtfList to add
+     */
+    public int addList(RtfList list) {
+        if(lists == null) {
+            lists=new LinkedList();
         }
+
+        lists.add(list);
+        
+        return lists.size();
     }
 
     /**
@@ -190,55 +160,86 @@
      * @throws IOException for I/O problems
      */
     public void writeRtfContent() throws IOException {
-        setListType();
+        if(lists!=null) {
+            //write '\listtable'
         writeGroupMark(true);
         writeStarControlWordNS(LIST_TABLE);
+            for (Iterator it = lists.iterator(); it.hasNext();) {
+                final RtfList list = (RtfList)it.next();
+                writeListTableEntry(list);
+            }
+            writeGroupMark(false);
+                
+            //write '\listoveridetable'
         writeGroupMark(true);
+            writeStarControlWordNS(LIST_OVR_TABLE);
+            int z=1;
+            
+            for (Iterator it = styles.iterator(); it.hasNext();) {
+                final RtfListStyle style = (RtfListStyle)it.next();
+                        
+                writeGroupMark(true);
+                writeStarControlWordNS(LIST_OVR);
+                writeGroupMark(true);
+        
+                writeOneAttributeNS(LIST_ID, style.getRtfList().getListId().toString());
+                writeOneAttributeNS(LIST_OVR_COUNT, new Integer(0));
+                writeOneAttributeNS(LIST_NUMBER, new Integer(z++));
 
+                writeGroupMark(false);
+                writeGroupMark(false);
+            }
+            
+            writeGroupMark(false);
+        }
+    }
+
+    /**
+     * Since this has no text content we have to overwrite isEmpty to print
+     * the table
+     * @return false (always)
+     */
+    public boolean isEmpty() {
+        return false;
+    }
+    
+    private void writeListTableEntry(RtfList list)
+    throws IOException {
+        //write list-specific attributes
+        writeGroupMark(true);
         writeControlWordNS(LIST);
-        writeOneAttributeNS(LIST_TEMPLATE_ID, listTemplateId.toString());
+        writeOneAttributeNS(LIST_TEMPLATE_ID, list.getListTemplateId().toString());
         writeOneAttributeNS(LIST, attrib.getValue(LIST));
+        
+        // write level-specific attributes
         writeGroupMark(true);
         writeControlWordNS(LIST_LEVEL);
-        writeOneAttributeNS(LIST_NUMBER_TYPE, attrib.getValue(LIST_NUMBER_TYPE));
+        
         writeOneAttributeNS(LIST_JUSTIFICATION, attrib.getValue(LIST_JUSTIFICATION));
         writeOneAttributeNS(LIST_FOLLOWING_CHAR, attrib.getValue(LIST_FOLLOWING_CHAR));
-        writeOneAttributeNS(LIST_START_AT, attrib.getValue(LIST_START_AT));
         writeOneAttributeNS(LIST_SPACE, new Integer(0));
         writeOneAttributeNS(LIST_INDENT, attrib.getValue(LIST_INDENT));
-        writeGroupMark(true);
-        writeOneAttributeNS(LIST_TEXT_FORM, attrib.getValue(LIST_TEXT_FORM));
-        writeGroupMark(false);
-        writeGroupMark(true);
-        writeOneAttributeNS(LIST_NUM_POSITION, attrib.getValue(LIST_NUM_POSITION));
-        writeGroupMark(false);
-        writeOneAttributeNS(LIST_FONT_TYPE, attrib.getValue(LIST_FONT_TYPE));
+        
+        RtfListItem item=(RtfListItem)list.getChildren().get(0);
+        item.getRtfListStyle().writeLevelGroup(this);
+        
         writeGroupMark(false);
+        
         writeGroupMark(true);
         writeControlWordNS(LIST_NAME);
         writeGroupMark(false);
-        writeOneAttributeNS(LIST_ID, listId.toString());
-        writeGroupMark(false);
-        writeGroupMark(false);
-        writeGroupMark(true);
-        writeStarControlWordNS(LIST_OVR_TABLE);
-        writeGroupMark(true);
-        writeControlWordNS(LIST_OVR);
-        writeOneAttributeNS(LIST_ID, listId.toString());
-        writeOneAttributeNS(LIST_OVR_COUNT, new Integer(0));
-        writeOneAttributeNS(LIST_NUMBER, listNum.toString());
-        writeGroupMark(false);
+        
+        writeOneAttributeNS(LIST_ID, list.getListId().toString());
+                
         writeGroupMark(false);
     }
 
     /**
-     * Since this has no text content we have to overwrite isEmpty to print
-     * the table
-     * @return false (always)
+     * Change list style
+     * @param ls ListStyle to set
      */
-    public boolean isEmpty() {
-        return false;
+    public int addRtfListStyle(RtfListStyle ls) {
+        styles.add(ls);
+        return styles.size();
     }
-
-
 }
Index: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java,v
retrieving revision 1.4
diff -w -u -r1.4 RtfTextrun.java
--- xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java	8 Nov 2003 19:58:03 -0000	1.4
+++ xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java	20 Nov 2003 12:46:54 -0000
@@ -56,11 +56,15 @@
 
 package org.apache.fop.render.rtf.rtflib.rtfdoc;
 
+// Java
 import java.io.IOException;
 import java.io.Writer;
 import java.util.List;
 import java.util.Iterator;
+
+// FOP
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList;
 
 /** 
  * Class which contains a linear text run. It has methods to add attributes, 
@@ -69,6 +73,7 @@
  */
 public class RtfTextrun extends RtfContainer {
     private boolean bSuppressLastPar = false;
+    private RtfListItem rtfListItem;
     
     /**  Class which represents the opening of a RTF group mark.*/
     private class RtfOpenGroupMark extends RtfElement {
@@ -258,6 +263,10 @@
         //may contain for example \intbl
         writeAttributes(attrib, null);
         
+        if(rtfListItem!=null) {
+            rtfListItem.getRtfListStyle().writeParagraphPrefix(this);
+        }
+        
         //write all children
         boolean bPrevPar = false;
         boolean bFirst = true;
@@ -283,6 +292,10 @@
                 
             if (!bHide) {
                 e.writeRtf(); 
+                
+                if (rtfListItem!=null && e instanceof RtfParagraphBreak) {
+                    rtfListItem.getRtfListStyle().writeParagraphPrefix(this);
+                }
             }
             
             if (e instanceof RtfParagraphBreak) {
@@ -296,6 +309,14 @@
                 bFirst = bFirst && e.isEmpty();
             }
         }
+    }
+    
+    public void setRtfListItem(RtfListItem listItem) {
+        rtfListItem=listItem;
+    }
+    
+    public RtfListItem getRtfListItem() {
+        return rtfListItem;
     }
 }
 
Index: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java,v
retrieving revision 1.1
diff -w -u -r1.1 SimpleLists.java
--- xml-fop/src/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java	4 Nov 2003 23:59:13 -0000	1.1
+++ xml-fop/src/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java	20 Nov 2003 12:46:55 -0000
@@ -64,6 +64,8 @@
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListStyle;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListStyleNumber;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
 
 /**  Generates a simple RTF test document for the jfor rtflib package.
@@ -82,16 +84,14 @@
         sect.newParagraph().newText("Normal paragraph after list 2.");
 
         sect.newParagraph().newText("Now a numbered list (4 items):");
-        final RtfList.NumberingStyle nn = new RtfList.NumberingStyle();
-        nn.setIsBulletedList(false);
-        makeList(sect, 3, 4, nn);
+        makeList(sect, 3, 4, new RtfListStyleNumber());
     }
 
-    private void makeList(RtfSection sect, int listIndex, int nItems, RtfList.NumberingStyle ns)
+    private void makeList(RtfSection sect, int listIndex, int nItems, RtfListStyle ls)
     throws IOException {
         final RtfList list = sect.newList(null);
-        if (ns != null) {
-            list.setNumberingStyle(ns);
+        if (ls != null) {
+            list.setRtfListStyle(ls);
         }
         for (int i = 0; i < nItems; i++) {
             final RtfListItem item = list.newListItem();
