From: William Victor Mote Date: Wed, 2 Jul 2003 16:59:54 +0000 (+0000) Subject: style changes only, mostly javadoc comments and refactoring of names X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1363 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eb5c4365cea6b206e6cbc29e1ef434f187f5debd;p=xmlgraphics-fop.git style changes only, mostly javadoc comments and refactoring of names git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196559 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java index 57ea7d58a..93cc15701 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java @@ -83,19 +83,19 @@ implements IRtfParagraphContainer, IRtfExternalGraphicContainer, IRtfTableContai public RtfParagraph newParagraph() throws IOException { closeAll(); - para = new RtfParagraph(this, m_writer); + para = new RtfParagraph(this, writer); return para; } public RtfParagraph newParagraph(RtfAttributes attrs) throws IOException { closeAll(); - para = new RtfParagraph(this, m_writer, attrs); + para = new RtfParagraph(this, writer, attrs); return para; } public RtfExternalGraphic newImage() throws IOException { closeAll(); - externalGraphic = new RtfExternalGraphic(this, m_writer); + externalGraphic = new RtfExternalGraphic(this, writer); return externalGraphic; } @@ -145,14 +145,14 @@ implements IRtfParagraphContainer, IRtfExternalGraphicContainer, IRtfTableContai */ public RtfTable newTable(RtfAttributes attrs, ITableColumnsInfo tc) throws IOException { closeAll(); - table = new RtfTable(this, m_writer, attrs, tc); + table = new RtfTable(this, writer, attrs, tc); return table; } /** close current table if any and start a new one */ public RtfTable newTable(ITableColumnsInfo tc) throws IOException { closeAll(); - table = new RtfTable(this, m_writer, tc); + table = new RtfTable(this, writer, tc); return table; } } \ No newline at end of file diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java index 3323bf22f..bea4969cc 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java @@ -180,7 +180,7 @@ public class RtfBookmark extends RtfElement { //changed. Now using writeStarControlWord this.writeStarControlWord (tag); - m_writer.write (bookmark); + writer.write (bookmark); this.writeGroupMark (false); } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java index 2748a7cdc..5d16045d5 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java @@ -127,7 +127,7 @@ public class RtfBookmarkContainerImpl extends RtfContainer implements IRtfBookma mBookmark.close (); } - mBookmark = new RtfBookmark (this, m_writer, bookmark); + mBookmark = new RtfBookmark (this, writer, bookmark); return mBookmark; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfDocumentArea.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfDocumentArea.java index 1da3472c5..75683925b 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfDocumentArea.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfDocumentArea.java @@ -67,19 +67,23 @@ import java.io.IOException; public class RtfDocumentArea extends RtfContainer { - private RtfSection m_currentSection; + private RtfSection currentSection; /** Create an RTF element as a child of given container */ RtfDocumentArea(RtfFile f, Writer w) throws IOException { super(f, w); } - /** close current RtfSection if any and create a new one */ + /** + * Close current RtfSection if any and create a new one + * @throws IOException for I/O problems + * @return the new RtfSection + */ public RtfSection newSection() throws IOException { - if (m_currentSection != null) { - m_currentSection.close(); + if (currentSection != null) { + currentSection.close(); } - m_currentSection = new RtfSection(this, m_writer); - return m_currentSection; + currentSection = new RtfSection(this, writer); + return currentSection; } } \ No newline at end of file diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfElement.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfElement.java index f87621306..15b4188e2 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfElement.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfElement.java @@ -68,43 +68,51 @@ import java.util.Iterator; * @author Andreas Putz a.putz@skynamics.com */ public abstract class RtfElement { - protected final Writer m_writer; - protected final RtfContainer m_parent; - protected final RtfAttributes m_attrib; - private boolean m_written; - private boolean m_closed; - private final int m_id; - private static int m_idCounter; + /** Writer to be used */ + protected final Writer writer; + /** parent element */ + protected final RtfContainer parent; + /** attributes of the element */ + protected final RtfAttributes attrib; + private boolean written; + private boolean closed; + private final int id; + private static int idCounter; /** Create an RTF element as a child of given container */ RtfElement(RtfContainer parent, Writer w) throws IOException { this(parent, w, null); } - /** Create an RTF element as a child of given container with given attributes */ RtfElement(RtfContainer parent, Writer w, RtfAttributes attr) throws IOException { - m_id = m_idCounter++; - m_parent = parent; - m_attrib = (attr != null ? attr : new RtfAttributes()); - if (m_parent != null) { - m_parent.addChild(this); + id = idCounter++; + this.parent = parent; + attrib = (attr != null ? attr : new RtfAttributes()); + if (this.parent != null) { + this.parent.addChild(this); } - m_writer = w; - m_written = false; + writer = w; + written = false; } - /** Does nothing, meant to allow elements to write themselves without waiting - * for write(), but not implemented yet */ + /** + * Does nothing, meant to allow elements to write themselves without waiting + * for write(), but not implemented yet + * @throws IOException for I/O problems + */ public final void close() throws IOException { - m_closed = true; + closed = true; } - /** write the RTF code of this element to our Writer */ + /** + * Write the RTF code of this element to our Writer + * @throws IOException for I/O problems + */ public final void writeRtf() throws IOException { - if (!m_written) { - m_written = true; + if (!written) { + written = true; if (okToWriteRtf()) { writeRtfPrefix(); writeRtfContent(); @@ -113,56 +121,88 @@ public abstract class RtfElement { } } - /** write an RTF control word to our Writer */ + /** + * Write an RTF control word to our Writer + * @param word RTF control word to write + * @throws IOException for I/O problems + */ protected final void writeControlWord(String word) throws IOException { - m_writer.write('\\'); - m_writer.write(word); - m_writer.write(' '); + writer.write('\\'); + writer.write(word); + writer.write(' '); } - /** write an RTF control word to our Writer, preceeded by a star '*' - * meaning "ignore this if you don't know what it means" + /** + * Write an RTF control word to our Writer, preceeded by a star '*' + * meaning "ignore this if you don't know what it means" + * @param word RTF control word to write + * @throws IOException for I/O problems */ protected final void writeStarControlWord(String word) throws IOException { - m_writer.write("\\*\\"); - m_writer.write(word); - m_writer.write(' '); + writer.write("\\*\\"); + writer.write(word); + writer.write(' '); } + /** + * Same as writeStarControlWord(String word), except with no space behind it + * @param word RTF control word to write + * @throws IOException for I/O problems + */ protected final void writeStarControlWordNS(String word) throws IOException { - m_writer.write("\\*\\"); - m_writer.write(word); + writer.write("\\*\\"); + writer.write(word); } - /** write rtf control word without the space behind it */ + /** + * Write rtf control word without the space behind it + * @param word RTF control word to write + * @throws IOException for I/O problems + */ protected final void writeControlWordNS(String word) throws IOException { - m_writer.write('\\'); - m_writer.write(word); + writer.write('\\'); + writer.write(word); } - /** called before writeRtfContent() */ + /** + * Called before writeRtfContent() + * @throws IOException for I/O problems + */ protected void writeRtfPrefix() throws IOException { } - /** must be implemented to write RTF content to m_writer */ + /** + * Must be implemented to write RTF content to m_writer + * @throws IOException for I/O problems + */ protected abstract void writeRtfContent() throws IOException; - /** called after writeRtfContent() */ + /** + * Called after writeRtfContent() + * @throws IOException for I/O problems + */ protected void writeRtfSuffix() throws IOException { } - /** Write a start or end group mark */ + /** + * Write a start or end group mark + * @param isStart set to true if this is a start mark + * @throws IOException for I/O problems + */ protected final void writeGroupMark(boolean isStart) throws IOException { - m_writer.write(isStart ? "{" : "}"); + writer.write(isStart ? "{" : "}"); } - /** write given attribute values to our Writer - * @param nameList if given, only attribute names from this list are considered + /** + * Write given attribute values to our Writer + * @param attr RtfAttributes to be written + * @param nameList if given, only attribute names from this list are considered + * @throws IOException for I/O problems */ protected void writeAttributes(RtfAttributes attr, String [] nameList) throws IOException { @@ -189,7 +229,12 @@ public abstract class RtfElement { } } - /** write one attribute to our Writer */ + /** + * Write one attribute to our Writer + * @param name name of attribute to write + * @param value value of attribute to be written + * @throws IOException for I/O problems + */ protected void writeOneAttribute(String name, Object value) throws IOException { String cw = name; @@ -201,7 +246,13 @@ public abstract class RtfElement { } writeControlWord(cw); } - /** write one attribute to our Writer without a space*/ + + /** + * Write one attribute to our Writer without a space + * @param name name of attribute to write + * @param value value of attribute to be written + * @throws IOException for I/O problems + */ protected void writeOneAttributeNS(String name, Object value) throws IOException { String cw = name; @@ -214,7 +265,10 @@ public abstract class RtfElement { writeControlWordNS(cw); } - /** can be overridden to suppress all RTF output */ + /** + * can be overridden to suppress all RTF output + * @return true if this object can be written into the RTF + */ protected boolean okToWriteRtf() { return true; } @@ -230,22 +284,25 @@ public abstract class RtfElement { w.flush(); } - /** minimal debugging display */ + /** + * minimal debugging display + * @return String representation of object + */ public String toString() { - return (this == null) ? "null" : (this.getClass().getName() + " #" + m_id); + return (this == null) ? "null" : (this.getClass().getName() + " #" + id); } /** true if close() has been called */ boolean isClosed() { - return m_closed; + return closed; } /** access our RtfFile, which is always the topmost parent */ RtfFile getRtfFile() { // go up the chain of parents until we find the topmost one RtfElement result = this; - while (result.m_parent != null) { - result = result.m_parent; + while (result.parent != null) { + result = result.parent; } // topmost parent must be an RtfFile @@ -259,8 +316,8 @@ public abstract class RtfElement { RtfElement getParentOfClass(Class c) { RtfElement result = null; RtfElement current = this; - while (current.m_parent != null) { - current = current.m_parent; + while (current.parent != null) { + current = current.parent; if (c.isAssignableFrom(current.getClass())) { result = current; break; @@ -269,10 +326,16 @@ public abstract class RtfElement { return result; } - /** true if this element would generate no "useful" RTF content */ + /** + * @return true if this element would generate no "useful" RTF content + */ public abstract boolean isEmpty(); - + /** + * Make a visible entry in the RTF for an exception + * @param ie Exception to flag + * @throws IOException for I/O problems + */ protected void writeExceptionInRtf(Exception ie) throws IOException { writeGroupMark(true); @@ -282,18 +345,21 @@ public abstract class RtfElement { writeControlWord("fs48"); // RtfStringConverter.getInstance().writeRtfString(m_writer, // JForVersionInfo.getShortVersionInfo() + ": "); - RtfStringConverter.getInstance().writeRtfString(m_writer, ie.getClass().getName()); + RtfStringConverter.getInstance().writeRtfString(writer, ie.getClass().getName()); writeControlWord("fs20"); - RtfStringConverter.getInstance().writeRtfString(m_writer, " " + ie.toString()); + RtfStringConverter.getInstance().writeRtfString(writer, " " + ie.toString()); writeControlWord("par"); writeGroupMark(false); } - // Added by Normand Masse - // Used for attribute inheritance + /** + * Added by Normand Masse + * Used for attribute inheritance + * @return RtfAttributes + */ public RtfAttributes getRtfAttributes() { - return m_attrib; + return attrib; } } \ No newline at end of file diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExternalGraphic.java index 988efc2cd..83d31ffde 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExternalGraphic.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExternalGraphic.java @@ -213,7 +213,7 @@ public class RtfExternalGraphic extends RtfElement { */ protected void writeRtfContentWithException() throws IOException { - if (m_writer == null) { + if (writer == null) { return; } @@ -225,11 +225,11 @@ public class RtfExternalGraphic extends RtfElement { String linkToRoot = System.getProperty("jfor_link_to_root"); if (linkToRoot != null) { - m_writer.write("{\\field {\\* \\fldinst { INCLUDEPICTURE \""); - m_writer.write(linkToRoot); + writer.write("{\\field {\\* \\fldinst { INCLUDEPICTURE \""); + writer.write(linkToRoot); File urlFile = new File(url.getFile()); - m_writer.write(urlFile.getName()); - m_writer.write("\" \\\\* MERGEFORMAT \\\\d }}}"); + writer.write(urlFile.getName()); + writer.write("\" \\\\* MERGEFORMAT \\\\d }}}"); return; } @@ -403,7 +403,7 @@ public class RtfExternalGraphic extends RtfElement { char[] chars = new char[len]; buf.getChars(0, len, chars, 0); - m_writer.write(chars); + writer.write(chars); // Writes the end of RTF image diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExtraRowSet.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExtraRowSet.java index 6c326a224..1bf60446f 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExtraRowSet.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfExtraRowSet.java @@ -187,7 +187,7 @@ public class RtfExtraRowSet extends RtfContainer { RtfTableCell createExtraCell(int rowIndex, int xOffset, int cellWidth, RtfAttributes parentCellAttributes) throws IOException { - final RtfTableCell c = new RtfTableCell(null, m_writer, cellWidth, + final RtfTableCell c = new RtfTableCell(null, writer, cellWidth, parentCellAttributes, DEFAULT_IDNUM); m_cells.add(new PositionedCell(c, rowIndex, xOffset)); return c; @@ -227,7 +227,7 @@ public class RtfExtraRowSet extends RtfContainer { return; } - final RtfTableRow row = new RtfTableRow(null, m_writer, DEFAULT_IDNUM); + final RtfTableRow row = new RtfTableRow(null, writer, DEFAULT_IDNUM); int cellIndex = 0; // Get the context of the table that holds the nested table @@ -255,7 +255,7 @@ public class RtfExtraRowSet extends RtfContainer { xOffset += parentITableColumnsInfo.getColumnWidth(); // Create the empty cell merged vertically row.newTableCellMergedVertically((int)parentITableColumnsInfo.getColumnWidth(), - pc.cell.m_attrib); + pc.cell.attrib); // Select next column in order to have its width parentITableColumnsInfo.selectNextColumn(); } @@ -285,7 +285,7 @@ public class RtfExtraRowSet extends RtfContainer { // => in fact the m_attrib below (last argument) is // empty => should be the attributes of the above cells. row.newTableCellMergedVertically((int)parentITableColumnsInfo.getColumnWidth(), - m_attrib); + attrib); // Select next column in order to have its width parentITableColumnsInfo.selectNextColumn(); } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFile.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFile.java index 8e2d78f29..e5a973e63 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFile.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFile.java @@ -112,8 +112,8 @@ extends RtfContainer { if (m_header != null) { throw new RtfStructureException("startHeader called more than once"); } - m_header = new RtfHeader(this, m_writer); - m_listTableContainer = new RtfContainer(this, m_writer); + m_header = new RtfHeader(this, writer); + m_listTableContainer = new RtfContainer(this, writer); return m_header; } @@ -121,7 +121,7 @@ extends RtfContainer { public RtfListTable startListTable(RtfAttributes attr) throws IOException { listNum++; - m_listTable = new RtfListTable(this, m_writer, new Integer(listNum), attr); + m_listTable = new RtfListTable(this, writer, new Integer(listNum), attr); m_listTableContainer.addChild(m_listTable); return m_listTable; } @@ -140,7 +140,7 @@ extends RtfContainer { startHeader(); } m_header.close(); - m_pageArea = new RtfPageArea(this, m_writer); + m_pageArea = new RtfPageArea(this, writer); addChild(m_pageArea); return m_pageArea; } @@ -167,7 +167,7 @@ extends RtfContainer { startHeader(); } m_header.close(); - m_docArea = new RtfDocumentArea(this, m_writer); + m_docArea = new RtfDocumentArea(this, writer); addChild(m_docArea); return m_docArea; } @@ -197,7 +197,7 @@ extends RtfContainer { /** must be called when done creating the document */ public synchronized void flush() throws IOException { writeRtf(); - m_writer.flush(); + writer.flush(); } /** minimal test and usage example */ diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFontTable.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFontTable.java index bd85d7d84..b861ebdf2 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFontTable.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfFontTable.java @@ -74,7 +74,7 @@ class RtfFontTable extends RtfElement { /** write our contents to m_writer. */ protected void writeRtfContent() throws IOException { - RtfFontManager.getInstance ().writeFonts ((RtfHeader)m_parent); + RtfFontManager.getInstance ().writeFonts ((RtfHeader)parent); } /** true if this element would generate no "useful" RTF content */ diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHeader.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHeader.java index 559e927b1..dceb26680 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHeader.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHeader.java @@ -102,13 +102,13 @@ class RtfHeader extends RtfContainer { final Map.Entry entry = (Map.Entry)it.next(); writeGroupMark(true); writeControlWord("propname"); - RtfStringConverter.getInstance().writeRtfString(m_writer, + RtfStringConverter.getInstance().writeRtfString(writer, entry.getKey().toString()); writeGroupMark(false); writeControlWord("proptype30"); writeGroupMark(true); writeControlWord("staticval"); - RtfStringConverter.getInstance().writeRtfString(m_writer, + RtfStringConverter.getInstance().writeRtfString(writer, entry.getValue().toString()); writeGroupMark(false); } @@ -121,11 +121,11 @@ class RtfHeader extends RtfContainer { * what is written here to render it in writeRtfContent. <-- it is for the color table */ void write(String toWrite) throws IOException { - m_writer.write(toWrite); + writer.write(toWrite); } /** write to our Writer using an RtfStringConverter */ void writeRtfString(String toWrite) throws IOException { - RtfStringConverter.getInstance().writeRtfString(m_writer, toWrite); + RtfStringConverter.getInstance().writeRtfString(writer, toWrite); } } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java index 516892ad3..a9269e420 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java @@ -115,16 +115,16 @@ public class RtfHyperLink extends RtfContainer implements IRtfTextContainer { super.writeGroupMark (true); super.writeStarControlWord ("fldinst"); - m_writer.write ("HYPERLINK \"" + url + "\" "); + writer.write ("HYPERLINK \"" + url + "\" "); super.writeGroupMark (false); super.writeGroupMark (true); super.writeControlWord ("fldrslt"); // start a group for this paragraph and write our own attributes if needed - if (m_attrib != null && m_attrib.isSet ("cs")) { + if (attrib != null && attrib.isSet ("cs")) { writeGroupMark (true); - writeAttributes(m_attrib, new String [] {"cs"}); + writeAttributes(attrib, new String [] {"cs"}); } } @@ -134,7 +134,7 @@ public class RtfHyperLink extends RtfContainer implements IRtfTextContainer { * @exception IOException On error */ public void writeRtfSuffix () throws IOException { - if (m_attrib != null && m_attrib.isSet ("cs")) { + if (attrib != null && attrib.isSet ("cs")) { writeGroupMark (false); } super.writeGroupMark (false); @@ -158,22 +158,22 @@ public class RtfHyperLink extends RtfContainer implements IRtfTextContainer { */ public RtfText newText (String str, RtfAttributes attr) throws IOException { closeAll (); - mText = new RtfText (this, m_writer, str, attr); + mText = new RtfText (this, writer, str, attr); return mText; } /** IRtfTextContainer requirement: return a copy of our attributes */ public RtfAttributes getTextContainerAttributes() { - if (m_attrib == null) { + if (attrib == null) { return null; } - return (RtfAttributes) this.m_attrib.clone (); + return (RtfAttributes) this.attrib.clone (); } /** add a line break */ public void newLineBreak () throws IOException { - new RtfLineBreak (this, m_writer); + new RtfLineBreak (this, writer); } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfList.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfList.java index 31cd36918..a24ce0b68 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfList.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfList.java @@ -103,8 +103,8 @@ public class RtfList extends RtfContainer { writeControlWord("pard"); } - writeOneAttribute(RtfText.LEFT_INDENT_FIRST, m_attrib.getValue(RtfListTable.LIST_INDENT)); - writeOneAttribute(RtfText.LEFT_INDENT_BODY, m_attrib.getValue(RtfText.LEFT_INDENT_BODY)); + writeOneAttribute(RtfText.LEFT_INDENT_FIRST, attrib.getValue(RtfListTable.LIST_INDENT)); + writeOneAttribute(RtfText.LEFT_INDENT_BODY, attrib.getValue(RtfText.LEFT_INDENT_BODY)); // put the whole list in a group writeGroupMark(true); @@ -123,7 +123,7 @@ public class RtfList extends RtfContainer { writeOneAttribute(RtfListTable.LIST_NUMBER, (m_listTable.getListNumber()).toString()); writeOneAttribute("pnindent", - m_attrib.getValue(RtfListTable.LIST_INDENT)); + attrib.getValue(RtfListTable.LIST_INDENT)); writeControlWord("pnf1"); writeGroupMark(true); writeControlWord("pndec"); @@ -139,9 +139,9 @@ public class RtfList extends RtfContainer { (m_numberingStyle.isBulletedList) ? "2" : "0"); writeControlWord("pndec"); writeOneAttribute("pnstart", - m_attrib.getValue(RtfListTable.LIST_START_AT)); + attrib.getValue(RtfListTable.LIST_START_AT)); writeOneAttribute("pnindent", - m_attrib.getValue(RtfListTable.LIST_INDENT)); + attrib.getValue(RtfListTable.LIST_INDENT)); writeControlWord("pntxta."); } @@ -169,7 +169,7 @@ public class RtfList extends RtfContainer { if (m_item != null) { m_item.close(); } - m_item = new RtfListItem(this, m_writer); + m_item = new RtfListItem(this, writer); return m_item; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListItem.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListItem.java index fc88e859b..6682aff3b 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListItem.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListItem.java @@ -76,7 +76,7 @@ implements IRtfParagraphContainer { RtfListItemParagraph(RtfListItem rli, RtfAttributes attrs) throws IOException { - super(rli, rli.m_writer, attrs); + super(rli, rli.writer, attrs); } protected void writeRtfPrefix() throws IOException { diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java index 4545e9f0e..608cfe5ab 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfListTable.java @@ -118,9 +118,9 @@ public class RtfListTable extends RtfContainer { Date runTime = new Date(); Random listIdGenerator = new Random(runTime.getTime()); listId = new Integer(listIdGenerator.nextInt()); - m_attrib.set(LIST_ID, listId.toString()); + attrib.set(LIST_ID, listId.toString()); listTemplateId = new Integer(listIdGenerator.nextInt()); - m_attrib.set(LIST_NUMBER_TYPE, 0); + attrib.set(LIST_NUMBER_TYPE, 0); } public void setParentList(RtfList parent) { @@ -138,15 +138,15 @@ public class RtfListTable extends RtfContainer { // bullet definition for bulleted lists // Chris Scott's version was "\\\'01\\u-3913 ?;" // 'b7 is what was used in jfor V0.5.2 - m_attrib.set(LIST_TEXT_FORM, "\\\'01\\'b7 ?;"); - m_attrib.set(LIST_NUM_POSITION); - m_attrib.set(LIST_NUMBER_TYPE, 23); - m_attrib.set(LIST_FONT_TYPE, 2); + attrib.set(LIST_TEXT_FORM, "\\\'01\\'b7 ?;"); + attrib.set(LIST_NUM_POSITION); + attrib.set(LIST_NUMBER_TYPE, 23); + attrib.set(LIST_FONT_TYPE, 2); } else { - m_attrib.set(LIST_TEXT_FORM, "\\\'03\\\'00. ;"); - m_attrib.set(LIST_NUM_POSITION, "\\\'01;"); - m_attrib.set(LIST_NUMBER_TYPE, 0); - m_attrib.set(LIST_FONT_TYPE, 0); + attrib.set(LIST_TEXT_FORM, "\\\'03\\\'00. ;"); + attrib.set(LIST_NUM_POSITION, "\\\'01;"); + attrib.set(LIST_NUMBER_TYPE, 0); + attrib.set(LIST_FONT_TYPE, 0); } } @@ -158,22 +158,22 @@ public class RtfListTable extends RtfContainer { writeControlWordNS(LIST); writeOneAttributeNS(LIST_TEMPLATE_ID, listTemplateId.toString()); - writeOneAttributeNS(LIST, m_attrib.getValue(LIST)); + writeOneAttributeNS(LIST, attrib.getValue(LIST)); writeGroupMark(true); writeControlWordNS(LIST_LEVEL); - writeOneAttributeNS(LIST_NUMBER_TYPE, m_attrib.getValue(LIST_NUMBER_TYPE)); - writeOneAttributeNS(LIST_JUSTIFICATION, m_attrib.getValue(LIST_JUSTIFICATION)); - writeOneAttributeNS(LIST_FOLLOWING_CHAR, m_attrib.getValue(LIST_FOLLOWING_CHAR)); - writeOneAttributeNS(LIST_START_AT, m_attrib.getValue(LIST_START_AT)); + writeOneAttributeNS(LIST_NUMBER_TYPE, attrib.getValue(LIST_NUMBER_TYPE)); + writeOneAttributeNS(LIST_JUSTIFICATION, attrib.getValue(LIST_JUSTIFICATION)); + writeOneAttributeNS(LIST_FOLLOWING_CHAR, attrib.getValue(LIST_FOLLOWING_CHAR)); + writeOneAttributeNS(LIST_START_AT, attrib.getValue(LIST_START_AT)); writeOneAttributeNS(LIST_SPACE, new Integer(0)); - writeOneAttributeNS(LIST_INDENT, m_attrib.getValue(LIST_INDENT)); + writeOneAttributeNS(LIST_INDENT, attrib.getValue(LIST_INDENT)); writeGroupMark(true); - writeOneAttributeNS(LIST_TEXT_FORM, m_attrib.getValue(LIST_TEXT_FORM)); + writeOneAttributeNS(LIST_TEXT_FORM, attrib.getValue(LIST_TEXT_FORM)); writeGroupMark(false); writeGroupMark(true); - writeOneAttributeNS(LIST_NUM_POSITION, m_attrib.getValue(LIST_NUM_POSITION)); + writeOneAttributeNS(LIST_NUM_POSITION, attrib.getValue(LIST_NUM_POSITION)); writeGroupMark(false); - writeOneAttributeNS(LIST_FONT_TYPE, m_attrib.getValue(LIST_FONT_TYPE)); + writeOneAttributeNS(LIST_FONT_TYPE, attrib.getValue(LIST_FONT_TYPE)); writeGroupMark(false); writeGroupMark(true); writeControlWordNS(LIST_NAME); diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java index 1cc87e303..f5acf7370 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageArea.java @@ -79,7 +79,7 @@ extends RtfContainer { if (m_currentPage != null) { m_currentPage.close(); } - m_currentPage = new RtfPage(this, m_writer, attr); + m_currentPage = new RtfPage(this, writer, attr); return m_currentPage; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java index e134f61b3..9eb6e7141 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumber.java @@ -81,11 +81,11 @@ public class RtfPageNumber extends RtfContainer { */ RtfPageNumber(RtfParagraph parent, Writer w) throws IOException { // Adds the attributes of the parent paragraph - super((RtfContainer)parent, w, parent.m_attrib); + super((RtfContainer)parent, w, parent.attrib); // copy parent's text attributes if (parent.getTextAttributes() != null) { - m_attrib.set(parent.getTextAttributes()); + attrib.set(parent.getTextAttributes()); } } @@ -94,7 +94,7 @@ public class RtfPageNumber extends RtfContainer { writeGroupMark(true); writeControlWord(RTF_FIELD); writeGroupMark(true); - writeAttributes(m_attrib, RtfText.ATTR_NAMES); // Added by Boris Poudérous + writeAttributes(attrib, RtfText.ATTR_NAMES); // Added by Boris Poudérous writeStarControlWord(RTF_FIELD_PAGE); writeGroupMark(false); writeGroupMark(true); diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java index a0ee579cd..f2252dd2a 100644 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java @@ -89,9 +89,9 @@ public class RtfPageNumberCitation extends RtfContainer { RtfPageNumberCitation (RtfParagraph parent, Writer w, String id) throws IOException { // add the attributes ant text attributes of the parent paragraph - super((RtfContainer)parent, w, parent.m_attrib); + super((RtfContainer)parent, w, parent.attrib); if (parent.getTextAttributes() != null) { - m_attrib.set(parent.getTextAttributes()); + attrib.set(parent.getTextAttributes()); } this.id = id; } @@ -112,7 +112,7 @@ public class RtfPageNumberCitation extends RtfContainer { writeGroupMark(true); writeControlWord(RTF_FIELD); writeGroupMark(true); - writeAttributes(m_attrib, RtfText.ATTR_NAMES); // Added by Boris Poudérous + writeAttributes(attrib, RtfText.ATTR_NAMES); // Added by Boris Poudérous writeStarControlWord(pageRef); writeGroupMark(false); writeGroupMark(true); diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfParagraph.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfParagraph.java index 82c7fd1f6..ca0aa8c2d 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfParagraph.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfParagraph.java @@ -118,18 +118,18 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, /** IRtfTextContainer requirement: return a copy of our attributes */ public RtfAttributes getTextContainerAttributes() { - if (m_attrib == null) { + if (attrib == null) { return null; } - return (RtfAttributes)this.m_attrib.clone(); + return (RtfAttributes)this.attrib.clone(); } /** overridden to write our attributes before our content */ protected void writeRtfPrefix() throws IOException { // collapse whitespace before writing out // TODO could be made configurable - if (m_attrib != null && m_attrib.isSet("WhiteSpaceFalse")) { - m_attrib.unset("WhiteSpaceFalse"); + if (attrib != null && attrib.isSet("WhiteSpaceFalse")) { + attrib.unset("WhiteSpaceFalse"); } else { new WhitespaceCollapser(this); } @@ -141,11 +141,11 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, // do not write text attributes here, they are handled // by RtfText - writeAttributes(m_attrib, PARA_ATTRIBUTES); + writeAttributes(attrib, PARA_ATTRIBUTES); // Added by Normand Masse // Write alignment attributes after \intbl for cells - if (m_attrib.isSet("intbl") && mustWriteAttributes()) { - writeAttributes(m_attrib, RtfText.ALIGNMENT); + if (attrib.isSet("intbl") && mustWriteAttributes()) { + writeAttributes(attrib, RtfText.ALIGNMENT); } //Set keepn if needed (Keep paragraph with the next paragraph) @@ -163,13 +163,13 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, // writeAttributes(m_attrib, new String [] {"cs"}); // Added by Normand Masse // If \intbl then attributes have already been written (see higher in method) - if (!m_attrib.isSet("intbl")) { - writeAttributes(m_attrib, RtfText.ALIGNMENT); + if (!attrib.isSet("intbl")) { + writeAttributes(attrib, RtfText.ALIGNMENT); } //this line added by Chris Scott, Westinghouse - writeAttributes(m_attrib, RtfText.BORDER); - writeAttributes(m_attrib, RtfText.INDENT); - writeAttributes(m_attrib, RtfText.TABS); + writeAttributes(attrib, RtfText.BORDER); + writeAttributes(attrib, RtfText.INDENT); + writeAttributes(attrib, RtfText.TABS); if (writeForBreak) { writeControlWord("pard\\par"); } @@ -181,8 +181,8 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, protected void writeRtfSuffix() throws IOException { // sometimes the end of paragraph mark must be suppressed in table cells boolean writeMark = true; - if (m_parent instanceof RtfTableCell) { - writeMark = ((RtfTableCell)m_parent).paragraphNeedsPar(this); + if (parent instanceof RtfTableCell) { + writeMark = ((RtfTableCell)parent).paragraphNeedsPar(this); } if (writeMark) { writeControlWord("par"); @@ -207,23 +207,23 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, */ public RtfText newText(String str, RtfAttributes attr) throws IOException { closeAll(); - m_text = new RtfText(this, m_writer, str, attr); + m_text = new RtfText(this, writer, str, attr); return m_text; } /** add a page break */ public void newPageBreak() throws IOException { writeForBreak = true; - new RtfPageBreak(this, m_writer); + new RtfPageBreak(this, writer); } /** add a line break */ public void newLineBreak() throws IOException { - new RtfLineBreak(this, m_writer); + new RtfLineBreak(this, writer); } public RtfPageNumber newPageNumber()throws IOException { - m_pageNumber = new RtfPageNumber(this, m_writer); + m_pageNumber = new RtfPageNumber(this, writer); return m_pageNumber; } @@ -231,20 +231,20 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, * Added by Boris POUDEROUS on 2002/07/09 */ public RtfPageNumberCitation newPageNumberCitation(String id) throws IOException { - m_pageNumberCitation = new RtfPageNumberCitation(this, m_writer, id); + m_pageNumberCitation = new RtfPageNumberCitation(this, writer, id); return m_pageNumberCitation; } /** Creates a new hyperlink. */ public RtfHyperLink newHyperLink(String str, RtfAttributes attr) throws IOException { - m_hyperlink = new RtfHyperLink(this, m_writer, str, attr); + m_hyperlink = new RtfHyperLink(this, writer, str, attr); return m_hyperlink; } /** start a new external graphic after closing all other elements */ public RtfExternalGraphic newImage() throws IOException { closeAll(); - m_externalGraphic = new RtfExternalGraphic(this, m_writer); + m_externalGraphic = new RtfExternalGraphic(this, writer); return m_externalGraphic; } @@ -269,7 +269,7 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, protected boolean okToWriteRtf() { boolean result = super.okToWriteRtf(); - if (m_parent.getOptions().ignoreEmptyParagraphs() && getChildCount() == 0) { + if (parent.getOptions().ignoreEmptyParagraphs() && getChildCount() == 0) { // TODO should test that this is the last RtfParagraph in the cell instead // of simply testing for last child?? result = false; diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfSection.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfSection.java index 22ca605df..0723222d7 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfSection.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfSection.java @@ -93,14 +93,14 @@ implements /** start a new external graphic after closing current paragraph, list and table */ public RtfExternalGraphic newImage() throws IOException { closeAll(); - m_externalGraphic = new RtfExternalGraphic(this, m_writer); + m_externalGraphic = new RtfExternalGraphic(this, writer); return m_externalGraphic; } /** start a new paragraph after closing current paragraph, list and table */ public RtfParagraph newParagraph(RtfAttributes attrs) throws IOException { closeAll(); - m_paragraph = new RtfParagraph(this, m_writer, attrs); + m_paragraph = new RtfParagraph(this, writer, attrs); return m_paragraph; } @@ -111,7 +111,7 @@ implements /** close current paragraph if any and start a new one */ public RtfParagraphKeepTogether newParagraphKeepTogether() throws IOException { - return new RtfParagraphKeepTogether(this, m_writer); + return new RtfParagraphKeepTogether(this, writer); } /** start a new table after closing current paragraph, list and table @@ -120,7 +120,7 @@ implements */ public RtfTable newTable(ITableColumnsInfo tc) throws IOException { closeAll(); - m_table = new RtfTable(this, m_writer, tc); + m_table = new RtfTable(this, writer, tc); return m_table; } @@ -130,34 +130,34 @@ implements */ public RtfTable newTable(RtfAttributes attrs, ITableColumnsInfo tc) throws IOException { closeAll(); - m_table = new RtfTable(this, m_writer, attrs, tc); + m_table = new RtfTable(this, writer, attrs, tc); return m_table; } /** start a new list after closing current paragraph, list and table */ public RtfList newList(RtfAttributes attrs) throws IOException { closeAll(); - m_list = new RtfList(this, m_writer, attrs); + m_list = new RtfList(this, writer, attrs); return m_list; } /** IRtfBeforeContainer */ public RtfBefore newBefore(RtfAttributes attrs) throws IOException { closeAll(); - m_before = new RtfBefore(this, m_writer, attrs); + m_before = new RtfBefore(this, writer, attrs); return m_before; } /** IRtfAfterContainer */ public RtfAfter newAfter(RtfAttributes attrs) throws IOException { closeAll(); - m_after = new RtfAfter(this, m_writer, attrs); + m_after = new RtfAfter(this, writer, attrs); return m_after; } public RtfJforCmd newJforCmd(RtfAttributes attrs) throws IOException { - m_jforCmd = new RtfJforCmd(this, m_writer, attrs); + m_jforCmd = new RtfJforCmd(this, writer, attrs); return m_jforCmd; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTable.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTable.java index 3d5b011f0..0350b6362 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTable.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTable.java @@ -99,14 +99,14 @@ public class RtfTable extends RtfContainer { } highestRow++; - m_row = new RtfTableRow(this, m_writer, m_attrib, highestRow); + m_row = new RtfTableRow(this, writer, attrib, highestRow); return m_row; } /** close current row if any and start a new one */ public RtfTableRow newTableRow(RtfAttributes attrs) throws IOException { RtfAttributes attr = null; - if (m_attrib != null) { - attr = (RtfAttributes) m_attrib.clone (); + if (attrib != null) { + attr = (RtfAttributes) attrib.clone (); attr.set (attrs); } else { attr = attrs; @@ -116,7 +116,7 @@ public class RtfTable extends RtfContainer { } highestRow++; - m_row = new RtfTableRow(this, m_writer, attr, highestRow); + m_row = new RtfTableRow(this, writer, attr, highestRow); return m_row; } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableCell.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableCell.java index 972e6a7ed..3be8f4498 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableCell.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableCell.java @@ -127,10 +127,10 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, // Get the number of columns spanned int nbMergedCells = ((Integer)attrs.getValue("number-columns-spanned")).intValue(); - if (parent.m_parent instanceof RtfTable) { + if (parent.parent instanceof RtfTable) { // Get the context of the current table in order to get the width of each column ITableColumnsInfo ITableColumnsInfo = - ((RtfTable)parent.m_parent).getITableColumnsInfo(); + ((RtfTable)parent.parent).getITableColumnsInfo(); ITableColumnsInfo.selectFirstColumn(); // Reach the column index in table context corresponding to the current column cell @@ -169,12 +169,12 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, } attrs.set("intbl"); - m_paragraph = new RtfParagraph(this, m_writer, attrs); + m_paragraph = new RtfParagraph(this, writer, attrs); - if (m_paragraph.m_attrib.isSet("qc")) { + if (m_paragraph.attrib.isSet("qc")) { set_center = true; attrs.set("qc"); - } else if (m_paragraph.m_attrib.isSet("qr")) { + } else if (m_paragraph.attrib.isSet("qr")) { set_right = true; attrs.set("qr"); } else { @@ -190,7 +190,7 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, /** start a new external graphic after closing current paragraph, list and table */ public RtfExternalGraphic newImage() throws IOException { closeAll(); - m_externalGraphic = new RtfExternalGraphic(this, m_writer); + m_externalGraphic = new RtfExternalGraphic(this, writer); return m_externalGraphic; } @@ -202,14 +202,14 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, /** start a new list after closing current paragraph, list and table */ public RtfList newList(RtfAttributes attrib) throws IOException { closeAll(); - m_list = new RtfList(this, m_writer, attrib); + m_list = new RtfList(this, writer, attrib); return m_list; } /** start a new nested table after closing current paragraph, list and table */ public RtfTable newTable(ITableColumnsInfo tc) throws IOException { closeAll(); - m_table = new RtfTable(this, m_writer, tc); + m_table = new RtfTable(this, writer, tc); return m_table; } @@ -218,7 +218,7 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, public RtfTable newTable(RtfAttributes attrs, ITableColumnsInfo tc) throws IOException { closeAll(); - m_table = new RtfTable(this,m_writer, attrs, tc); // Added tc Boris Poudérous 07/22/2002 + m_table = new RtfTable(this,writer, attrs, tc); // Added tc Boris Poudérous 07/22/2002 return m_table; } @@ -247,12 +247,12 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, * Added by Boris POUDEROUS on 2002/06/26 */ // Cell background color processing : - writeAttributes (m_attrib, ITableAttributes.CELL_COLOR); + writeAttributes (attrib, ITableAttributes.CELL_COLOR); /** - end - */ - writeAttributes (m_attrib, ITableAttributes.ATTRIB_CELL_PADDING); - writeAttributes (m_attrib, ITableAttributes.CELL_BORDER); - writeAttributes (m_attrib, BorderAttributesConverter.BORDERS); + writeAttributes (attrib, ITableAttributes.ATTRIB_CELL_PADDING); + writeAttributes (attrib, ITableAttributes.CELL_BORDER); + writeAttributes (attrib, BorderAttributesConverter.BORDERS); // cell width final int xPos = widthOffset + this.m_cellWidth; @@ -370,7 +370,7 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, // attributes to the new cells (in order not to have cell without // border for example) extraCell = m_parentRow.getExtraRowSet().createExtraCell(extraRowIndex, - m_widthOffset, this.getCellWidth(), m_attrib); + m_widthOffset, this.getCellWidth(), attrib); extraRowIndex++; } else if (extraCell != null) { diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java index 4d47c4be2..8bfb7ce02 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java @@ -90,14 +90,14 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { /** close current cell if any and start a new one */ public RtfTableCell newTableCell(int cellWidth) throws IOException { highestCell++; - m_cell = new RtfTableCell(this, m_writer, cellWidth, highestCell); + m_cell = new RtfTableCell(this, writer, cellWidth, highestCell); return m_cell; } /** close current cell if any and start a new one */ public RtfTableCell newTableCell(int cellWidth, RtfAttributes attrs) throws IOException { highestCell++; - m_cell = new RtfTableCell(this, m_writer, cellWidth, attrs, highestCell); + m_cell = new RtfTableCell(this, writer, cellWidth, attrs, highestCell); return m_cell; } @@ -109,7 +109,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { public RtfTableCell newTableCellMergedVertically(int cellWidth, RtfAttributes attrs) throws IOException { highestCell++; - m_cell = new RtfTableCell (this, m_writer, cellWidth, attrs, highestCell); + m_cell = new RtfTableCell (this, writer, cellWidth, attrs, highestCell); m_cell.setVMerge(RtfTableCell.MERGE_WITH_PREVIOUS); return m_cell; } @@ -126,7 +126,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { RtfAttributes wAttributes = (RtfAttributes)attrs.clone(); wAttributes.unset("number-columns-spanned"); - m_cell = new RtfTableCell(this, m_writer, cellWidth, wAttributes, highestCell); + m_cell = new RtfTableCell(this, writer, cellWidth, wAttributes, highestCell); m_cell.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS); return m_cell; } @@ -140,41 +140,41 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { // create new extra row set to allow our cells to put nested tables // in rows that will be rendered after this one - m_extraRowSet = new RtfExtraRowSet(m_writer); + m_extraRowSet = new RtfExtraRowSet(writer); // render the row and cells definitions writeControlWord("trowd"); //check for keep-together - if (m_attrib != null && m_attrib.isSet(ITableAttributes.ROW_KEEP_TOGETHER)) { + if (attrib != null && attrib.isSet(ITableAttributes.ROW_KEEP_TOGETHER)) { writeControlWord(ROW_KEEP_TOGETHER); } writePaddingAttributes(); // if we have attributes, manipulate border properties - final RtfTable parentTable = (RtfTable) m_parent; - if (m_attrib != null && parentTable != null) { + final RtfTable parentTable = (RtfTable) parent; + if (attrib != null && parentTable != null) { //if table is only one row long if (isFirstRow() && parentTable.isHighestRow(id)) { - m_attrib.unset(ITableAttributes.ROW_BORDER_HORIZONTAL); + attrib.unset(ITableAttributes.ROW_BORDER_HORIZONTAL); //or if row is the first row } else if (isFirstRow()) { - m_attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM); + attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM); //or if row is the last row } else if (parentTable.isHighestRow(id)) { - m_attrib.unset(ITableAttributes.ROW_BORDER_TOP); + attrib.unset(ITableAttributes.ROW_BORDER_TOP); //else the row is an inside row } else { - m_attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM); - m_attrib.unset(ITableAttributes.ROW_BORDER_TOP); + attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM); + attrib.unset(ITableAttributes.ROW_BORDER_TOP); } } - writeAttributes(m_attrib, ITableAttributes.ROW_BORDER); - writeAttributes(m_attrib, ITableAttributes.CELL_BORDER); - writeAttributes(m_attrib, BorderAttributesConverter.BORDERS); + writeAttributes(attrib, ITableAttributes.ROW_BORDER); + writeAttributes(attrib, ITableAttributes.CELL_BORDER); + writeAttributes(attrib, BorderAttributesConverter.BORDERS); /** * Added by Boris POUDEROUS on 07/02/2002 @@ -256,28 +256,28 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { if (index == 0) { if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_LEFT)) { cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_LEFT, - (String)m_attrib.getValue(ITableAttributes.ROW_BORDER_LEFT)); + (String)attrib.getValue(ITableAttributes.ROW_BORDER_LEFT)); } } if (index == this.getChildCount() - 1) { if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_RIGHT)) { cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_RIGHT, - (String)m_attrib.getValue(ITableAttributes.ROW_BORDER_RIGHT)); + (String)attrib.getValue(ITableAttributes.ROW_BORDER_RIGHT)); } } if (isFirstRow()) { if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_TOP)) { cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_TOP, - (String)m_attrib.getValue(ITableAttributes.ROW_BORDER_TOP)); + (String)attrib.getValue(ITableAttributes.ROW_BORDER_TOP)); } } if (parentTable.isHighestRow(id)) { if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_BOTTOM)) { cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_BOTTOM, - (String)m_attrib.getValue(ITableAttributes.ROW_BORDER_BOTTOM)); + (String)attrib.getValue(ITableAttributes.ROW_BORDER_BOTTOM)); } } @@ -309,15 +309,15 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { // use RTF 1.6 definitions - try to compute a reasonable RTF 1.5 value // out of them if present // how to do vertical padding with RTF 1.5? - if (m_attrib != null && !m_attrib.isSet(ATTR_RTF_15_TRGAPH)) { + if (attrib != null && !attrib.isSet(ATTR_RTF_15_TRGAPH)) { int gaph = -1; try { // set (RTF 1.5) gaph to the average of the (RTF 1.6) left and right padding values - final Integer leftPadStr = (Integer)m_attrib.getValue(ATTR_ROW_PADDING_LEFT); + final Integer leftPadStr = (Integer)attrib.getValue(ATTR_ROW_PADDING_LEFT); if (leftPadStr != null) { gaph = leftPadStr.intValue(); } - final Integer rightPadStr = (Integer)m_attrib.getValue(ATTR_ROW_PADDING_RIGHT); + final Integer rightPadStr = (Integer)attrib.getValue(ATTR_ROW_PADDING_RIGHT); if (rightPadStr != null) { gaph = (gaph + rightPadStr.intValue()) / 2; } @@ -326,12 +326,12 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { // getRtfFile().getLog().logWarning(msg); } if (gaph >= 0) { - m_attrib.set(ATTR_RTF_15_TRGAPH, gaph); + attrib.set(ATTR_RTF_15_TRGAPH, gaph); } } // write all padding attributes - writeAttributes(m_attrib, ATTRIB_ROW_PADDING); + writeAttributes(attrib, ATTRIB_ROW_PADDING); } public boolean isFirstRow() { diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java index e2b7c4dbb..be5c32fa7 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java @@ -207,7 +207,7 @@ public class RtfText extends RtfElement { if (m_attr != null && mustWriteAttributes()) { writeAttributes(m_attr, RtfText.ATTR_NAMES); } - RtfStringConverter.getInstance().writeRtfString(m_writer, m_text); + RtfStringConverter.getInstance().writeRtfString(writer, m_text); writeGroupMark(false); } @@ -222,10 +222,10 @@ public class RtfText extends RtfElement { /** IRtfTextContainer requirement: * @return a copy of our attributes */ public RtfAttributes getTextContainerAttributes() { - if (m_attrib == null) { + if (attrib == null) { return null; } - return (RtfAttributes)this.m_attrib.clone(); + return (RtfAttributes)this.attrib.clone(); } /** direct access to our text */