|
|
@ -674,8 +674,6 @@ namespace NPOI.SS.Converter |
|
|
|
{ |
|
|
|
style.Append("white-space: pre-wrap; "); |
|
|
|
ExcelToHtmlUtils.AppendAlign(style, cellStyle.Alignment); |
|
|
|
StylesTable st = ((XSSFWorkbook)workbook).GetStylesSource(); |
|
|
|
ThemesTable tt = st.GetTheme(); |
|
|
|
if (cellStyle.FillPattern == FillPattern.NoFill) |
|
|
|
{ |
|
|
|
// no fill
|
|
|
@ -741,7 +739,7 @@ namespace NPOI.SS.Converter |
|
|
|
|
|
|
|
if (workbook is HSSFWorkbook) |
|
|
|
{ |
|
|
|
HSSFColor color = ((HSSFWorkbook)workbook).GetCustomPalette().GetColor(borderColor); |
|
|
|
HSSFColor color = ((HSSFWorkbook)workbook).GetCustomPalette()?.GetColor(borderColor); |
|
|
|
if (color != null) |
|
|
|
{ |
|
|
|
borderStyle.Append(' '); |
|
|
@ -758,7 +756,7 @@ namespace NPOI.SS.Converter |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
XSSFColor color = ((XSSFWorkbook)workbook).GetStylesSource().GetTheme().GetThemeColor(borderColor); |
|
|
|
XSSFColor color = ((XSSFWorkbook)workbook)?.GetStylesSource()?.GetTheme()?.GetThemeColor(borderColor); |
|
|
|
if (color != null) |
|
|
|
{ |
|
|
|
borderStyle.Append(' '); |
|
|
@ -785,7 +783,7 @@ namespace NPOI.SS.Converter |
|
|
|
|
|
|
|
if (workbook is HSSFWorkbook) |
|
|
|
{ |
|
|
|
HSSFColor fontColor = ((HSSFWorkbook)workbook).GetCustomPalette().GetColor(font.Color); |
|
|
|
HSSFColor fontColor = ((HSSFWorkbook)workbook).GetCustomPalette()?.GetColor(font.Color); |
|
|
|
if (fontColor != null) |
|
|
|
style.AppendFormat("color:{0}; " ,ExcelToHtmlUtils.GetColor(fontColor) ); |
|
|
|
} |
|
|
|