Skip to content

Commit

Permalink
Revert "Margins are not being set in the doc/docx format of BIRT repo…
Browse files Browse the repository at this point in the history
…rts"

This reverts commit 0e6a054.
  • Loading branch information
baswani committed Mar 17, 2017
1 parent 0e6a054 commit fd5b7c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Expand Up @@ -226,11 +226,11 @@ public void startTable( IStyle style, int tablewidth, boolean inForeign )
{
writer.openTag( "w:tbl" );
writer.openTag( "w:tblPr" );
writeTableIndent( style );
writeTableIndent( );
writeAttrTag( "w:tblStyle", "TableGrid" );
writeAttrTag( "w:tblOverlap", "Never" );
writeBidiTable( );
writeTableWidth( style, tablewidth );
writeTableWidth( tablewidth );
writeAttrTag( "w:tblLook", "01E0" );
writeTableLayout( );
writeTableBorders( style );
Expand Down Expand Up @@ -289,25 +289,14 @@ private void writeTableWidth( int tablewidth )
writer.closeTag( "w:tblW" );
}

private void writeTableIndent( IStyle style )
private void writeTableIndent( )
{
writer.openTag( "w:tblInd" );
writer.attribute( "w:w",
WordUtil.milliPt2Twips( PropertyUtil.getDimensionValue( style
.getProperty( StyleConstants.STYLE_MARGIN_LEFT ) ) ) );
writer.attribute( "w:w", 0 );
writer.attribute( "w:type", "dxa" );
writer.closeTag( "w:tblInd" );
}

private void writeTableWidth( IStyle style, int tablewidth )
{
int leftSpace = WordUtil.milliPt2Twips( PropertyUtil.getDimensionValue(
style.getProperty( StyleConstants.STYLE_MARGIN_LEFT ) ) );
int rightSpace = WordUtil.milliPt2Twips( PropertyUtil.getDimensionValue(
style.getProperty( StyleConstants.STYLE_MARGIN_RIGHT ) ) );
writeTableWidth( tablewidth - leftSpace - rightSpace );
}

protected void writeBorders( IStyle style, int bottomMargin, int topMargin,
int leftMargin, int rightMargin )
{
Expand Down
Expand Up @@ -582,8 +582,6 @@ else if ( color.equalsIgnoreCase( "Fuchsia" ) )
return "FF00FF";
else if ( color.equalsIgnoreCase( "Maroon" ) )
return "800000";
else if ( color.equalsIgnoreCase( "Orange" ) )
return "#FFA500";
String[] values = color.substring( color.indexOf( "(" ) + 1,
color.length( ) - 1 ).split( "," );
String value = "";
Expand Down

0 comments on commit fd5b7c8

Please sign in to comment.