klease 01/06/14 14:22:56 Modified: src/org/apache/fop/fo/flow TableCell.java Log: Submitted by: Ivan Demakov Reviewed by: Karen Lease Improves cell borders when border-collapse=collapse (the default). Note that this doesn't implement the full CR, but it's a big improvement and will handle many common cases. Revision Changes Path 1.32 +20 -4 xml-fop/src/org/apache/fop/fo/flow/TableCell.java Index: TableCell.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableCell.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- TableCell.java 2001/05/02 21:00:49 1.31 +++ TableCell.java 2001/06/14 21:22:54 1.32 @@ -1,4 +1,4 @@ -/*-- $Id: TableCell.java,v 1.31 2001/05/02 21:00:49 klease Exp $ -- +/*-- $Id: TableCell.java,v 1.32 2001/06/14 21:22:54 klease Exp $ -- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources. @@ -47,6 +47,9 @@ */ protected int beforeOffset; + /* ivan demakov */ + protected int borderHeight = 0; + protected int height = 0; protected int top; // Ypos of cell ??? protected int verticalAlign ; @@ -155,7 +158,7 @@ this.cellArea = new AreaContainer(propMgr.getFontState(area.getFontInfo()), startOffset, beforeOffset, - width, area.spaceLeft()- m_borderSeparation/2, + width, area.spaceLeft()- m_borderSeparation/2 + borderHeight/2, Position.RELATIVE); cellArea.foCreator=this; // G Seshadri @@ -215,7 +218,7 @@ // TableRow calls this. Anyone else? public int getHeight() { // return cellArea.getHeight() + spaceBefore + spaceAfter; - return cellArea.getHeight() + m_borderSeparation ; + return cellArea.getHeight() + m_borderSeparation - borderHeight / 2; } /** Called by TableRow to set final size of cell content rectangles and @@ -230,7 +233,7 @@ // cellArea.setMaxHeight(h); // Increase content height by difference of row content height // and current cell allocation height (includes borders & padding) - cellArea.increaseHeight(h - cellArea.getHeight()); + cellArea.increaseHeight(h + borderHeight/2 - cellArea.getHeight()); if (bRelativeAlign) { // Must get info for all cells starting in row! // verticalAlign can be BEFORE or BASELINE @@ -316,6 +319,19 @@ column. Look out for spanning columns. */ + /* ivan demakov */ + int borderStart = bp.getBorderLeftWidth(false); + int borderEnd = bp.getBorderRightWidth(false); + int borderBefore = bp.getBorderTopWidth(false); + int borderAfter = bp.getBorderBottomWidth(false); + + int contentOffset = borderStart/2 + bp.getPaddingLeft(false); + + this.startOffset += contentOffset; + this.width -= (contentOffset + borderEnd/2 + bp.getPaddingRight(false)); + + this.beforeOffset = borderBefore/2 + bp.getPaddingTop(false); + this.borderHeight = borderBefore + borderAfter; } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]