diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java index e5b079aa63..ad8cadedb2 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java @@ -46,7 +46,7 @@ public final class HSSFCellStyle implements CellStyle { /** Creates new HSSFCellStyle why would you want to do this?? */ protected HSSFCellStyle(short index, ExtendedFormatRecord rec, HSSFWorkbook workbook) { - this(index, rec, workbook.getWorkbook()); + this(index, rec, workbook.getWorkbook()); } protected HSSFCellStyle(short index, ExtendedFormatRecord rec, InternalWorkbook workbook) { @@ -74,14 +74,14 @@ public final class HSSFCellStyle implements CellStyle { public HSSFCellStyle getParentStyle() { short parentIndex = _format.getParentIndex(); // parentIndex equal 0xFFF indicates no inheritance from a cell style XF (See 2.4.353 XF) - if(parentIndex == 0 || parentIndex == 0xFFF) { - return null; - } - return new HSSFCellStyle( - parentIndex, - _workbook.getExFormatAt(parentIndex), - _workbook - ); + if(parentIndex == 0 || parentIndex == 0xFFF) { + return null; + } + return new HSSFCellStyle( + parentIndex, + _workbook.getExFormatAt(parentIndex), + _workbook + ); } /** @@ -145,7 +145,7 @@ public final class HSSFCellStyle implements CellStyle { * @return the format string or "General" if not found */ public String getDataFormatString(org.apache.poi.ss.usermodel.Workbook workbook) { - HSSFDataFormat format = new HSSFDataFormat( ((HSSFWorkbook)workbook).getWorkbook() ); + HSSFDataFormat format = new HSSFDataFormat( ((HSSFWorkbook)workbook).getWorkbook() ); int idx = getDataFormat(); return idx == -1 ? "General" : format.getFormat(getDataFormat()); @@ -156,7 +156,7 @@ public final class HSSFCellStyle implements CellStyle { * @see org.apache.poi.hssf.usermodel.HSSFDataFormat */ public String getDataFormatString(org.apache.poi.hssf.model.InternalWorkbook workbook) { - HSSFDataFormat format = new HSSFDataFormat( workbook ); + HSSFDataFormat format = new HSSFDataFormat( workbook ); return format.getFormat(getDataFormat()); } @@ -169,9 +169,9 @@ public final class HSSFCellStyle implements CellStyle { */ @Override public void setFont(Font font) { - setFont((HSSFFont)font); - } - public void setFont(HSSFFont font) { + setFont((HSSFFont)font); + } + public void setFont(HSSFFont font) { _format.setIndentNotParentFont(true); short fontindex = font.getIndex(); _format.setFontIndex(fontindex); @@ -194,7 +194,7 @@ public final class HSSFCellStyle implements CellStyle { * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short) */ public HSSFFont getFont(org.apache.poi.ss.usermodel.Workbook parentWorkbook) { - return ((HSSFWorkbook) parentWorkbook).getFontAt(getFontIndex()); + return ((HSSFWorkbook) parentWorkbook).getFontAt(getFontIndex()); } /** @@ -714,15 +714,15 @@ public final class HSSFCellStyle implements CellStyle { */ private void checkDefaultBackgroundFills() { if (_format.getFillForeground() == org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index) { - //JMH: Why +1, hell why not. I guess it made some sense to someone at the time. Doesnt - //to me now.... But experience has shown that when the fore is set to AUTOMATIC then the - //background needs to be incremented...... - if (_format.getFillBackground() != (org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index+1)) - setFillBackgroundColor((short)(org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index+1)); + //JMH: Why +1, hell why not. I guess it made some sense to someone at the time. Doesnt + //to me now.... But experience has shown that when the fore is set to AUTOMATIC then the + //background needs to be incremented...... + if (_format.getFillBackground() != (org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index+1)) + setFillBackgroundColor((short)(org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index+1)); } else if (_format.getFillBackground() == org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index+1) - //Now if the forground changes to a non-AUTOMATIC color the background resets itself!!! - if (_format.getFillForeground() != org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index) - setFillBackgroundColor(org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index); + //Now if the forground changes to a non-AUTOMATIC color the background resets itself!!! + if (_format.getFillForeground() != org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index) + setFillBackgroundColor(org.apache.poi.hssf.util.HSSFColor.AUTOMATIC.index); } /** @@ -767,13 +767,13 @@ public final class HSSFCellStyle implements CellStyle { @Override public short getFillBackgroundColor() { - short result = _format.getFillBackground(); - //JMH: Do this ridiculous conversion, and let HSSFCellStyle - //internally migrate back and forth - if (result == (HSSFColor.AUTOMATIC.index+1)) { - return HSSFColor.AUTOMATIC.index; - } - return result; + short result = _format.getFillBackground(); + //JMH: Do this ridiculous conversion, and let HSSFCellStyle + //internally migrate back and forth + if (result == (HSSFColor.AUTOMATIC.index+1)) { + return HSSFColor.AUTOMATIC.index; + } + return result; } @Override @@ -827,14 +827,14 @@ public final class HSSFCellStyle implements CellStyle { * styles where no name has been defined */ public String getUserStyleName() { - StyleRecord sr = _workbook.getStyleRecord(_index); - if(sr == null) { - return null; - } - if(sr.isBuiltin()) { - return null; - } - return sr.getName(); + StyleRecord sr = _workbook.getStyleRecord(_index); + if(sr == null) { + return null; + } + if(sr.isBuiltin()) { + return null; + } + return sr.getName(); } /** @@ -842,16 +842,16 @@ public final class HSSFCellStyle implements CellStyle { * Will complain if you try this on a built in style. */ public void setUserStyleName(String styleName) { - StyleRecord sr = _workbook.getStyleRecord(_index); - if(sr == null) { - sr = _workbook.createStyleRecord(_index); - } - // All Style records start as "builtin", but generally - // only 20 and below really need to be - if(sr.isBuiltin() && _index <= 20) { - throw new IllegalArgumentException("Unable to set user specified style names for built in styles!"); - } - sr.setName(styleName); + StyleRecord sr = _workbook.getStyleRecord(_index); + if(sr == null) { + sr = _workbook.createStyleRecord(_index); + } + // All Style records start as "builtin", but generally + // only 20 and below really need to be + if(sr.isBuiltin() && _index <= 20) { + throw new IllegalArgumentException("Unable to set user specified style names for built in styles!"); + } + sr.setName(styleName); } /** @@ -860,7 +860,7 @@ public final class HSSFCellStyle implements CellStyle { */ @Override public void setShrinkToFit(boolean shrinkToFit) { - _format.setShrinkToFit(shrinkToFit); + _format.setShrinkToFit(shrinkToFit); } /** * Should the Cell be auto-sized by Excel to shrink @@ -868,9 +868,9 @@ public final class HSSFCellStyle implements CellStyle { */ @Override public boolean getShrinkToFit() { - return _format.getShrinkToFit(); + return _format.getShrinkToFit(); } - + /** * Get the reading order, for RTL/LTR ordering of * the text. @@ -903,10 +903,10 @@ public final class HSSFCellStyle implements CellStyle { * @throws IllegalArgumentException if there's a workbook mis-match */ public void verifyBelongsToWorkbook(HSSFWorkbook wb) { - if(wb.getWorkbook() != _workbook) { - throw new IllegalArgumentException("This Style does not belong to the supplied Workbook. Are you trying to assign a style from one workbook to the cell of a differnt workbook?"); - } - } + if(wb.getWorkbook() != _workbook) { + throw new IllegalArgumentException("This Style does not belong to the supplied Workbook. Are you trying to assign a style from one workbook to the cell of a differnt workbook?"); + } + } /** * Clones all the style information from another @@ -922,71 +922,71 @@ public final class HSSFCellStyle implements CellStyle { */ @Override public void cloneStyleFrom(CellStyle source) { - if(source instanceof HSSFCellStyle) { - this.cloneStyleFrom((HSSFCellStyle)source); - } else { - throw new IllegalArgumentException("Can only clone from one HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle"); - } - } + if(source instanceof HSSFCellStyle) { + this.cloneStyleFrom((HSSFCellStyle)source); + } else { + throw new IllegalArgumentException("Can only clone from one HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle"); + } + } public void cloneStyleFrom(HSSFCellStyle source) { - // First we need to clone the extended format - // record - _format.cloneStyleFrom(source._format); + // First we need to clone the extended format + // record + _format.cloneStyleFrom(source._format); - // Handle matching things if we cross workbooks - if(_workbook != source._workbook) { + // Handle matching things if we cross workbooks + if(_workbook != source._workbook) { lastDateFormat.set(Short.MIN_VALUE); lastFormats.set(null); getDataFormatStringCache.set(null); - - // Then we need to clone the format string, - // and update the format record for this - short fmt = (short)_workbook.createFormat(source.getDataFormatString() ); - setDataFormat(fmt); + + // Then we need to clone the format string, + // and update the format record for this + short fmt = (short)_workbook.createFormat(source.getDataFormatString() ); + setDataFormat(fmt); - // Finally we need to clone the font, - // and update the format record for this - FontRecord fr = _workbook.createNewFont(); - fr.cloneStyleFrom( - source._workbook.getFontRecordAt( - source.getFontIndex() - ) - ); + // Finally we need to clone the font, + // and update the format record for this + FontRecord fr = _workbook.createNewFont(); + fr.cloneStyleFrom( + source._workbook.getFontRecordAt( + source.getFontIndex() + ) + ); - HSSFFont font = new HSSFFont( - (short)_workbook.getFontIndex(fr), fr - ); - setFont(font); - } + HSSFFont font = new HSSFFont( + (short)_workbook.getFontIndex(fr), fr + ); + setFont(font); + } } - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((_format == null) ? 0 : _format.hashCode()); - result = prime * result + _index; - return result; - } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((_format == null) ? 0 : _format.hashCode()); + result = prime * result + _index; + return result; + } - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (obj instanceof HSSFCellStyle) { - final HSSFCellStyle other = (HSSFCellStyle) obj; - if (_format == null) { - if (other._format != null) - return false; - } else if (!_format.equals(other._format)) - return false; - if (_index != other._index) - return false; - return true; - } - return false; - } - + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null) return false; + if (obj instanceof HSSFCellStyle) { + final HSSFCellStyle other = (HSSFCellStyle) obj; + if (_format == null) { + if (other._format != null) + return false; + } else if (!_format.equals(other._format)) + return false; + if (_index != other._index) + return false; + return true; + } + return false; + } + } diff --git a/src/java/org/apache/poi/ss/util/CellUtil.java b/src/java/org/apache/poi/ss/util/CellUtil.java index 9ae26e4734..94fa751be5 100644 --- a/src/java/org/apache/poi/ss/util/CellUtil.java +++ b/src/java/org/apache/poi/ss/util/CellUtil.java @@ -42,433 +42,433 @@ import org.apache.poi.ss.usermodel.Workbook; */ public final class CellUtil { - public static final String ALIGNMENT = "alignment"; - public static final String BORDER_BOTTOM = "borderBottom"; - public static final String BORDER_LEFT = "borderLeft"; - public static final String BORDER_RIGHT = "borderRight"; - public static final String BORDER_TOP = "borderTop"; - public static final String BOTTOM_BORDER_COLOR = "bottomBorderColor"; - public static final String DATA_FORMAT = "dataFormat"; - public static final String FILL_BACKGROUND_COLOR = "fillBackgroundColor"; - public static final String FILL_FOREGROUND_COLOR = "fillForegroundColor"; - public static final String FILL_PATTERN = "fillPattern"; - public static final String FONT = "font"; - public static final String HIDDEN = "hidden"; - public static final String INDENTION = "indention"; - public static final String LEFT_BORDER_COLOR = "leftBorderColor"; - public static final String LOCKED = "locked"; - public static final String RIGHT_BORDER_COLOR = "rightBorderColor"; - public static final String ROTATION = "rotation"; - public static final String TOP_BORDER_COLOR = "topBorderColor"; - public static final String VERTICAL_ALIGNMENT = "verticalAlignment"; - public static final String WRAP_TEXT = "wrapText"; + public static final String ALIGNMENT = "alignment"; + public static final String BORDER_BOTTOM = "borderBottom"; + public static final String BORDER_LEFT = "borderLeft"; + public static final String BORDER_RIGHT = "borderRight"; + public static final String BORDER_TOP = "borderTop"; + public static final String BOTTOM_BORDER_COLOR = "bottomBorderColor"; + public static final String DATA_FORMAT = "dataFormat"; + public static final String FILL_BACKGROUND_COLOR = "fillBackgroundColor"; + public static final String FILL_FOREGROUND_COLOR = "fillForegroundColor"; + public static final String FILL_PATTERN = "fillPattern"; + public static final String FONT = "font"; + public static final String HIDDEN = "hidden"; + public static final String INDENTION = "indention"; + public static final String LEFT_BORDER_COLOR = "leftBorderColor"; + public static final String LOCKED = "locked"; + public static final String RIGHT_BORDER_COLOR = "rightBorderColor"; + public static final String ROTATION = "rotation"; + public static final String TOP_BORDER_COLOR = "topBorderColor"; + public static final String VERTICAL_ALIGNMENT = "verticalAlignment"; + public static final String WRAP_TEXT = "wrapText"; - private static UnicodeMapping unicodeMappings[]; + private static UnicodeMapping unicodeMappings[]; - private static final class UnicodeMapping { + private static final class UnicodeMapping { - public final String entityName; - public final String resolvedValue; + public final String entityName; + public final String resolvedValue; - public UnicodeMapping(String pEntityName, String pResolvedValue) { - entityName = "&" + pEntityName + ";"; - resolvedValue = pResolvedValue; - } - } + public UnicodeMapping(String pEntityName, String pResolvedValue) { + entityName = "&" + pEntityName + ";"; + resolvedValue = pResolvedValue; + } + } - private CellUtil() { - // no instances of this class - } + private CellUtil() { + // no instances of this class + } - /** - * Get a row from the spreadsheet, and create it if it doesn't exist. - * - *@param rowIndex The 0 based row number - *@param sheet The sheet that the row is part of. - *@return The row indicated by the rowCounter - */ - public static Row getRow(int rowIndex, Sheet sheet) { - Row row = sheet.getRow(rowIndex); - if (row == null) { - row = sheet.createRow(rowIndex); - } - return row; - } + /** + * Get a row from the spreadsheet, and create it if it doesn't exist. + * + *@param rowIndex The 0 based row number + *@param sheet The sheet that the row is part of. + *@return The row indicated by the rowCounter + */ + public static Row getRow(int rowIndex, Sheet sheet) { + Row row = sheet.getRow(rowIndex); + if (row == null) { + row = sheet.createRow(rowIndex); + } + return row; + } - /** - * Get a specific cell from a row. If the cell doesn't exist, then create it. - * - *@param row The row that the cell is part of - *@param columnIndex The column index that the cell is in. - *@return The cell indicated by the column. - */ - public static Cell getCell(Row row, int columnIndex) { - Cell cell = row.getCell(columnIndex); + /** + * Get a specific cell from a row. If the cell doesn't exist, then create it. + * + *@param row The row that the cell is part of + *@param columnIndex The column index that the cell is in. + *@return The cell indicated by the column. + */ + public static Cell getCell(Row row, int columnIndex) { + Cell cell = row.getCell(columnIndex); - if (cell == null) { - cell = row.createCell(columnIndex); - } - return cell; - } + if (cell == null) { + cell = row.createCell(columnIndex); + } + return cell; + } - /** - * Creates a cell, gives it a value, and applies a style if provided - * - * @param row the row to create the cell in - * @param column the column index to create the cell in - * @param value The value of the cell - * @param style If the style is not null, then set - * @return A new Cell - */ - public static Cell createCell(Row row, int column, String value, CellStyle style) { - Cell cell = getCell(row, column); + /** + * Creates a cell, gives it a value, and applies a style if provided + * + * @param row the row to create the cell in + * @param column the column index to create the cell in + * @param value The value of the cell + * @param style If the style is not null, then set + * @return A new Cell + */ + public static Cell createCell(Row row, int column, String value, CellStyle style) { + Cell cell = getCell(row, column); - cell.setCellValue(cell.getRow().getSheet().getWorkbook().getCreationHelper() - .createRichTextString(value)); - if (style != null) { - cell.setCellStyle(style); - } - return cell; - } + cell.setCellValue(cell.getRow().getSheet().getWorkbook().getCreationHelper() + .createRichTextString(value)); + if (style != null) { + cell.setCellStyle(style); + } + return cell; + } - /** - * Create a cell, and give it a value. - * - *@param row the row to create the cell in - *@param column the column index to create the cell in - *@param value The value of the cell - *@return A new Cell. - */ - public static Cell createCell(Row row, int column, String value) { - return createCell(row, column, value, null); - } + /** + * Create a cell, and give it a value. + * + *@param row the row to create the cell in + *@param column the column index to create the cell in + *@param value The value of the cell + *@return A new Cell. + */ + public static Cell createCell(Row row, int column, String value) { + return createCell(row, column, value, null); + } - /** - * Take a cell, and align it. - * - *@param cell the cell to set the alignment for - *@param workbook The workbook that is being worked with. - *@param align the column alignment to use. - * - * @see CellStyle for alignment options - */ - public static void setAlignment(Cell cell, Workbook workbook, short align) { - setCellStyleProperty(cell, workbook, ALIGNMENT, Short.valueOf(align)); - } + /** + * Take a cell, and align it. + * + *@param cell the cell to set the alignment for + *@param workbook The workbook that is being worked with. + *@param align the column alignment to use. + * + * @see CellStyle for alignment options + */ + public static void setAlignment(Cell cell, Workbook workbook, short align) { + setCellStyleProperty(cell, workbook, ALIGNMENT, Short.valueOf(align)); + } - /** - * Take a cell, and apply a font to it - * - *@param cell the cell to set the alignment for - *@param workbook The workbook that is being worked with. - *@param font The Font that you want to set... - */ - public static void setFont(Cell cell, Workbook workbook, Font font) { - // Check if font belongs to workbook - final short fontIndex = font.getIndex(); - if (!workbook.getFontAt(fontIndex).equals(font)) { - throw new IllegalArgumentException("Font does not belong to this workbook"); - } + /** + * Take a cell, and apply a font to it + * + *@param cell the cell to set the alignment for + *@param workbook The workbook that is being worked with. + *@param font The Font that you want to set... + */ + public static void setFont(Cell cell, Workbook workbook, Font font) { + // Check if font belongs to workbook + final short fontIndex = font.getIndex(); + if (!workbook.getFontAt(fontIndex).equals(font)) { + throw new IllegalArgumentException("Font does not belong to this workbook"); + } - // Check if cell belongs to workbook - // (checked in setCellStyleProperty) + // Check if cell belongs to workbook + // (checked in setCellStyleProperty) - setCellStyleProperty(cell, workbook, FONT, fontIndex); - } + setCellStyleProperty(cell, workbook, FONT, fontIndex); + } - /** - *
This method attempts to find an existing CellStyle that matches the cell's
- * current style plus styles properties in properties. A new style is created if the
- * workbook does not contain a matching style.
Modifies the cell style of cell without affecting other cells that use the
- * same style.
This is necessary because Excel has an upper limit on the number of styles that it supports.
- * - *This function is more efficient than multiple calls to - * {@link #setCellStyleProperty(org.apache.poi.ss.usermodel.Cell, org.apache.poi.ss.usermodel.Workbook, String, Object)} - * if adding multiple cell styles.
- * - *For performance reasons, if this is the only cell in a workbook that uses a cell style, - * this method does NOT remove the old style from the workbook. - * - *
- * - * @param cell The cell to change the style of - * @param properties The properties to be added to a cell style, as {propertyName: propertyValue}. - * @since POI 3.14 beta 2 - */ - public static void setCellStyleProperties(Cell cell, MapThis method attempts to find an existing CellStyle that matches the cell's
+ * current style plus styles properties in properties. A new style is created if the
+ * workbook does not contain a matching style.
Modifies the cell style of cell without affecting other cells that use the
+ * same style.
This is necessary because Excel has an upper limit on the number of styles that it supports.
+ * + *This function is more efficient than multiple calls to + * {@link #setCellStyleProperty(org.apache.poi.ss.usermodel.Cell, org.apache.poi.ss.usermodel.Workbook, String, Object)} + * if adding multiple cell styles.
+ * + *For performance reasons, if this is the only cell in a workbook that uses a cell style, + * this method does NOT remove the old style from the workbook. + * + *
+ * + * @param cell The cell to change the style of + * @param properties The properties to be added to a cell style, as {propertyName: propertyValue}. + * @since POI 3.14 beta 2 + */ + public static void setCellStyleProperties(Cell cell, MapThis method attempts to find an existing CellStyle that matches the cell's
- * current style plus a single style property propertyName with value
- * propertyValue.
- * A new style is created if the workbook does not contain a matching style.
Modifies the cell style of cell without affecting other cells that use the
- * same style.
If setting more than one cell style property on a cell, use - * {@link #setCellStyleProperties(org.apache.poi.ss.usermodel.Cell, Map)}, - * which is faster and does not add unnecessary intermediate CellStyles to the workbook.
- * - * @param workbook The workbook that is being worked with. - * @param propertyName The name of the property that is to be changed. - * @param propertyValue The value of the property that is to be changed. - * @param cell The cell that needs it's style changes - */ - public static void setCellStyleProperty(Cell cell, Workbook workbook, String propertyName, - Object propertyValue) { - if (cell.getSheet().getWorkbook() != workbook) { - throw new IllegalArgumentException("Cannot set cell style property. Cell does not belong to workbook."); - } + /** + *This method attempts to find an existing CellStyle that matches the cell's
+ * current style plus a single style property propertyName with value
+ * propertyValue.
+ * A new style is created if the workbook does not contain a matching style.
Modifies the cell style of cell without affecting other cells that use the
+ * same style.
If setting more than one cell style property on a cell, use + * {@link #setCellStyleProperties(org.apache.poi.ss.usermodel.Cell, Map)}, + * which is faster and does not add unnecessary intermediate CellStyles to the workbook.
+ * + * @param workbook The workbook that is being worked with. + * @param propertyName The name of the property that is to be changed. + * @param propertyValue The value of the property that is to be changed. + * @param cell The cell that needs it's style changes + */ + public static void setCellStyleProperty(Cell cell, Workbook workbook, String propertyName, + Object propertyValue) { + if (cell.getSheet().getWorkbook() != workbook) { + throw new IllegalArgumentException("Cannot set cell style property. Cell does not belong to workbook."); + } - Mapstyle, so subsequent changes
* to style will not modify the map, and changes to the returned
* map will not modify the cell style. The returned map is mutable.
- *
- * @param style cell style
- * @return map of format properties (String -> Object)
- * @see #setFormatProperties(org.apache.poi.ss.usermodel.CellStyle, org.apache.poi.ss.usermodel.Workbook, java.util.Map)
- */
- private static Mapnull if not set
*/
public XSSFColor getFillBackgroundXSSFColor() {
- // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
+ // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
if(_cellXf.isSetApplyFill() && !_cellXf.getApplyFill()) return null;
int fillIndex = (int)_cellXf.getFillId();
@@ -478,7 +478,7 @@ public class XSSFCellStyle implements CellStyle {
* @return XSSFColor - fill color or null if not set
*/
public XSSFColor getFillForegroundXSSFColor() {
- // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
+ // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
if(_cellXf.isSetApplyFill() && !_cellXf.getApplyFill()) return null;
int fillIndex = (int)_cellXf.getFillId();
@@ -515,7 +515,7 @@ public class XSSFCellStyle implements CellStyle {
*/
@Override
public short getFillPattern() {
- // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
+ // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
if(_cellXf.isSetApplyFill() && !_cellXf.getApplyFill()) return 0;
int fillIndex = (int)_cellXf.getFillId();
@@ -1064,7 +1064,7 @@ public class XSSFCellStyle implements CellStyle {
*/
private CTFill getCTFill(){
CTFill ct;
- // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
+ // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
if(!_cellXf.isSetApplyFill() || _cellXf.getApplyFill()) {
int fillIndex = (int)_cellXf.getFillId();
XSSFCellFill cf = _stylesSource.getFillAt(fillIndex);
@@ -1138,7 +1138,7 @@ public class XSSFCellStyle implements CellStyle {
* @see org.apache.poi.ss.usermodel.FillPatternType
*/
public void setFillPattern(FillPatternType ptrn) {
- setFillPattern((short)ptrn.ordinal());
+ setFillPattern((short)ptrn.ordinal());
}
/**