<td><a name="fo-property-border-collapse" id=
"fo-property-border-collapse">border-collapse</a></td>
<td class="extended">Extended</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
- <td class="yes">yes</td>
- <td>Some small limitations</td>
+ <td class="partial">partial</td>
+ <td class="partial">partial</td>
+ <td class="partial">partial</td>
+ <td>value "collapse-with-precedence" not yet supported</td>
</tr>
<tr>
<td align="center"><a href=
private ConditionalBorder(BorderSpecification normal,
BorderSpecification leadingTrailing, BorderSpecification rest,
CollapsingBorderModel collapsingBorderModel) {
+ assert collapsingBorderModel != null;
this.normal = normal;
this.leadingTrailing = leadingTrailing;
this.rest = rest;
*/
ConditionalBorder(BorderSpecification borderSpecification,
CollapsingBorderModel collapsingBorderModel) {
- normal = borderSpecification;
- leadingTrailing = normal;
- if (borderSpecification.getBorderInfo().getWidth().isDiscard()) {
- rest = BorderSpecification.getDefaultBorder();
- } else {
- rest = leadingTrailing;
- }
- this.collapsingBorderModel = collapsingBorderModel;
+ this ( borderSpecification, borderSpecification,
+ borderSpecification.getBorderInfo().getWidth().isDiscard()
+ ? BorderSpecification.getDefaultBorder() : borderSpecification,
+ collapsingBorderModel );
}
/**
getFOValidationEventProducer().unimplementedFeature(this, getName(),
"table-layout=\"auto\"", getLocator());
}
- if (!isSeparateBorderModel()
- && getCommonBorderPaddingBackground().hasPadding(
- ValidationPercentBaseContext.getPseudoContext())) {
- //See "17.6.2 The collapsing border model" in CSS2
- TableEventProducer eventProducer = TableEventProducer.Provider.get(
- getUserAgent().getEventBroadcaster());
- eventProducer.noTablePaddingWithCollapsingBorderModel(this, getLocator());
+ if (!isSeparateBorderModel()) {
+ if (borderCollapse == EN_COLLAPSE_WITH_PRECEDENCE) {
+ getFOValidationEventProducer().unimplementedFeature(this, getName(),
+ "border-collapse=\"collapse-with-precedence\"; defaulting to \"collapse\"", getLocator());
+ borderCollapse = EN_COLLAPSE;
+ }
+ if (getCommonBorderPaddingBackground().hasPadding(
+ ValidationPercentBaseContext.getPseudoContext())) {
+ //See "17.6.2 The collapsing border model" in CSS2
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.noTablePaddingWithCollapsingBorderModel(this, getLocator());
+ }
}
/* Store reference to the property list, so
//These statics are used singleton-style. No MT issues here.
private static CollapsingBorderModel collapse = null;
- private static CollapsingBorderModel collapseWithPrecedence = null;
+ // private static CollapsingBorderModel collapseWithPrecedence = null;
/**
* @param borderCollapse border collapse control
}
return collapse;
case Constants.EN_COLLAPSE_WITH_PRECEDENCE:
- if (collapseWithPrecedence == null) {
- //collapseWithPrecedence = new CollapsingBorderModelWithPrecedence();
- }
- return collapseWithPrecedence;
+ throw new UnsupportedOperationException ( "collapse-with-precedence not yet supported" );
default:
throw new IllegalArgumentException("Illegal border-collapse mode.");
}
*/
protected void renderText(TextArea area) {
int col = Helper.ceilPosition(this.currentIPPosition, CHAR_WIDTH);
- int row = Helper.ceilPosition(this.currentBPPosition - LINE_LEADING, CHAR_HEIGHT + 2*LINE_LEADING);
+ int row = Helper.ceilPosition(this.currentBPPosition - LINE_LEADING, CHAR_HEIGHT + 2 * LINE_LEADING);
String s = area.getText();
double height = bounds.getHeight();
pageWidth = Helper.ceilPosition((int) width, CHAR_WIDTH);
- pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT + 2*LINE_LEADING);
+ pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT + 2 * LINE_LEADING);
// init buffers
charData = new StringBuffer[pageHeight];
*/
public void renderImage(Image image, Rectangle2D pos) {
int x1 = Helper.ceilPosition(currentIPPosition, CHAR_WIDTH);
- int y1 = Helper.ceilPosition(currentBPPosition - LINE_LEADING, CHAR_HEIGHT + 2*LINE_LEADING);
+ 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 + 2*LINE_LEADING);
+ int height = Helper.ceilPosition((int) pos.getHeight(), CHAR_HEIGHT + 2 * LINE_LEADING);
fillRect(x1, y1, width, height, IMAGE_CHAR);
}
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 + 2*LINE_LEADING));
+ 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 + 2*LINE_LEADING));
+ bm.setStartY(Helper.ceilPosition(toMilli(starty), CHAR_HEIGHT + 2 * LINE_LEADING));
super.drawBackAndBorders(area, startx, starty, width, height);
}
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Code" dev="GA" type="fix" fixes-bug="52572" due-to="Pascal Sancho">
+ Prevent NPE on use of unsupported collapse-with-precedence; fall back to collapse. Fix checkstyle errors from prior commit.
+ </action>
<action context="Code" dev="GA" type="fix" fixes-bug="52514" due-to="Luis Bernardo">
Ensure square image is appropriately scaled.
</action>