Skip to content

Commit

Permalink
Merge pull request #340 from sguan-actuate/master
Browse files Browse the repository at this point in the history
Revert changes from 8429ff1
  • Loading branch information
Yulin Wang authored Aug 17, 2016
2 parents 23b044e + 00b4bf8 commit 4835d5d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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 )
{
Expand All @@ -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 )
Expand Down Expand Up @@ -651,7 +571,6 @@ protected DimensionType getCellHeight( ICellContent cell )

public void startTable( ITableContent table )
{
tableColCount = table.getColumnCount( );
adjustInline( );
styles.push( table.getComputedStyle( ) );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public class TableBandContent extends AbstractBandContent
implements
ITableBandContent
{
private boolean lastTableBand = false;
private boolean firstTableBand = false;

TableBandContent( ITableBandContent band )
{
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 4835d5d

Please sign in to comment.