compact css

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1189624 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-10-27 06:17:03 +00:00
parent b31307ad4f
commit 7299feef29

View File

@ -153,7 +153,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
{ {
StringBuilder style = new StringBuilder(); StringBuilder style = new StringBuilder();
style.append( "white-space: pre-wrap; " ); style.append( "white-space:pre-wrap;" );
ExcelToHtmlUtils.appendAlign( style, cellStyle.getAlignment() ); ExcelToHtmlUtils.appendAlign( style, cellStyle.getAlignment() );
if ( cellStyle.getFillPattern() == 0 ) if ( cellStyle.getFillPattern() == 0 )
@ -165,16 +165,16 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
final HSSFColor foregroundColor = cellStyle final HSSFColor foregroundColor = cellStyle
.getFillForegroundColorColor(); .getFillForegroundColorColor();
if ( foregroundColor != null ) if ( foregroundColor != null )
style.append( "background-color: " style.append( "background-color:"
+ ExcelToHtmlUtils.getColor( foregroundColor ) + "; " ); + ExcelToHtmlUtils.getColor( foregroundColor ) + ";" );
} }
else else
{ {
final HSSFColor backgroundColor = cellStyle final HSSFColor backgroundColor = cellStyle
.getFillBackgroundColorColor(); .getFillBackgroundColorColor();
if ( backgroundColor != null ) if ( backgroundColor != null )
style.append( "background-color: " style.append( "background-color:"
+ ExcelToHtmlUtils.getColor( backgroundColor ) + "; " ); + ExcelToHtmlUtils.getColor( backgroundColor ) + ";" );
} }
buildStyle_border( workbook, style, "top", cellStyle.getBorderTop(), buildStyle_border( workbook, style, "top", cellStyle.getBorderTop(),
@ -211,7 +211,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
borderStyle.append( ExcelToHtmlUtils.getColor( color ) ); borderStyle.append( ExcelToHtmlUtils.getColor( color ) );
} }
style.append( "border-" + type + ": " + borderStyle + "; " ); style.append( "border-" + type + ":" + borderStyle + ";" );
} }
void buildStyle_font( HSSFWorkbook workbook, StringBuilder style, void buildStyle_font( HSSFWorkbook workbook, StringBuilder style,
@ -220,7 +220,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
switch ( font.getBoldweight() ) switch ( font.getBoldweight() )
{ {
case HSSFFont.BOLDWEIGHT_BOLD: case HSSFFont.BOLDWEIGHT_BOLD:
style.append( "font-weight: bold; " ); style.append( "font-weight:bold;" );
break; break;
case HSSFFont.BOLDWEIGHT_NORMAL: case HSSFFont.BOLDWEIGHT_NORMAL:
// by default, not not increase HTML size // by default, not not increase HTML size
@ -235,11 +235,11 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
+ "; " ); + "; " );
if ( font.getFontHeightInPoints() != 0 ) if ( font.getFontHeightInPoints() != 0 )
style.append( "font-size: " + font.getFontHeightInPoints() + "pt; " ); style.append( "font-size:" + font.getFontHeightInPoints() + "pt;" );
if ( font.getItalic() ) if ( font.getItalic() )
{ {
style.append( "font-style: italic; " ); style.append( "font-style:italic;" );
} }
} }