Index: fo/FOInputHandler.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/FOInputHandler.java,v
retrieving revision 1.10
diff -w -u -r1.10 FOInputHandler.java
--- fo/FOInputHandler.java	19 Sep 2003 18:17:40 -0000	1.10
+++ fo/FOInputHandler.java	28 Oct 2003 22:49:49 -0000
@@ -57,6 +57,7 @@
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.ExternalGraphic;
+import org.apache.fop.fo.flow.Inline;
 import org.apache.fop.fo.flow.InstreamForeignObject;
 import org.apache.fop.fo.flow.Leader;
 import org.apache.fop.fo.flow.ListBlock;
@@ -170,6 +171,17 @@
      */
     public abstract void endBlock(Block bl);
 
+    /**
+     *
+     * @param inl Inline that is starting.
+     */
+    public abstract void startInline(Inline inl);
+
+    /**
+     *
+     * @param inl Inline that is ending.
+     */
+    public abstract void endInline(Inline inl);
 
     // Tables
     /**
Index: fo/FOTreeHandler.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/FOTreeHandler.java,v
retrieving revision 1.9
diff -w -u -r1.9 FOTreeHandler.java
--- fo/FOTreeHandler.java	19 Sep 2003 18:17:40 -0000	1.9
+++ fo/FOTreeHandler.java	28 Oct 2003 22:49:49 -0000
@@ -62,6 +62,7 @@
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.ExternalGraphic;
 import org.apache.fop.fo.flow.InstreamForeignObject;
+import org.apache.fop.fo.flow.Inline;
 import org.apache.fop.fo.flow.Leader;
 import org.apache.fop.fo.flow.ListBlock;
 import org.apache.fop.fo.flow.ListItem;
@@ -237,6 +238,20 @@
      * @see org.apache.fop.fo.FOInputHandler#endBlock(Block)
      */
     public void endBlock(Block bl) {
+    }
+    
+    /**
+     *
+     * @param inl Inline that is starting.
+     */
+    public void startInline(Inline inl){
+    }
+
+    /**
+     *
+     * @param inl Inline that is ending.
+     */
+    public void endInline(Inline inl){
     }
 
     /**
Index: fo/flow/Inline.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/Inline.java,v
retrieving revision 1.5
diff -w -u -r1.5 Inline.java
--- fo/flow/Inline.java	16 Sep 2003 05:21:05 -0000	1.5
+++ fo/flow/Inline.java	28 Oct 2003 22:49:50 -0000
@@ -146,6 +146,8 @@
         if (textDecoration == TextDecoration.LINE_THROUGH) {
             this.lineThrough = true;
         }
+        
+        getFOTreeControl().getFOInputHandler().startInline(this);
     }
 
     /**
@@ -164,6 +166,13 @@
 
     public void acceptVisitor(FOTreeVisitor fotv) {
         fotv.serveInline(this);
+    }
+
+    /**
+     * @see org.apache.fop.fo.FONode#end
+     */
+    public void end() {
+        getFOTreeControl().getFOInputHandler().endInline(this);
     }
 
 }
Index: mif/MIFHandler.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/mif/MIFHandler.java,v
retrieving revision 1.14
diff -w -u -r1.14 MIFHandler.java
--- mif/MIFHandler.java	19 Sep 2003 18:17:40 -0000	1.14
+++ mif/MIFHandler.java	28 Oct 2003 22:49:51 -0000
@@ -60,6 +60,7 @@
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.ExternalGraphic;
 import org.apache.fop.fo.flow.InstreamForeignObject;
+import org.apache.fop.fo.flow.Inline;
 import org.apache.fop.fo.flow.Leader;
 import org.apache.fop.fo.flow.ListBlock;
 import org.apache.fop.fo.flow.ListItem;
@@ -220,6 +221,20 @@
     public void endBlock(Block bl) {
         para.finish(true);
         para = null;
+    }
+
+    /**
+     *
+     * @param inl Inline that is starting.
+     */
+    public void startInline(Inline inl){
+    }
+
+    /**
+     *
+     * @param inl Inline that is ending.
+     */
+    public void endInline(Inline inl){
     }
 
     /**
Index: rtf/rtflib/rtfdoc/WhitespaceCollapser.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/WhitespaceCollapser.java,v
retrieving revision 1.3
diff -w -u -r1.3 WhitespaceCollapser.java
--- rtf/rtflib/rtfdoc/WhitespaceCollapser.java	30 Jun 2003 01:31:16 -0000	1.3
+++ rtf/rtflib/rtfdoc/WhitespaceCollapser.java	28 Oct 2003 22:49:51 -0000
@@ -73,11 +73,13 @@
     WhitespaceCollapser(RtfContainer c) {
         // process all texts
         for (Iterator it = c.getChildren().iterator(); it.hasNext();) {
-            RtfText current = null;
             final Object kid = it.next();
             if (kid instanceof RtfText) {
-                current = (RtfText)kid;
+                RtfText current = (RtfText)kid;
                 processText(current);
+            } else if (kid instanceof RtfString) {
+                RtfString current = (RtfString)kid;
+                processString(current);
             } else {
                 // if there is something between two texts, it counts for a space
                 lastEndSpace = true;
@@ -87,11 +89,29 @@
 
     /** process one RtfText from our container */
     private void processText(RtfText txt) {
-        final String orig = txt.getText();
+        final String newString=processString(txt.getText());
+        if(newString!=null) {
+            txt.setText(newString);
+        }
+    }
+    
+    /** process one RtfString from our container */
+    private void processString(RtfString txt) {
+        final String newString=processString(txt.getText());
+        if(newString!=null) {
+            txt.setText(newString);
+        }
+    }
+    
+    /** process one String */
+    private String processString(String txt) {
+        final String orig = txt;
 
         // tokenize the text based on whitespace and regenerate it so as
         // to collapse multiple spaces into one
-        if (orig != null && orig.length() > 0) {
+        if(orig==null) {
+            return null;
+        } else if (orig.length() > 0) { 
             final boolean allSpaces = orig.trim().length() == 0;
             final boolean endSpace = allSpaces
                                      || Character.isWhitespace(orig.charAt(orig.length() - 1));
@@ -107,7 +127,7 @@
                 // TODO to be compatible with different Locales, should use Character.isWhitespace
                 // instead of this limited list
                 boolean first = true;
-                final StringTokenizer stk = new StringTokenizer(txt.getText(), " \t\n\r");
+                final StringTokenizer stk = new StringTokenizer(txt, " \t\n\r");
                 while (stk.hasMoreTokens()) {
                     if (first && beginSpace && !lastEndSpace) {
                         sb.append(SPACE);
@@ -121,8 +141,10 @@
                 }
             }
 
-            txt.setText(sb.toString());
             lastEndSpace = endSpace;
+            return sb.toString();
+        } else {
+            return "";
         }
     }
 }
Index: rtf/rtflib/rtfdoc/RtfTableCell.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableCell.java,v
retrieving revision 1.8
diff -w -u -r1.8 RtfTableCell.java
--- rtf/rtflib/rtfdoc/RtfTableCell.java	3 Jul 2003 19:14:46 -0000	1.8
+++ rtf/rtflib/rtfdoc/RtfTableCell.java	28 Oct 2003 22:49:52 -0000
@@ -70,7 +70,7 @@
 public class RtfTableCell
 extends RtfContainer
 implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer,
-       IRtfExternalGraphicContainer {
+       IRtfExternalGraphicContainer, IRtfTextrunContainer {
     private RtfParagraph paragraph;
     private RtfList list;
     private RtfTable table;
@@ -474,5 +474,13 @@
             }
         }
         return result;
+    }
+    
+    public RtfTextrun getTextrun()
+    throws IOException {
+        RtfAttributes attrs = new RtfAttributes();
+        attrs.set("intbl");
+        
+        return RtfTextrun.getTextrun(this, writer, attrs);
     }
 }
Index: rtf/rtflib/rtfdoc/RtfSection.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfSection.java,v
retrieving revision 1.9
diff -w -u -r1.9 RtfSection.java
--- rtf/rtflib/rtfdoc/RtfSection.java	15 Oct 2003 17:00:58 -0000	1.9
+++ rtf/rtflib/rtfdoc/RtfSection.java	28 Oct 2003 22:49:53 -0000
@@ -76,7 +76,8 @@
     IRtfBeforeContainer,
     IRtfParagraphKeepTogetherContainer,
     IRtfAfterContainer,
-    IRtfJforCmdContainer {
+    IRtfJforCmdContainer,
+    IRtfTextrunContainer {
     private RtfParagraph paragraph;
     private RtfTable table;
     private RtfList list;
@@ -261,5 +262,10 @@
         closeCurrentList();
         closeCurrentExternalGraphic();
         closeCurrentBefore();
+    }
+    
+    public RtfTextrun getTextrun()
+    throws IOException {
+        return RtfTextrun.getTextrun(this, writer, null);
     }
 }
Index: rtf/rtflib/rtfdoc/RtfPageNumber.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java,v
retrieving revision 1.7
diff -w -u -r1.7 RtfPageNumber.java
--- rtf/rtflib/rtfdoc/RtfPageNumber.java	3 Jul 2003 17:44:01 -0000	1.7
+++ rtf/rtflib/rtfdoc/RtfPageNumber.java	28 Oct 2003 22:49:53 -0000
@@ -83,6 +83,12 @@
         super((RtfContainer)parent, w);
     }
 
+    /** Create an RTF page number as a child of given container with given attributes */
+     RtfPageNumber(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException {
+         // Adds the attributes of the parent paragraph
+         super(parent, w, attrs);
+     }
+
     /** Create an RTF page number as a child of given paragraph,
      *  copying the paragraph attributes
      */
Index: rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java,v
retrieving revision 1.7
diff -w -u -r1.7 RtfAfterBeforeBase.java
--- rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java	2 Jul 2003 16:59:53 -0000	1.7
+++ rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java	28 Oct 2003 22:49:53 -0000
@@ -70,7 +70,8 @@
 
 abstract class RtfAfterBeforeBase
 extends RtfContainer
-implements IRtfParagraphContainer, IRtfExternalGraphicContainer, IRtfTableContainer {
+implements IRtfParagraphContainer, IRtfExternalGraphicContainer, IRtfTableContainer,
+        IRtfTextrunContainer {
     protected RtfAttributes attrib;
     private RtfParagraph para;
     private RtfExternalGraphic externalGraphic;
@@ -154,5 +155,10 @@
         closeAll();
         table = new RtfTable(this, writer, tc);
         return table;
+    }
+    
+    public RtfTextrun getTextrun()
+    throws IOException {
+        return RtfTextrun.getTextrun(this, writer, null);
     }
 }
Index: rtf/rtflib/rtfdoc/RtfText.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java,v
retrieving revision 1.6
diff -w -u -r1.6 RtfText.java
--- rtf/rtflib/rtfdoc/RtfText.java	4 Jul 2003 07:04:50 -0000	1.6
+++ rtf/rtflib/rtfdoc/RtfText.java	28 Oct 2003 22:49:54 -0000
@@ -143,6 +143,8 @@
     public static final String LEFT_INDENT_BODY = "li";
     /** constant for left indent first */
     public static final String LEFT_INDENT_FIRST = "fi-";
+    /** constant for right indent body */
+    public static final String RIGHT_INDENT_BODY = "ri";
 
     /** constant for center tab */
     public static final String TAB_CENTER = "tqc\\tx";
