From 00b4bf83b93177f57e2415b00c45a492e3421edd Mon Sep 17 00:00:00 2001 From: sguan Date: Tue, 16 Aug 2016 17:05:50 -0700 Subject: [PATCH] Revert changes from 8429ff1a7481687162179cb3e5ca34fde762fcb9 As the behavior is only affected by double border on table, this is a specific corner case. Signed-off-by: sguan --- .../emitter/wpml/AbstractEmitterImpl.java | 83 +------------------ .../engine/content/impl/TableBandContent.java | 21 ----- 2 files changed, 1 insertion(+), 103 deletions(-) diff --git a/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java b/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java index 4b38c256807..b844e1e1d76 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java +++ b/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java @@ -56,7 +56,6 @@ import org.eclipse.birt.report.engine.content.ITableContent; import org.eclipse.birt.report.engine.content.ITableGroupContent; import org.eclipse.birt.report.engine.content.ITextContent; -import org.eclipse.birt.report.engine.content.impl.TableBandContent; import org.eclipse.birt.report.engine.content.impl.TextContent; import org.eclipse.birt.report.engine.css.engine.StyleConstants; import org.eclipse.birt.report.engine.css.engine.value.DataFormatValue; @@ -81,6 +80,7 @@ import org.eclipse.birt.report.engine.util.FlashFile; import org.eclipse.birt.report.model.api.ReportDesignHandle; import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants; + import org.w3c.dom.css.CSSValue; import org.w3c.dom.css.CSSValueList; @@ -198,20 +198,8 @@ public static enum TextFlag { private boolean fixedLayout; protected int reportDpi; - - private int tableColCount = 0; protected static final String EMPTY_FOOTER = " "; - - protected static final String NO_STYLE = "none"; //$NON-NLS-1$ - - protected final int RIGHT = 0; - - protected final int LEFT = 1; - - protected final int TOP = 2; - - protected final int BOTTOM = 3; public void initialize( IEmitterServices service ) throws EngineException { @@ -514,37 +502,6 @@ public void startCell( ICellContent cell ) IStyle style = computeStyle( cell.getComputedStyle( ) ); // style.get - - IStyle tableStyle = context.getTableStyle( ); - int rowId = cell.getRow( ); // does not work! - String[] borderStyles = new String[4]; - if ( isFirstBand( cell ) && hasBorder( tableStyle.getBorderTopStyle( ) ) - && hasBorder( style.getBorderTopStyle( ) ) ) - { - borderStyles[TOP] = style.getBorderTopStyle( ); - style.setBorderTopStyle( NO_STYLE ); - } - - if ( columnId == 0 && hasBorder( tableStyle.getBorderLeftStyle( ) ) - && hasBorder( style.getBorderLeftStyle( ) ) )// first column - { - borderStyles[LEFT] = style.getBorderLeftStyle( ); - style.setBorderLeftStyle( NO_STYLE ); - } - if ( columnId == tableColCount - 1 - && hasBorder( tableStyle.getBorderRightStyle( ) ) - && hasBorder( style.getBorderRightStyle( ) ) ) - { - borderStyles[RIGHT] = style.getBorderRightStyle( ); - style.setBorderRightStyle( NO_STYLE ); - } - if ( isLastBand( cell ) - && hasBorder( tableStyle.getBorderBottomStyle( ) ) - && hasBorder( style.getBorderBottomStyle( ) ) ) - { - borderStyles[BOTTOM] = style.getBorderBottomStyle( ); - style.setBorderBottomStyle( NO_STYLE ); - } if ( rowSpan > 1 ) { @@ -565,43 +522,6 @@ && hasBorder( style.getBorderBottomStyle( ) ) ) { drawDiagonalLine( cell, WordUtil.twipToPt( cellWidth ) ); } - // return to original - if ( borderStyles[RIGHT] != null ) - { - style.setBorderRightStyle( borderStyles[RIGHT] ); - } - if ( borderStyles[LEFT] != null ) - { - style.setBorderLeftStyle( borderStyles[LEFT] ); - } - if ( borderStyles[TOP] != null ) - { - style.setBorderTopStyle( borderStyles[TOP] ); - } - if ( borderStyles[BOTTOM] != null ) - { - style.setBorderBottomStyle( borderStyles[BOTTOM] ); - } - } - - private boolean isLastBand( ICellContent cell ) - { - IContent tableBand = (IContent) ( (IContent) cell.getParent( ) ).getParent( ); - if( tableBand instanceof TableBandContent ) - { - return ( (TableBandContent) tableBand).isLastTableBand( ); - } - return false; - } - - private boolean isFirstBand( ICellContent cell ) - { - IContent tableBand = (IContent) ( (IContent) cell.getParent( ) ).getParent( ); - if( tableBand instanceof TableBandContent ) - { - return ( (TableBandContent) tableBand).isFirstTableBand( ); - } - return false; } private boolean hasBorder( String borderStyle ) @@ -651,7 +571,6 @@ protected DimensionType getCellHeight( ICellContent cell ) public void startTable( ITableContent table ) { - tableColCount = table.getColumnCount( ); adjustInline( ); styles.push( table.getComputedStyle( ) ); diff --git a/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/content/impl/TableBandContent.java b/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/content/impl/TableBandContent.java index a229e5bd9fc..c4f59540369 100644 --- a/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/content/impl/TableBandContent.java +++ b/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/content/impl/TableBandContent.java @@ -27,8 +27,6 @@ public class TableBandContent extends AbstractBandContent implements ITableBandContent { - private boolean lastTableBand = false; - private boolean firstTableBand = false; TableBandContent( ITableBandContent band ) { @@ -62,23 +60,4 @@ protected IContent cloneContent() return new TableBandContent(this); } - public void setLastTableBand( boolean lastTableBand ) - { - this.lastTableBand = lastTableBand; - } - - public boolean isLastTableBand( ) - { - return lastTableBand; - } - - public void setFirstTableBand( boolean firstTableBand ) - { - this.firstTableBand = firstTableBand; - } - - public boolean isFirstTableBand( ) - { - return firstTableBand; - } } \ No newline at end of file