diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-06-09 14:11:16 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-06-09 14:11:16 +0000 |
commit | 2ab4f01d9a5bf07e5f2b6ee4bb93dc107ef86eff (patch) | |
tree | ad535a955c5decfdb08fd0602b854f2c67496cc8 /src/java/org/apache/fop/layoutmgr | |
parent | 7d7910f72b18167d0f5cbc441a99aeeaa97e0838 (diff) | |
download | xmlgraphics-fop-2ab4f01d9a5bf07e5f2b6ee4bb93dc107ef86eff.tar.gz xmlgraphics-fop-2ab4f01d9a5bf07e5f2b6ee4bb93dc107ef86eff.zip |
Merged revisions 665691 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
................
r665691 | jeremias | 2008-06-09 15:01:53 +0100 (Mon, 09 Jun 2008) | 82 lines
Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-664698 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
........
r638937 | jeremias | 2008-03-19 18:08:57 +0100 (Mi, 19 Mrz 2008) | 1 line
A nit.
........
r640889 | vhennebert | 2008-03-25 17:43:55 +0100 (Di, 25 Mrz 2008) | 2 lines
Set the final release date and added a news item about the 0.95beta release (the change was made before updating the website)
........
r642906 | jeremias | 2008-03-31 09:12:40 +0200 (Mo, 31 Mrz 2008) | 3 lines
Added version number to xml-apis-ext (as suggested by Karel Vervaeke).
Moved xml-apis to same version as xml-apis-ext.
Added missing licensing info about xml-apis-ext.
........
r647403 | jeremias | 2008-04-12 11:02:01 +0200 (Sa, 12 Apr 2008) | 1 line
Fixed NullPointerException when loading a TrueType font using XML font metric files.
........
r647537 | jeremias | 2008-04-13 09:36:00 +0200 (So, 13 Apr 2008) | 1 line
Performance improvement when encoding images: Fixed an important hotspot by extending CloseBlocker from ProxyOutputStream instead of FilterOutputStream as the latter routes all write(byte[]) calls through write(int).
........
r648984 | jeremias | 2008-04-17 09:00:22 +0200 (Do, 17 Apr 2008) | 1 line
HeadURL was missing in the properties.
........
r649006 | jeremias | 2008-04-17 10:42:52 +0200 (Do, 17 Apr 2008) | 1 line
Fixed text extraction problem with ZapfDingbats and Symbol font in PDF output. These fonts are symbolic and must not use an Encoding value in PDF. Applies to the built-in base 14 variant and to the case where these fonts are explicitely embedded.
........
r649014 | jeremias | 2008-04-17 11:10:15 +0200 (Do, 17 Apr 2008) | 1 line
Added missing change information.
........
r650550 | vhennebert | 2008-04-22 17:22:31 +0200 (Di, 22 Apr 2008) | 4 lines
Bugzilla 41621:
- length of the penalty now correctly computed;
- AssertionError fixed.
........
r651302 | jeremias | 2008-04-24 18:08:53 +0200 (Do, 24 Apr 2008) | 3 lines
Fixed regression causing bad positioning of block-containers if used as descendant of a table-cell. This was not caught because of the lack of a test case that would have shown the problem in visual testing with BatchDiffer.
See also: http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200804.mbox/%3c20080424164128.973A.DEV@jeremias-maerki.ch%3e
........
r653537 | vhennebert | 2008-05-05 19:47:28 +0200 (Mo, 05 Mai 2008) | 2 lines
Bugfix: the before border of cells below a column-spanning cell had their value taken from the leading case, instead of the normal one.
........
r654453 | jeremias | 2008-05-08 11:14:04 +0200 (Do, 08 Mai 2008) | 2 lines
Added /usr/local/share/fonts as additional possible location for fonts on Unixes.
........
r656286 | jeremias | 2008-05-14 16:16:49 +0200 (Mi, 14 Mai 2008) | 1 line
Restored plug-in API compatibility with FOP 0.94. Fixes a NoSuchMethodError when Barcode4J is run.
........
r656524 | jeremias | 2008-05-15 09:07:18 +0200 (Do, 15 Mai 2008) | 1 line
Fixed rendering of fixed block-containers in AFP output. The break-out was actually never implemented which is necessary for supporting fixed positioned viewports.
........
r657520 | maxberger | 2008-05-18 11:38:45 +0200 (So, 18 Mai 2008) | 1 line
Updated as per suggestions in bug 45019
........
r661580 | maxberger | 2008-05-30 08:42:17 +0200 (Fr, 30 Mai 2008) | 1 line
added my key to KEYS, it is used for signing mvn artifacts
........
r663482 | jeremias | 2008-06-05 09:06:37 +0200 (Do, 05 Jun 2008) | 1 line
Fixed positioning of absolutely positioned block-containers in multi-column documents.
........
r664692 | jeremias | 2008-06-09 14:49:45 +0200 (Mo, 09 Jun 2008) | 1 line
Restored PSImageUtils. I had deleted it prematurely. Extensions like Barcode4J rely on this class.
........
................
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@665697 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr')
3 files changed, 47 insertions, 23 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java index bed9c53ae..d432c7657 100644 --- a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java +++ b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java @@ -229,8 +229,12 @@ class RowPainter { // Then add areas for cells finishing on the current row for (int i = 0; i < colCount; i++) { - GridUnit currentGU = currentRow.getGridUnit(i); - if (!currentGU.isEmpty() && currentGU.getColSpanIndex() == 0 + GridUnit currentGU = currentRow.getGridUnit(i); + if (currentGU.isEmpty()) { + // TODO remove once missing cells are properly implemented (i.e., replaced + // by an fo:table-cell element containing an empty fo:block) + firstCellOnPage[i] = false; + } else if (currentGU.getColSpanIndex() == 0 && (lastInPart || currentGU.isLastGridUnitRowSpan()) && firstCellParts[i] != null) { assert firstCellParts[i].pgu == currentGU.getPrimary(); @@ -260,7 +264,8 @@ class RowPainter { actualRowHeight, borderBeforeWhich, borderAfterWhich, lastOnPage); firstCellParts[i] = null; - firstCellOnPage[i] = false; + Arrays.fill(firstCellOnPage, i, i + currentGU.getCell().getNumberColumnsSpanned(), + false); } } currentRowOffset += actualRowHeight; diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 7a2ee171c..9b4a03a67 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.ListIterator; import java.util.Map; import org.apache.commons.logging.Log; @@ -41,6 +42,7 @@ import org.apache.fop.layoutmgr.ElementListUtils; import org.apache.fop.layoutmgr.KeepUtil; import org.apache.fop.layoutmgr.KnuthBox; import org.apache.fop.layoutmgr.KnuthElement; +import org.apache.fop.layoutmgr.KnuthGlue; import org.apache.fop.layoutmgr.KnuthPossPosIter; import org.apache.fop.layoutmgr.LayoutContext; import org.apache.fop.layoutmgr.ListElement; @@ -232,6 +234,17 @@ public class TableContentLayoutManager implements PercentBaseContext { //Get elements for next row group nextRowGroupElems = rowGroupLM.getNextKnuthElements(context, alignment, bodyType); + /* + * The last break element produced by TableStepper (for the previous row + * group) may be used to represent the break between the two row groups. + * Its penalty value and break class must just be overridden by the + * characteristics of the keep or break between the two. + * + * However, we mustn't forget that if the after border of the last row of + * the row group is thicker in the normal case than in the trailing case, + * an additional glue will be appended to the element list. So we may have + * to go two steps backwards in the list. + */ //Determine keep constraints int penaltyStrength = BlockLevelLayoutManager.KEEP_AUTO; @@ -246,24 +259,35 @@ public class TableContentLayoutManager implements PercentBaseContext { if (breakBetween != Constants.EN_AUTO) { penaltyValue = -KnuthElement.INFINITE; } - TableHFPenaltyPosition penaltyPos = new TableHFPenaltyPosition(getTableLM()); - int penaltyLen = 0; - if (bodyType == TableRowIterator.BODY) { - if (!getTableLM().getTable().omitHeaderAtBreak()) { - penaltyLen += getHeaderNetHeight(); - penaltyPos.headerElements = getHeaderElements(); - } - if (!getTableLM().getTable().omitFooterAtBreak()) { - penaltyLen += getFooterNetHeight(); - penaltyPos.footerElements = getFooterElements(); - } + BreakElement breakElement; + ListIterator elemIter = returnList.listIterator(returnList.size()); + ListElement elem = (ListElement) elemIter.previous(); + if (elem instanceof KnuthGlue) { + breakElement = (BreakElement) elemIter.previous(); + } else { + breakElement = (BreakElement) elem; } - returnList.add(new BreakElement(penaltyPos, - penaltyLen, penaltyValue, breakBetween, context)); + breakElement.setPenaltyValue(penaltyValue); + breakElement.setBreakClass(breakBetween); returnList.addAll(nextRowGroupElems); breakBetween = context.getBreakAfter(); } } + /* + * The last break produced for the last row-group of this table part must be + * removed, because the breaking after the table will be handled by TableLM. + * Unless the element list ends with a glue, which must be kept to accurately + * represent the content. In such a case the break is simply disabled by setting + * its penalty to infinite. + */ + ListIterator elemIter = returnList.listIterator(returnList.size()); + ListElement elem = (ListElement) elemIter.previous(); + if (elem instanceof KnuthGlue) { + BreakElement breakElement = (BreakElement) elemIter.previous(); + breakElement.setPenaltyValue(KnuthElement.INFINITE); + } else { + elemIter.remove(); + } context.updateKeepWithPreviousPending(keepWithPrevious); context.setBreakBefore(breakBefore); diff --git a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java index 7c963338f..6aa619368 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java @@ -282,13 +282,8 @@ public class TableStepper { laststep = step; step = getNextStep(); } while (step >= 0); - if (!returnList.isEmpty()) { - lastTCPos.setFlag(TableContentPosition.LAST_IN_ROWGROUP, true); - // It's not up to TableStepper to decide whether there can/must be a break - // after the row group or not, but to ancestor stacking elements - assert returnList.getLast() instanceof BreakElement; - returnList.removeLast(); - } + assert !returnList.isEmpty(); + lastTCPos.setFlag(TableContentPosition.LAST_IN_ROWGROUP, true); return returnList; } |