foObjs.put("table", new Ta());
foObjs.put("table-column", new TC());
foObjs.put("table-caption", new TCaption());
- foObjs.put("table-header", new TB());
+ foObjs.put("table-header", new TH());
foObjs.put("table-footer", new TB());
foObjs.put("table-body", new TB());
foObjs.put("table-row", new TR());
return new org.apache.fop.fo.flow.TableBody(parent);
}
}
+
+ static class TH extends ElementMapping.Maker {
+ public FONode make(FONode parent) {
+ return new org.apache.fop.fo.flow.TableHeader(parent);
+ }
+ }
static class TR extends ElementMapping.Maker {
public FONode make(FONode parent) {
import org.apache.fop.fo.flow.TableColumn;
import org.apache.fop.fo.flow.TableBody;
import org.apache.fop.fo.flow.TableCell;
+import org.apache.fop.fo.flow.TableHeader;
import org.apache.fop.fo.flow.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.Property;
import org.apache.fop.fo.LengthProperty;
import org.apache.fop.apps.Document;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfBeforeContainer;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfTextrunContainer;
private final Logger log = new ConsoleLogger();
private RtfSection sect;
private RtfDocumentArea docArea;
- //private RtfParagraph para; //never used
- private boolean warned = false;
private boolean bPrevHeaderSpecified = false;//true, if there has been a
//header in any page-sequence
private boolean bPrevFooterSpecified = false;//true, if there has been a
contAfter.newAfter(attr);
}
- // print ALPHA_WARNING
- if (!warned) {
- sect.newParagraph().newText(ALPHA_WARNING);
- warned = true;
- }
} else if (fl.getFlowName().equals("xsl-region-before")) {
bHeaderSpecified = true;
bPrevHeaderSpecified = true;
final RtfTable tbl = (RtfTable)builderContext.getContainer(RtfTable.class,
true, null);
- RtfAttributes tblAttribs = tbl.getRtfAttributes();
- RtfAttributes tblRowAttribs = new RtfAttributes();
RtfAttributes atts = TableAttributesConverter.convertRowAttributes(tr.properties,
tbl.getHeaderAttribs());
+
+ if(tr.getParent() instanceof TableHeader) {
+ atts.set(ITableAttributes.ATTR_HEADER);
+ }
builderContext.pushContainer(tbl.newTableRow(atts));
/** half the space between the cells of a table row in twips */
String ATTR_RTF_15_TRGAPH = "trgaph";
String ATTR_ROW_LEFT_INDENT = "trleft";
+
+ /** table row header */
+ public final String ATTR_HEADER = "trhdr";
// RTF 1.6 Row and table attributes
/** table row padding, top */
String[] CELL_COLOR = {
CELL_SHADE, CELL_COLOR_BACKGROUND, CELL_COLOR_FOREGROUND
};
-}
\ No newline at end of file
+}
final String cmd = (String)it.next();
if (cmd.equals(PARA_KEEP_ON)) {
- paragraphKeeptogetherContext.keepTogetherOpen();
+ ParagraphKeeptogetherContext.keepTogetherOpen();
} else if (cmd.equals(PARA_KEEP_OFF)) {
- paragraphKeeptogetherContext.keepTogetherClose();
+ ParagraphKeeptogetherContext.keepTogetherClose();
} else {
// this.getRtfFile ().getLog ().logInfo
// ("JFOR-CMD ignored, command not recognised:"+cmd);
}
-}
\ No newline at end of file
+}
final RtfTable parentTable = (RtfTable) parent;
adjustBorderProperties(parentTable);
+ writeAttributes(attrib,new String[]{ITableAttributes.ATTR_HEADER});
writeAttributes(attrib, ITableAttributes.ROW_BORDER);
writeAttributes(attrib, ITableAttributes.CELL_BORDER);
writeAttributes(attrib, BorderAttributesConverter.BORDERS);
{
RtfTableRow r = tbl.newTableRow();
RtfTableCell c = r.newTableCell(80 * MM_TO_TWIPS);
- c.setHMerge(c.MERGE_START);
+ c.setHMerge(RtfTableCell.MERGE_START);
c.newParagraph().newText("cell 0,0, width 80mm, merge start, "
+ "followed by two merged cells totalling 80mm width.");
c = r.newTableCell(40 * MM_TO_TWIPS);
- c.setHMerge(c.MERGE_WITH_PREVIOUS);
+ c.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
c.newParagraph().newText("THIS IS IN AN HMERGED CELL, MUST NOT APPEAR IN RTF DOCUMENT");
c = r.newTableCell(40 * MM_TO_TWIPS);
- c.setHMerge(c.MERGE_WITH_PREVIOUS);
+ c.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
c.newParagraph().newText("THIS IS IN AN HMERGED CELL, MUST NOT APPEAR IN RTF DOCUMENT");
}
{
RtfTableRow r = tbl.newTableRow();
RtfTableCell c = r.newTableCell(40 * MM_TO_TWIPS);
- c.setVMerge(c.MERGE_START);
+ c.setVMerge(RtfTableCell.MERGE_START);
c.newParagraph().newText("cell 1,0, vertical merge start, 40mm, spans three rows.");
r.newTableCell(80 * MM_TO_TWIPS).newParagraph().newText("cell 1,1, no merge, 80mm");
c = r.newTableCell(40 * MM_TO_TWIPS);
- c.setVMerge(c.MERGE_START);
+ c.setVMerge(RtfTableCell.MERGE_START);
c.newParagraph().newText("cell 1,2, vertical merge start, 40mm, spans two rows.");
}
{
RtfTableRow r = tbl.newTableRow();
RtfTableCell c = r.newTableCell(40 * MM_TO_TWIPS);
- c.setVMerge(c.MERGE_WITH_PREVIOUS);
+ c.setVMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
c.newParagraph().newText("cell 2,0, VMERGED CELL, MUST NOT APPEAR IN RTF DOCUMENT");
r.newTableCell(40 * MM_TO_TWIPS).newParagraph().newText("cell 2,1, no merge, 40mm");
r.newTableCell(40 * MM_TO_TWIPS).newParagraph().newText("cell 2,2, no merge, 40mm");
c = r.newTableCell(40 * MM_TO_TWIPS);
- c.setVMerge(c.MERGE_WITH_PREVIOUS);
+ c.setVMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
c.newParagraph().newText("cell 2,3, VMERGED CELL, MUST NOT APPEAR IN RTF DOCUMENT");
}
{
RtfTableRow r = tbl.newTableRow();
RtfTableCell c = r.newTableCell(40 * MM_TO_TWIPS);
- c.setVMerge(c.MERGE_WITH_PREVIOUS);
+ c.setVMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
c.newParagraph().newText("cell 3,0, VMERGED CELL, MUST NOT APPEAR IN RTF DOCUMENT");
r.newTableCell(10 * MM_TO_TWIPS).newParagraph().newText("cell 3,1, no merge, 10mm");
("cell 4,0, width 160mm, only cell in this row");
}
}
-}
\ No newline at end of file
+}