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 ph...@apache.org on 2012/05/28 17:31:36 UTC
svn commit: r1343285 [20/24] - in
/xmlgraphics/fop/branches/Temp_URI_Unification: ./ conf/
examples/embedding/ examples/embedding/java/embedding/
examples/embedding/java/embedding/tools/ lib/
src/codegen/java/org/apache/fop/tools/ src/codegen/unicode/j...
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java Mon May 28 15:30:46 2012
@@ -26,14 +26,15 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
/**
- * RTF Bookmark.
+ * <p>RTF Bookmark.
* Create an RTF bookmark as a child of given container with default attributes.
- * This class belongs to the "id" attribute processing.
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
+ * This class belongs to the "id" attribute processing.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public class RtfBookmark extends RtfElement {
//////////////////////////////////////////////////
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java Mon May 28 15:30:46 2012
@@ -26,14 +26,15 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
/**
- * RTF Bookmark container implementation.
+ * <p>RTF Bookmark container implementation.
* Nearly all containers or elements can have a bookmark, that is why the bookmark container is
- * implemented as stand alone.
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
+ * implemented as stand alone.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public class RtfBookmarkContainerImpl extends RtfContainer implements IRtfBookmarkContainer {
//////////////////////////////////////////////////
@@ -99,4 +100,4 @@ public class RtfBookmarkContainerImpl ex
return mBookmark;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java Mon May 28 15:30:46 2012
@@ -26,14 +26,15 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.util.Vector;
-import java.util.Hashtable;
import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Vector;
/**
- * Singelton of the RTF color table.
- * This class was created for <fo:basic-link> tag processing.
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
+ * <p>Singelton of the RTF color table.
+ * This class was created for <fo:basic-link> tag processing.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public final class RtfColorTable {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java Mon May 28 15:30:46 2012
@@ -26,15 +26,18 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
+import java.io.IOException;
import java.io.Writer;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Iterator;
-import java.io.IOException;
+
import org.apache.fop.render.rtf.rtflib.exceptions.RtfStructureException;
-/** An RtfElement that can contain other elements.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>An RtfElement that can contain other elements.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfContainer extends RtfElement {
@@ -109,6 +112,30 @@ public class RtfContainer extends RtfEle
return children.size();
}
+ private int findChildren(RtfElement aChild, int iStart) {
+ for (Iterator it = this.getChildren().iterator(); it.hasNext();) {
+ final RtfElement e = (RtfElement)it.next();
+ if (aChild == e) {
+ return iStart;
+ } else if (e instanceof RtfContainer) {
+ int iFound = ((RtfContainer)e).findChildren(aChild, (iStart + 1));
+ if (iFound != -1) {
+ return iFound;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Find the passed child in the current container
+ * @param aChild the child element
+ * @return the depth (nested level) inside the current container
+ */
+ public int findChildren(RtfElement aChild) {
+ return findChildren(aChild, 0);
+ }
+
/**
* Add by Boris Poudérous on 07/22/2002
* Set the children list
@@ -204,4 +231,4 @@ public class RtfContainer extends RtfEle
}
return result;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java Mon May 28 15:30:46 2012
@@ -26,11 +26,13 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
-/** The RTF document area, container for RtfSection objects.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>The RTF document area, container for RtfSection objects.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfDocumentArea
@@ -54,4 +56,4 @@ extends RtfContainer {
currentSection = new RtfSection(this, writer);
return currentSection;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java Mon May 28 15:30:46 2012
@@ -26,14 +26,15 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
import java.util.Iterator;
-//import org.apache.fop.render.rtf.rtflib.jfor.main.JForVersionInfo;
-/** Base class for all elements of an RTF file.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- * @author Andreas Putz a.putz@skynamics.com
+/**
+ * <p>Base class for all elements of an RTF file.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch)
+ * and Andreas Putz (a.putz@skynamics.com).</p>
*/
public abstract class RtfElement {
/** Writer to be used */
@@ -298,7 +299,7 @@ public abstract class RtfElement {
/** find the first parent where c.isAssignableFrom(parent.getClass()) is true
* @return null if not found
*/
- RtfElement getParentOfClass(Class c) {
+ public RtfElement getParentOfClass(Class c) {
RtfElement result = null;
RtfElement current = this;
while (current.parent != null) {
@@ -347,4 +348,4 @@ public abstract class RtfElement {
public RtfAttributes getRtfAttributes() {
return attrib;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java Mon May 28 15:30:46 2012
@@ -39,23 +39,27 @@ import org.apache.fop.render.rtf.rtflib.
import org.apache.fop.render.rtf.rtflib.tools.ImageUtil;
/**
- * Creates an RTF image from an external graphic file.
- * This class belongs to the <fo:external-graphic> tag processing. <br>
+ * <p>Creates an RTF image from an external graphic file.
+ * This class belongs to the <fo:external-graphic> tag processing.</p>
*
- * Supports relative path like "../test.gif", too (01-08-24) <br>
+ * <p>Supports relative path like "../test.gif", too (01-08-24)</p>
*
- * Limitations:
+ * <p>Limitations:</p>
+ * <ul>
* <li> Only the image types PNG, JPEG and EMF are supported
* <li> The GIF is supported, too, but will be converted to JPG
* <li> Only the attributes SRC (required), WIDTH, HEIGHT, SCALING are supported
* <li> The SCALING attribute supports (uniform | non-uniform)
+ * </ul>
*
- * Known Bugs:
+ * <p>Known Bugs:</p>
+ * <ul>
* <li> If the emf image has a desired size, the image will be clipped
* <li> The emf, jpg & png image will not be displayed in correct size
+ * </ul>
*
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
- * @author Gianugo Rabellino gianugo@rabellino.it
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com) and
+ * Gianugo Rabellino (gianugo@rabellino.it).</p>
*/
public class RtfExternalGraphic extends RtfElement {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java Mon May 28 15:30:46 2012
@@ -26,26 +26,29 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Iterator;
+import java.io.Writer;
import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
/**
- * Used to add extra table rows after a row that contains a nested table:
+ * <p>Used to add extra table rows after a row that contains a nested table:</p>
+ * <ul>
* <li> created by RtfTableRow before generating RTF code
* <li> an RtfTableCell that contains a nested table can ask this to put
* some of its children in extra rows that after the current row
* <li> once RtfTableRow is done rendering its children, it renders this,
* causing extra rows to be generated, with content that can come
* from several RtfTableCells
+ * </ul>
+ *
+ * <p>See org.apache.fop.rtf.rtflib.testdocs.NestedTable for an example of
+ * usage.</p>
*
- * See org.apache.fop.rtf.rtflib.testdocs.NestedTable for an example of
- * usage.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfExtraRowSet extends RtfContainer {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java Mon May 28 15:30:46 2012
@@ -26,18 +26,20 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import org.apache.fop.render.rtf.rtflib.exceptions.RtfStructureException;
-import java.io.Writer;
-import java.io.IOException;
import java.io.BufferedWriter;
import java.io.FileWriter;
+import java.io.IOException;
import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import org.apache.fop.render.rtf.rtflib.exceptions.RtfStructureException;
/**
- * Models the top-level structure of an RTF file.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- * @author Andreas Putz a.putz@skynamics.com
- * @author Christopher Scott scottc@westinghouse.com
+ * <p>Models the top-level structure of an RTF file.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Andreas Putz (a.putz@skynamics.com), and
+ * Christopher Scott (scottc@westinghouse.com).</p>
*/
public class RtfFile
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java Mon May 28 15:30:46 2012
@@ -31,8 +31,9 @@ import java.util.Hashtable;
import java.util.Vector;
/**
- * RTF font table
- * @author Andreas Putz a.putz@skynamics.com
+ * <p>RTF font table.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public final class RtfFontManager {
//////////////////////////////////////////////////
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontTable.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontTable.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontTable.java Mon May 28 15:30:46 2012
@@ -26,12 +26,14 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
-/** RTF font table
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- * @author Andreas Putz a.putz@skynamics.com
+/**
+ * <p>RTF font table.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch)
+ * and Andreas Putz (a.putz@skynamics.com).</p>
*/
class RtfFontTable extends RtfElement {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java Mon May 28 15:30:46 2012
@@ -19,16 +19,14 @@
package org.apache.fop.render.rtf.rtflib.rtfdoc;
-//Java
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
-//FOP
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
-
-/** Model of an RTF footnote
- * @author Peter Herweg, pherweg@web.de
- * @author Marc Wilhelm Kuester
+/**
+ * <p>Model of an RTF footnote.</p>
+ *
+ * <p>This work was authored by Peter Herweg (pherweg@web.de) and
+ * Marc Wilhelm Kuester.</p>
*/
public class RtfFootnote extends RtfContainer
implements IRtfTextrunContainer, IRtfListContainer {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java Mon May 28 15:30:46 2012
@@ -26,17 +26,18 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.util.Map;
+import java.io.IOException;
+import java.io.Writer;
import java.util.HashMap;
import java.util.Iterator;
-import java.io.Writer;
-import java.io.IOException;
-//import org.apache.fop.render.rtf.rtflib.jfor.main.JForVersionInfo;
+import java.util.Map;
-/** RTF file header, contains style, font and other document-level information.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- * @author Andreas Putz a.putz@skynamics.com
- * @author Marc Wilhelm Kuester
+/**
+ * <p>RTF file header, contains style, font and other document-level information.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Andreas Putz (a.putz@skynamics.com), and
+ * Marc Wilhelm Kuester.</p>
*/
class RtfHeader extends RtfContainer {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java Mon May 28 15:30:46 2012
@@ -26,15 +26,16 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.fop.apps.FOPException;
/**
- * Creates an hyperlink.
- * This class belongs to the <fo:basic-link> tag processing.
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
+ * <p>Creates an hyperlink.
+ * This class belongs to the <fo:basic-link> tag processing.</p>
*
- * {\field {\*\fldinst HYPERLINK "http://www.test.de" }{\fldrslt Joe Smith}}
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public class RtfHyperLink
extends RtfContainer
@@ -158,12 +159,17 @@ implements IRtfTextContainer,
/**
* IRtfTextContainer requirement:
* @return a copy of our attributes
+ * @throws FOPException if attributes cannot be cloned
*/
- public RtfAttributes getTextContainerAttributes() {
+ public RtfAttributes getTextContainerAttributes() throws FOPException {
if (attrib == null) {
return null;
}
- return (RtfAttributes) this.attrib.clone ();
+ try {
+ return (RtfAttributes) this.attrib.clone ();
+ } catch (CloneNotSupportedException e) {
+ throw new FOPException(e);
+ }
}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java Mon May 28 15:30:46 2012
@@ -26,9 +26,9 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
+import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
-import java.io.IOException;
/**
* Process "jfor-cmd"
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java Mon May 28 15:30:46 2012
@@ -182,9 +182,7 @@ public class RtfLeader extends RtfContai
writeGroupMark(false);
- }
- // Using white spaces with different underline formats
- else {
+ } else { // Using white spaces with different underline formats
writeControlWord(LEADER_IGNORE_STYLE);
writeControlWord(LEADER_ZERO_WIDTH);
writeGroupMark(true);
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLineBreak.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLineBreak.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLineBreak.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLineBreak.java Mon May 28 15:30:46 2012
@@ -26,11 +26,13 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
-/** "Model" of an RTF line break
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Model of an RTF line break.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfLineBreak extends RtfElement {
@@ -51,4 +53,4 @@ public class RtfLineBreak extends RtfEle
public boolean isEmpty() {
return false;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java Mon May 28 15:30:46 2012
@@ -31,10 +31,11 @@ import java.io.Writer;
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
+ * <p>Model of an RTF list, which can contain RTF list items.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Christopher Scott (scottc@westinghouse.com), and
+ * Peter Herweg (pherweg@web.de).</p>
*/
public class RtfList extends RtfContainer {
private RtfListItem item;
@@ -115,4 +116,4 @@ public class RtfList extends RtfContaine
public boolean getHasTableParent() {
return hasTableParent;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java Mon May 28 15:30:46 2012
@@ -26,14 +26,14 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
-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
- * @author Andreas Putz a.putz@skynamics.com
+/**
+ * <p>Model of an RTF list item, which can contain RTF paragraphs.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch)
+ * and Andreas Putz (a.putz@skynamics.com).</p>
*/
public class RtfListItem extends RtfContainer
implements IRtfTextrunContainer,
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyle.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyle.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyle.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyle.java Mon May 28 15:30:46 2012
@@ -29,9 +29,6 @@ package org.apache.fop.render.rtf.rtflib
//Java
import java.io.IOException;
-//FOP
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement;
-
/**
* Class to handle list styles.
*/
@@ -87,4 +84,4 @@ public class RtfListStyle {
public void writeLevelGroup(RtfElement element)
throws IOException {
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java Mon May 28 15:30:46 2012
@@ -29,9 +29,6 @@ package org.apache.fop.render.rtf.rtflib
//Java
import java.io.IOException;
-//FOP
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement;
-
/**
* Class to handle bullet list style.
*/
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java Mon May 28 15:30:46 2012
@@ -29,9 +29,6 @@ package org.apache.fop.render.rtf.rtflib
//Java
import java.io.IOException;
-//FOP
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement;
-
/**
* Class to handle number list style.
*/
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java Mon May 28 15:30:46 2012
@@ -29,9 +29,6 @@ package org.apache.fop.render.rtf.rtflib
//Java
import java.io.IOException;
-//FOP
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement;
-
/**
* Class to handle text list style.
*/
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java Mon May 28 15:30:46 2012
@@ -26,17 +26,17 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.util.LinkedList;
-import java.util.Iterator;
-import java.io.Writer;
import java.io.IOException;
-//import org.apache.fop.render.rtf.rtflib.jfor.main.JForVersionInfo;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.LinkedList;
/**
- * RtfListTable: used to make the list table in the header section of the RtfFile.
+ * <p>RtfListTable: used to make the list table in the header section of the RtfFile.
* This is the method that Word uses to make lists in RTF and the way most RTF readers,
- * esp. Adobe FrameMaker read lists from RTF.
- * @author Christopher Scott, scottc@westinghouse.com
+ * esp. Adobe FrameMaker read lists from RTF.</p>
+ *
+ * <p>This work was authored by Christopher Scott (scottc@westinghouse.com).</p>
*/
public class RtfListTable extends RtfContainer {
private LinkedList lists;
@@ -219,4 +219,4 @@ public class RtfListTable extends RtfCon
styles.add(ls);
return styles.size();
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfNull.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfNull.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfNull.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfNull.java Mon May 28 15:30:46 2012
@@ -26,11 +26,13 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
/**
- * @author Christopher Scott, scottc@westinghouse.com
+ * <p>Null container.</p>
+ *
+ * <p>This work was authored by Christopher Scott (scottc@westinghouse.com).</p>
*/
public class RtfNull
extends RtfContainer {
@@ -38,4 +40,4 @@ extends RtfContainer {
RtfNull(RtfPage parent, Writer w) throws IOException {
super((RtfContainer)parent, w);
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfOptions.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfOptions.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfOptions.java Mon May 28 15:30:46 2012
@@ -27,8 +27,9 @@ package org.apache.fop.render.rtf.rtflib
*/
/**
- * Simplistic options definitions for RTF generation
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+ * <p>Simplistic options definitions for RTF generation.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfOptions {
/**
@@ -48,4 +49,4 @@ public class RtfOptions {
public boolean renderContainer(RtfContainer c) {
return true;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java Mon May 28 15:30:46 2012
@@ -29,9 +29,11 @@ package org.apache.fop.render.rtf.rtflib
import java.io.IOException;
import java.io.Writer;
-/** Specifies rtf control words. Is the container for page attributes.
- * Overrides okToWriteRtf.
- * @author Christopher Scott, scottc@westinghouse.com
+/**
+ * <p>Specifies rtf control words. Is the container for page attributes.
+ * Overrides okToWriteRtf.</p>
+ *
+ * <p>This work was authored by Christopher Scott (scottc@westinghouse.com).</p>
*/
public class RtfPage
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java Mon May 28 15:30:46 2012
@@ -26,11 +26,13 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
/**
- * @author Christopher Scott, scottc@westinghouse.com
+ * <p>Page area container.</p>
+ *
+ * <p>This work was authored by Christopher Scott (scottc@westinghouse.com).</p>
*/
public class RtfPageArea
extends RtfContainer {
@@ -64,4 +66,4 @@ extends RtfContainer {
protected boolean okToWriteRtf() {
return true;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageBreak.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageBreak.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageBreak.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageBreak.java Mon May 28 15:30:46 2012
@@ -26,11 +26,13 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
-/** "Model" of an RTF page break
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Model of an RTF page break.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfPageBreak extends RtfElement {
@@ -53,4 +55,4 @@ public class RtfPageBreak extends RtfEle
public boolean isEmpty() {
return false;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumber.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumber.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumber.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumber.java Mon May 28 15:30:46 2012
@@ -26,11 +26,13 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
/**
- * @author Christopher Scott, scottc@westinghouse.com
+ * <p>Page number container.</p>
+ *
+ * <p>This work was authored by Christopher Scott (scottc@westinghouse.com).</p>
*/
public class RtfPageNumber extends RtfContainer {
/* RtfText attributes: fields
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java Mon May 28 15:30:46 2012
@@ -30,8 +30,10 @@ import java.io.IOException;
import java.io.Writer;
/**
- * @author Christopher Scott, scottc@westinghouse.com
- * @author Boris Pouderous, boris.pouderous@free.fr
+ * <p>Page number citation container.</p>
+
+ * <p>This work was authored by Christopher Scott (scottc@westinghouse.com) and
+ * Boris Pouderous (boris.pouderous@free.fr).</p>
*/
public class RtfPageNumberCitation extends RtfContainer {
/* Page field :
@@ -109,4 +111,4 @@ public class RtfPageNumberCitation exten
public boolean isEmpty() {
return false;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java Mon May 28 15:30:46 2012
@@ -26,14 +26,18 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
import java.util.List;
-/** Model of an RTF paragraph, which can contain RTF text elements.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- * @author Andreas Putz a.putz@skynamics.com
- * @author Boris Poudérous, boris.pouderous@free.fr
+import org.apache.fop.apps.FOPException;
+
+/**
+ * <p>Model of an RTF paragraph, which can contain RTF text elements.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Andreas Putz (a.putz@skynamics.com), and
+ * Boris Poudérous (boris.pouderous@free.fr).</p>
*/
public class RtfParagraph extends RtfBookmarkContainerImpl
@@ -91,12 +95,17 @@ implements IRtfTextContainer, IRtfPageBr
/**
* IRtfTextContainer requirement: return a copy of our attributes
* @return a copy of this paragraphs attributes
+ * @throws FOPException if attributes cannot be cloned
*/
- public RtfAttributes getTextContainerAttributes() {
+ public RtfAttributes getTextContainerAttributes() throws FOPException {
if (attrib == null) {
return null;
}
- return (RtfAttributes)this.attrib.clone();
+ try {
+ return (RtfAttributes)this.attrib.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new FOPException(e);
+ }
}
/**
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphKeepTogether.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphKeepTogether.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphKeepTogether.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphKeepTogether.java Mon May 28 15:30:46 2012
@@ -26,8 +26,8 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
/**
* Models the keep together attributes of paragraphs
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java Mon May 28 15:30:46 2012
@@ -26,11 +26,14 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
-/** Models a section in an RTF document
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Models a section in an RTF document</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfSection
@@ -190,7 +193,11 @@ implements
* @throws IOException for I/O problems
*/
protected void writeRtfSuffix() throws IOException {
- writeControlWord("sect");
+ // write suffix /sect only if this section is not last section (see bug #51484)
+ List siblings = parent.getChildren();
+ if ( ( siblings.indexOf ( this ) + 1 ) < siblings.size() ) {
+ writeControlWord("sect");
+ }
}
private void closeCurrentTable() throws IOException {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java Mon May 28 15:30:46 2012
@@ -29,8 +29,10 @@ package org.apache.fop.render.rtf.rtflib
import java.io.IOException;
import java.io.Writer;
-/** Plain text in a RTF file, without any formatings.
- * @author Peter Herweg, pherweg@web.de
+/**
+ * <p>Plain text in a RTF file, without any formatings.</p>
+ *
+ * <p>This work was authored by Peter Herweg (pherweg@web.de).</p>
*/
public class RtfString extends RtfElement {
@@ -67,4 +69,4 @@ public class RtfString extends RtfElemen
public void setText(String s) {
text = s;
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java Mon May 28 15:30:46 2012
@@ -26,13 +26,15 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.util.Map;
-import java.util.HashMap;
import java.io.IOException;
import java.io.Writer;
+import java.util.HashMap;
+import java.util.Map;
-/** Converts java Strings according to RTF conventions
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Converts java Strings according to RTF conventions.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public final class RtfStringConverter {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java Mon May 28 15:30:46 2012
@@ -26,15 +26,16 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-import java.util.Vector;
-import java.util.Hashtable;
import java.io.IOException;
+import java.util.Hashtable;
import java.util.Iterator;
+import java.util.Vector;
/**
- * Singelton of the RTF style sheet table.
- * This class belongs to the <jfor:stylesheet> tag processing.
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
+ * <p>Singelton of the RTF style sheet table.
+ * This class belongs to the <jfor:stylesheet> tag processing.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public final class RtfStyleSheetTable {
//////////////////////////////////////////////////
@@ -240,4 +241,4 @@ public final class RtfStyleSheetTable {
private String getRtfStyleReference (String name) {
return "cs" + styles.get (name).toString ();
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java Mon May 28 15:30:46 2012
@@ -29,8 +29,12 @@ package org.apache.fop.render.rtf.rtflib
import java.io.IOException;
import java.io.Writer;
-/** Container for RtfRow elements
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+import org.apache.fop.apps.FOPException;
+
+/**
+ * <p>Container for RtfRow elements.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfTable extends RtfContainer {
@@ -84,11 +88,16 @@ public class RtfTable extends RtfContain
* @param attrs attributs of new RtfTableRow
* @return new RtfTableRow
* @throws IOException for I/O problems
+ * @throws FOPException if attributes cannot be cloned
*/
- public RtfTableRow newTableRow(RtfAttributes attrs) throws IOException {
+ public RtfTableRow newTableRow(RtfAttributes attrs) throws IOException, FOPException {
RtfAttributes attr = null;
if (attrib != null) {
- attr = (RtfAttributes) attrib.clone ();
+ try {
+ attr = (RtfAttributes) attrib.clone ();
+ } catch (CloneNotSupportedException e) {
+ throw new FOPException(e);
+ }
attr.set (attrs);
} else {
attr = attrs;
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java Mon May 28 15:30:46 2012
@@ -30,8 +30,10 @@ import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
-/** A cell in an RTF table, container for paragraphs, lists, etc.
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>A cell in an RTF table, container for paragraphs, lists, etc.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfTableCell
@@ -46,6 +48,11 @@ public class RtfTableCell
private boolean setCenter;
private boolean setRight;
private int id;
+ private RtfParagraphBreak lastBreak = null;
+ private int lastBreakDepth = Integer.MIN_VALUE;
+
+ private static final String TABLE_CELL_PARAGRAPH = "cell";
+ private static final String TABLE_CELL_NESTED_PARAGRAPH = "nestcell";
/** default cell width (in twips ??) */
public static final int DEFAULT_CELL_WIDTH = 2000;
@@ -310,7 +317,9 @@ public class RtfTableCell
if (getRow().getTable().isNestedTable()) {
//nested table
- writeControlWordNS("nestcell");
+ if (lastBreak == null) {
+ writeControlWordNS("nestcell");
+ }
writeGroupMark(true);
writeControlWord("nonesttables");
writeControlWord("par");
@@ -350,7 +359,9 @@ public class RtfTableCell
//writeControlWord("par");
}
- writeControlWord("cell");
+ if (lastBreak == null) {
+ writeControlWord("cell");
+ }
}
}
@@ -533,4 +544,38 @@ public class RtfTableCell
return null;
}
+
+ /**
+ * The table cell decides whether or not a newly added paragraph break
+ * will be used to write the cell-end control word.
+ * For nested tables it is not necessary.
+ *
+ * @param parBreak the paragraph break element
+ * @param breakDepth The depth is necessary for picking the correct break element.
+ * If it is deeper inside the whole cell it will be used, and if there is something on
+ * the same level (depth) it is also set because the method is called for all breaks
+ * in the correct order.
+ */
+ public void setLastParagraph(RtfParagraphBreak parBreak, int breakDepth) {
+ if (parBreak != null && breakDepth >= lastBreakDepth) {
+ lastBreak = parBreak;
+ lastBreakDepth = breakDepth;
+ }
+ }
+
+ /**
+ * The last paragraph break was just stored before,
+ * now the control word is really switched
+ */
+ public void finish() {
+ //If it is nested and contains another table do not set it
+ if (getRow().getTable().isNestedTable() && table != null) {
+ lastBreak = null;
+ } else if (lastBreak != null) {
+ lastBreak.switchControlWord(
+ getRow().getTable().isNestedTable()
+ ? TABLE_CELL_NESTED_PARAGRAPH
+ : TABLE_CELL_PARAGRAPH);
+ }
+ }
}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java Mon May 28 15:30:46 2012
@@ -30,10 +30,14 @@ import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
-/** Container for RtfTableCell elements
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- * @author Andreas Putz a.putz@skynamics.com
- * @author Roberto Marra roberto@link-u.com
+import org.apache.fop.apps.FOPException;
+
+/**
+ * <p>Container for RtfTableCell elements.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Andreas Putz (a.putz@skynamics.com), and
+ * Roberto Marra (roberto@link-u.com).</p>
*/
public class RtfTableRow extends RtfContainer implements ITableAttributes {
@@ -104,15 +108,20 @@ public class RtfTableRow extends RtfCont
* @param cellWidth width of new cell
* @return new RtfTableCell
* @throws IOException for I/O problems
+ * @throws FOPException if attributes cannot be cloned
*/
public RtfTableCell newTableCellMergedHorizontally (int cellWidth,
- RtfAttributes attrs) throws IOException {
+ RtfAttributes attrs) throws IOException, FOPException {
highestCell++;
// Added by Normand Masse
// Inherit attributes from base cell for merge
RtfAttributes wAttributes = null;
if (attrs != null) {
- wAttributes = (RtfAttributes)attrs.clone();
+ try {
+ wAttributes = (RtfAttributes)attrs.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new FOPException(e);
+ }
}
cell = new RtfTableCell(this, writer, cellWidth, wAttributes, highestCell);
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java Mon May 28 15:30:46 2012
@@ -29,8 +29,12 @@ package org.apache.fop.render.rtf.rtflib
import java.io.IOException;
import java.io.Writer;
-/** Model of a text run (a piece of text with attributes) in an RTF document
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+import org.apache.fop.apps.FOPException;
+
+/**
+ * <p>Model of a text run (a piece of text with attributes) in an RTF document.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
public class RtfText extends RtfElement {
@@ -238,12 +242,18 @@ public class RtfText extends RtfElement
}
/** IRtfTextContainer requirement:
- * @return a copy of our attributes */
- public RtfAttributes getTextContainerAttributes() {
+ * @return a copy of our attributes
+ * @throws FOPException if attributes cannot be cloned
+ */
+ public RtfAttributes getTextContainerAttributes() throws FOPException {
if (attrib == null) {
return null;
}
- return (RtfAttributes)this.attrib.clone();
+ try {
+ return (RtfAttributes)this.attrib.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new FOPException(e);
+ }
}
/** direct access to our text */
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java Mon May 28 15:30:46 2012
@@ -31,9 +31,10 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- * Class which contains a linear text run. It has methods to add attributes,
- * text, paragraph breaks....
- * @author Peter Herweg, pherweg@web.de
+ * <p>Class which contains a linear text run. It has methods to add attributes,
+ * text, paragraph breaks....</p>
+ *
+ * <p>This work was authored by Peter Herweg (pherweg@web.de).</p>
*/
public class RtfTextrun extends RtfContainer {
@@ -143,30 +144,6 @@ public class RtfTextrun extends RtfConta
}
}
- /** Class which represents a paragraph break.*/
- private class RtfParagraphBreak extends RtfElement {
-
- RtfParagraphBreak(RtfContainer parent, Writer w)
- throws IOException {
- super(parent, w);
- }
-
- /**
- * @return true if this element would generate no "useful" RTF content
- */
- public boolean isEmpty() {
- return false;
- }
-
- /**
- * write RTF code of all our children
- * @throws IOException for I/O problems
- */
- protected void writeRtfContent() throws IOException {
- writeControlWord("par");
- }
- }
-
/** Create an RTF container as a child of given container */
RtfTextrun(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException {
super(parent, w, attrs);
@@ -290,32 +267,35 @@ public class RtfTextrun extends RtfConta
* Inserts paragraph break before all close group marks.
*
* @throws IOException for I/O problems
+ * @return The paragraph break element
*/
- public void addParagraphBreak() throws IOException {
- // get copy of children list
- List children = getChildren();
- Stack tmp = new Stack();
-
- // delete all previous CloseGroupMark
- int deletedCloseGroupCount = 0;
-
- ListIterator lit = children.listIterator(children.size());
- while (lit.hasPrevious()
- && (lit.previous() instanceof RtfCloseGroupMark)) {
- tmp.push(Integer.valueOf(((RtfCloseGroupMark)lit.next()).getBreakType()));
- lit.remove();
- deletedCloseGroupCount++;
- }
-
- if (children.size() != 0) {
- // add paragraph break and restore all deleted close group marks
- setChildren(children);
- new RtfParagraphBreak(this, writer);
- for (int i = 0; i < deletedCloseGroupCount; i++) {
- addCloseGroupMark(((Integer)tmp.pop()).intValue());
- }
- }
- }
+ public RtfParagraphBreak addParagraphBreak() throws IOException {
+ // get copy of children list
+ List children = getChildren();
+ Stack tmp = new Stack();
+ RtfParagraphBreak par = null;
+
+ // delete all previous CloseGroupMark
+ int deletedCloseGroupCount = 0;
+
+ ListIterator lit = children.listIterator(children.size());
+ while (lit.hasPrevious()
+ && (lit.previous() instanceof RtfCloseGroupMark)) {
+ tmp.push(Integer.valueOf(((RtfCloseGroupMark)lit.next()).getBreakType()));
+ lit.remove();
+ deletedCloseGroupCount++;
+ }
+
+ if (children.size() != 0) {
+ // add paragraph break and restore all deleted close group marks
+ setChildren(children);
+ par = new RtfParagraphBreak(this, writer);
+ for (int i = 0; i < deletedCloseGroupCount; i++) {
+ addCloseGroupMark(((Integer)tmp.pop()).intValue());
+ }
+ }
+ return par;
+ }
/**
* Inserts a leader.
@@ -443,7 +423,7 @@ public class RtfTextrun extends RtfConta
if (e instanceof RtfParagraphBreak) {
//If the element before was a paragraph break or a bookmark
//they will be hidden and are therefore not considered as visible
- if (!(aBefore instanceof RtfParagraphBreak)
+ if (!(aBefore instanceof RtfParagraphBreak)
&& !(aBefore instanceof RtfBookmark)) {
lastParagraphBreak = (RtfParagraphBreak)e;
}
@@ -467,7 +447,7 @@ public class RtfTextrun extends RtfConta
//write all children
boolean bPrevPar = false;
- boolean bBookmark = false;
+ boolean bBookmark = false;
boolean bFirst = true;
for (Iterator it = getChildren().iterator(); it.hasNext();) {
final RtfElement e = (RtfElement)it.next();
@@ -485,6 +465,8 @@ public class RtfTextrun extends RtfConta
* child.
* -If the RtfTextrun is the last child of its parent, write a
* RtfParagraphBreak only, if it is not the last child.
+ * -If the RtfParagraphBreak can not be hidden (e.g. a table cell requires it)
+ * it is also written
*/
boolean bHide = false;
bHide = bRtfParagraphBreak;
@@ -493,7 +475,8 @@ public class RtfTextrun extends RtfConta
|| bFirst
|| (bSuppressLastPar && bLast && lastParagraphBreak != null
&& e == lastParagraphBreak)
- || bBookmark);
+ || bBookmark)
+ && ((RtfParagraphBreak)e).canHide();
if (!bHide) {
newLine();
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java Mon May 28 15:30:46 2012
@@ -29,8 +29,10 @@ package org.apache.fop.render.rtf.rtflib
import java.util.Iterator;
import java.util.StringTokenizer;
-/** Collapses whitespace of an RtfContainer that contains RtfText elements
- * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Collapses whitespace of an RtfContainer that contains RtfText elements.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
*/
final class WhitespaceCollapser {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java Mon May 28 15:30:46 2012
@@ -26,14 +26,15 @@ import org.apache.fop.render.rtf.rtflib.
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>
+/**
+ * <p>A BuilderContext holds context information when building an RTF document.</p>
*
* This class was originally developed by Bertrand Delacretaz bdelacretaz@codeconsult.ch
* for the JFOR project and is now integrated into FOP.
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Andreas Putz (a.putz@skynamics.com), and
+ * Peter Herweg (pherweg@web.de).</p>
*/
public class BuilderContext {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java Mon May 28 15:30:46 2012
@@ -26,9 +26,11 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-/** Here will be defined all supported image formats.
- * This class belongs to the <fo:external-graphic> tag processing.
- * @author a.putz@skynamics.com (Andreas Putz)
+/**
+ * <p>Here will be defined all supported image formats.
+ * This class belongs to the <fo:external-graphic> tag processing.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public final class ImageConstants {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java Mon May 28 15:30:46 2012
@@ -26,9 +26,11 @@ package org.apache.fop.render.rtf.rtflib
* the FOP project.
*/
-/** Misc.utilities for images handling
- * This class belongs to the <fo:external-graphic> tag processing.
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
+/**
+ * <p>Miscellaneous utilities for images handling.
+ * This class belongs to the <fo:external-graphic> tag processing.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
*/
public final class ImageUtil {
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java Mon May 28 15:30:46 2012
@@ -29,10 +29,11 @@ import org.apache.fop.datatypes.PercentB
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.flow.table.Table;
+import org.apache.fop.fo.flow.table.TableColumn;
import org.apache.fop.fo.pagination.PageSequence;
/**
- * PercentBaseContext implementation to track base widths for percentage calculations.
+ * <p>PercentBaseContext implementation to track base widths for percentage calculations.</p>
*/
public class PercentContext implements PercentBaseContext {
private static Log log = LogFactory.getLog(PercentContext.class);
@@ -59,6 +60,13 @@ public class PercentContext implements P
if (fobj == null) {
return 0;
}
+
+ // Special handler for TableColumn width specifications, needs to be
+ // relative to the parent!
+ if ( ( fobj instanceof TableColumn ) && ( fobj.getParent() instanceof FObj ) ) {
+ fobj = (FObj) fobj.getParent();
+ }
+
switch (lengthBase) {
case LengthBase.CONTAINING_BLOCK_WIDTH:
case LengthBase.PARENT_AREA_WIDTH:
@@ -66,12 +74,27 @@ public class PercentContext implements P
Object width = lengthMap.get(fobj);
if (width != null) {
return Integer.parseInt(width.toString());
- } else {
- return -1;
+ } else if (fobj.getParent() != null) {
+ // If the object itself has no width the parent width will be used
+ // because it is the base width of this object
+ width = lengthMap.get(fobj.getParent());
+ if (width != null) {
+ return Integer.parseInt(width.toString());
+ }
}
+ return 0;
case LengthBase.TABLE_UNITS:
Object unit = tableUnitMap.get(fobj);
- return (unit != null) ? ((Integer)unit).intValue() : 0;
+ if (unit != null) {
+ return ((Integer)unit).intValue();
+ } else if (fobj.getParent() != null) {
+ // If the object itself has no width the parent width will be used
+ unit = tableUnitMap.get(fobj.getParent());
+ if (unit != null) {
+ return ((Integer)unit).intValue();
+ }
+ }
+ return 0;
default:
log.error(new Exception("Unsupported base type for LengthBase:" + lengthBase));
return 0;
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java Mon May 28 15:30:46 2012
@@ -21,19 +21,20 @@ package org.apache.fop.render.rtf.rtflib
import java.util.List;
-import org.apache.commons.logging.impl.SimpleLog;
import org.apache.commons.logging.Log;
+import org.apache.commons.logging.impl.SimpleLog;
+
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.
+/**
+ * <p>Used when handling fo:table to hold information to build the table.</p>
*
- * 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>
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Ed Trembicki-Guy (guye@dnb.com),
+ * Boris Poudérous (boris.pouderous@eads-telecom.com), and
+ * Peter Herweg (pherweg@web.de).</p>
*
* This class was originally developed for the JFOR project and
* is now integrated into FOP.
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRenderer.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRenderer.java Mon May 28 15:30:46 2012
@@ -43,11 +43,10 @@ import org.apache.fop.render.txt.border.
import org.apache.fop.render.txt.border.BorderManager;
/**
- * Renderer that renders areas to plain text.
+ * <p>Renderer that renders areas to plain text.</p>
*
- * @author Art Welch
- * @author <a href="mailto:mark-fop@inomial.com">Mark Lillywhite</a> (to use
- * the new Renderer interface)
+ * <p>This work was authored by Art Welch and
+ * Mark Lillywhite (mark-fop@inomial.com) [to use the new Renderer interface].</p>
*/
public class TXTRenderer extends AbstractPathOrientedRenderer {
@@ -73,6 +72,9 @@ public class TXTRenderer extends Abstrac
/** Buffer for background and images. */
private StringBuffer[] decoData;
+ /** Leading of line containing Courier font size of 10pt. */
+ public static final int LINE_LEADING = 1070;
+
/** Height of one symbol in Courier font size of 10pt. */
public static final int CHAR_HEIGHT = 7860;
@@ -193,7 +195,7 @@ public class TXTRenderer extends Abstrac
*/
protected void renderText(TextArea area) {
int col = Helper.ceilPosition(this.currentIPPosition, CHAR_WIDTH);
- int row = Helper.ceilPosition(this.currentBPPosition, CHAR_HEIGHT);
+ int row = Helper.ceilPosition(this.currentBPPosition - LINE_LEADING, CHAR_HEIGHT + 2 * LINE_LEADING);
String s = area.getText();
@@ -217,7 +219,7 @@ public class TXTRenderer extends Abstrac
double height = bounds.getHeight();
pageWidth = Helper.ceilPosition((int) width, CHAR_WIDTH);
- pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT);
+ pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT + 2 * LINE_LEADING);
// init buffers
charData = new StringBuffer[pageHeight];
@@ -461,9 +463,9 @@ public class TXTRenderer extends Abstrac
*/
public void renderImage(Image image, Rectangle2D pos) {
int x1 = Helper.ceilPosition(currentIPPosition, CHAR_WIDTH);
- int y1 = Helper.ceilPosition(currentBPPosition, CHAR_HEIGHT);
+ int y1 = Helper.ceilPosition(currentBPPosition - LINE_LEADING, CHAR_HEIGHT + 2 * LINE_LEADING);
int width = Helper.ceilPosition((int) pos.getWidth(), CHAR_WIDTH);
- int height = Helper.ceilPosition((int) pos.getHeight(), CHAR_HEIGHT);
+ int height = Helper.ceilPosition((int) pos.getHeight(), CHAR_HEIGHT + 2 * LINE_LEADING);
fillRect(x1, y1, width, height, IMAGE_CHAR);
}
@@ -508,7 +510,8 @@ public class TXTRenderer extends Abstrac
int borderStartX = bm.getStartX();
int borderStartY = bm.getStartY();
- int x, y;
+ int x;
+ int y;
if (horz && startOrBefore) { // BEFORE
x = borderStartX;
y = borderStartY;
@@ -523,7 +526,11 @@ public class TXTRenderer extends Abstrac
y = borderStartY;
}
- int dx, dy, length, startType, endType;
+ int dx;
+ int dy;
+ int length;
+ int startType;
+ int endType;
if (horz) {
length = borderWidth;
dx = 1;
@@ -555,9 +562,9 @@ public class TXTRenderer extends Abstrac
protected void drawBackAndBorders(Area area, float startx, float starty,
float width, float height) {
bm.setWidth(Helper.ceilPosition(toMilli(width), CHAR_WIDTH));
- bm.setHeight(Helper.ceilPosition(toMilli(height), CHAR_HEIGHT));
+ bm.setHeight(Helper.ceilPosition(toMilli(height), CHAR_HEIGHT + 2 * LINE_LEADING));
bm.setStartX(Helper.ceilPosition(toMilli(startx), CHAR_WIDTH));
- bm.setStartY(Helper.ceilPosition(toMilli(starty), CHAR_HEIGHT));
+ bm.setStartY(Helper.ceilPosition(toMilli(starty), CHAR_HEIGHT + 2 * LINE_LEADING));
super.drawBackAndBorders(area, startx, starty, width, height);
}
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java Mon May 28 15:30:46 2012
@@ -20,6 +20,7 @@
package org.apache.fop.render.txt;
import org.apache.avalon.framework.configuration.Configuration;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.render.PrintRendererConfigurator;
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/xml/XMLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/xml/XMLRenderer.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/xml/XMLRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/xml/XMLRenderer.java Mon May 28 15:30:46 2012
@@ -86,6 +86,7 @@ import org.apache.fop.render.Renderer;
import org.apache.fop.render.RendererContext;
import org.apache.fop.render.XMLHandler;
import org.apache.fop.util.ColorUtil;
+import org.apache.fop.util.XMLUtil;
/**
* Renderer that renders areas to XML for debugging purposes.
@@ -96,6 +97,15 @@ import org.apache.fop.util.ColorUtil;
*/
public class XMLRenderer extends AbstractXMLRenderer {
+ /**
+ * Area Tree (AT) version, used to express an @version attribute
+ * in the root element of the AT document, the initial value of which
+ * is set to '2.0' to signify that something preceded it (but didn't
+ * happen to be marked as such), and that this version is not necessarily
+ * backwards compatible with the unmarked (<2.0) version.
+ */
+ public static final String VERSION = "2.0";
+
/** XML MIME type */
public static final String XML_MIME_TYPE = MimeConstants.MIME_FOP_AREA_TREE;
@@ -157,6 +167,7 @@ public class XMLRenderer extends Abstrac
protected void addAreaAttributes(Area area) {
addAttribute("ipd", area.getIPD());
addAttribute("bpd", area.getBPD());
+ maybeAddLevelAttribute(area);
if (isDetailedFormat()) {
if (area.getIPD() != 0) {
addAttribute("ipda", area.getAllocIPD());
@@ -363,7 +374,9 @@ public class XMLRenderer extends Abstrac
if (userAgent.getProducer() != null) {
comment("Produced by " + userAgent.getProducer());
}
- startElement("areaTree");
+ atts.clear();
+ addAttribute("version", VERSION);
+ startElement("areaTree", atts);
}
/** {@inheritDoc} */
@@ -708,7 +721,7 @@ public class XMLRenderer extends Abstrac
atts.clear();
addAreaAttributes(viewport);
addTraitAttributes(viewport);
- addAttribute("offset", viewport.getOffset());
+ addAttribute("offset", viewport.getBlockProgressionOffset());
addAttribute("pos", viewport.getContentPosition());
if (viewport.hasClip()) {
addAttribute("clip", "true");
@@ -770,7 +783,7 @@ public class XMLRenderer extends Abstrac
atts.clear();
addAreaAttributes(space);
addTraitAttributes(space);
- addAttribute("offset", space.getOffset());
+ addAttribute("offset", space.getBlockProgressionOffset());
startElement("space", atts);
endElement("space");
}
@@ -787,7 +800,7 @@ public class XMLRenderer extends Abstrac
if (text.getTextLetterSpaceAdjust() != 0) {
addAttribute("tlsadjust", text.getTextLetterSpaceAdjust());
}
- addAttribute("offset", text.getOffset());
+ addAttribute("offset", text.getBlockProgressionOffset());
addAttribute("baseline", text.getBaselineOffset());
addAreaAttributes(text);
addTraitAttributes(text);
@@ -802,7 +815,10 @@ public class XMLRenderer extends Abstrac
@Override
protected void renderWord(WordArea word) {
atts.clear();
- addAttribute("offset", word.getOffset());
+ int offset = word.getBlockProgressionOffset();
+ if ( offset != 0 ) {
+ addAttribute("offset", offset);
+ }
int[] letterAdjust = word.getLetterAdjustArray();
if (letterAdjust != null) {
StringBuffer sb = new StringBuffer(64);
@@ -818,8 +834,12 @@ public class XMLRenderer extends Abstrac
addAttribute("letter-adjust", sb.toString());
}
}
+ maybeAddLevelAttribute(word);
+ maybeAddPositionAdjustAttribute(word);
+ String text = word.getWord();
+ maybeAddReversedAttribute(word, text);
startElement("word", atts);
- characters(word.getWord());
+ characters(text);
endElement("word");
super.renderWord(word);
}
@@ -830,7 +850,11 @@ public class XMLRenderer extends Abstrac
@Override
protected void renderSpace(SpaceArea space) {
atts.clear();
- addAttribute("offset", space.getOffset());
+ int offset = space.getBlockProgressionOffset();
+ if ( offset != 0 ) {
+ addAttribute("offset", offset);
+ }
+ maybeAddLevelAttribute(space);
if (!space.isAdjustable()) {
addAttribute("adj", "false"); //default is true
}
@@ -848,7 +872,7 @@ public class XMLRenderer extends Abstrac
atts.clear();
addAreaAttributes(ip);
addTraitAttributes(ip);
- addAttribute("offset", ip.getOffset());
+ addAttribute("offset", ip.getBlockProgressionOffset());
startElement("inlineparent", atts);
super.renderInlineParent(ip);
endElement("inlineparent");
@@ -862,7 +886,7 @@ public class XMLRenderer extends Abstrac
atts.clear();
addAreaAttributes(ibp);
addTraitAttributes(ibp);
- addAttribute("offset", ibp.getOffset());
+ addAttribute("offset", ibp.getBlockProgressionOffset());
startElement("inlineblockparent", atts);
super.renderInlineBlockParent(ibp);
endElement("inlineblockparent");
@@ -876,7 +900,7 @@ public class XMLRenderer extends Abstrac
atts.clear();
addAreaAttributes(area);
addTraitAttributes(area);
- addAttribute("offset", area.getOffset());
+ addAttribute("offset", area.getBlockProgressionOffset());
addAttribute("ruleStyle", area.getRuleStyleAsString());
addAttribute("ruleThickness", area.getRuleThickness());
startElement("leader", atts);
@@ -889,5 +913,25 @@ public class XMLRenderer extends Abstrac
return XML_MIME_TYPE;
}
-}
+ private void maybeAddLevelAttribute ( Area a ) {
+ int level = a.getBidiLevel();
+ if ( level >= 0 ) {
+ addAttribute ( "level", level );
+ }
+ }
+ private void maybeAddPositionAdjustAttribute ( WordArea w ) {
+ int[][] adjustments = w.getGlyphPositionAdjustments();
+ if ( adjustments != null ) {
+ addAttribute ( "position-adjust", XMLUtil.encodePositionAdjustments ( adjustments ) );
+ }
+ }
+
+ private void maybeAddReversedAttribute ( WordArea w, String text ) {
+ if ( w.isReversed() && ( text.length() > 1 ) ) {
+ addAttribute("reversed", "true");
+ }
+ }
+
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org