From: Josh Micich Date: Tue, 8 Jul 2008 18:56:21 +0000 (+0000) Subject: Fix bug #45338 - JDK 1.4/1.5 issue from r673997 X-Git-Tag: REL_3_2_FINAL~263 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e9099a1cbe217afa09e0d8e6d82adbf8d8b359b5;p=poi.git Fix bug #45338 - JDK 1.4/1.5 issue from r673997 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@674911 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index 5bb4a34333..0191b4248a 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -360,28 +360,28 @@ public class HSSFWorkbook extends POIDocument log.log(POILogger.DEBUG, "convertLabelRecords exit"); } - /** - * Retrieves the current policy on what to do when - * getting missing or blank cells from a row. - * The default is to return blank and null cells. - * {@link MissingCellPolicy} - */ - public MissingCellPolicy getMissingCellPolicy() { - return missingCellPolicy; - } - - /** - * Sets the policy on what to do when - * getting missing or blank cells from a row. - * This will then apply to all calls to - * {@link HSSFRow.getCell()}. See - * {@link MissingCellPolicy} - */ - public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) { - this.missingCellPolicy = missingCellPolicy; - } - - /** + /** + * Retrieves the current policy on what to do when + * getting missing or blank cells from a row. + * The default is to return blank and null cells. + * {@link MissingCellPolicy} + */ + public MissingCellPolicy getMissingCellPolicy() { + return missingCellPolicy; + } + + /** + * Sets the policy on what to do when + * getting missing or blank cells from a row. + * This will then apply to all calls to + * {@link HSSFRow.getCell()}. See + * {@link MissingCellPolicy} + */ + public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) { + this.missingCellPolicy = missingCellPolicy; + } + + /** * sets the order of appearance for a given sheet. * * @param sheetname the name of the sheet to reorder @@ -1020,11 +1020,11 @@ public class HSSFWorkbook extends POIDocument String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { - for (short i=0; i<=getNumberOfFonts(); i++) { - // Remember - there is no 4! - if(i == 4) continue; - - HSSFFont hssfFont = getFontAt(i); + for (short i=0; i<=getNumberOfFonts(); i++) { + // Remember - there is no 4! + if(i == 4) continue; + + HSSFFont hssfFont = getFontAt(i); if (hssfFont.getBoldweight() == boldWeight && hssfFont.getColor() == color && hssfFont.getFontHeight() == fontHeight @@ -1056,19 +1056,17 @@ public class HSSFWorkbook extends POIDocument * @param idx index number * @return HSSFFont at the index */ + public HSSFFont getFontAt(short idx) { + if(fonts == null) fonts = new Hashtable(); + + // So we don't confuse users, give them back + // the same object every time, but create + // them lazily + Short sIdx = new Short(idx); + if(fonts.containsKey(sIdx)) { + return (HSSFFont)fonts.get(sIdx); + } - public HSSFFont getFontAt(short idx) - { - if(fonts == null) fonts = new Hashtable(); - - // So we don't confuse users, give them back - // the same object every time, but create - // them lazily - Short sIdx = Short.valueOf(idx); - if(fonts.containsKey(sIdx)) { - return (HSSFFont)fonts.get(sIdx); - } - FontRecord font = workbook.getFontRecordAt(idx); HSSFFont retval = new HSSFFont(idx, font); fonts.put(sIdx, retval);