/** * Finds a font that matches the one with the supplied attributes */ @Override public HSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { int numberOfFonts = getNumberOfFontsAsInt(); for (int i = 0; i <= numberOfFonts; i++) { // Remember - there is no 4! if(i == 4) { continue; } HSSFFont hssfFont = getFontAt(i); if (hssfFont.getBold() == bold && hssfFont.getColor() == color && hssfFont.getFontHeight() == fontHeight && hssfFont.getFontName().equals(name) && hssfFont.getItalic() == italic && hssfFont.getStrikeout() == strikeout && hssfFont.getTypeOffset() == typeOffset && hssfFont.getUnderline() == underline) { return hssfFont; } } return null; }
byte underline = cell.getCellStyle().getFont(workbook).getUnderline(); if (underline == 1) { primaryKeyList.add(columnName);
/** * Finds a font that matches the one with the supplied attributes */ public HSSFFont findFont(short boldWeight, short color, short fontHeight, 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); if (hssfFont.getBoldweight() == boldWeight && hssfFont.getColor() == color && hssfFont.getFontHeight() == fontHeight && hssfFont.getFontName().equals(name) && hssfFont.getItalic() == italic && hssfFont.getStrikeout() == strikeout && hssfFont.getTypeOffset() == typeOffset && hssfFont.getUnderline() == underline) { return hssfFont; } } return null; }
/** * Finds a font that matches the one with the supplied attributes */ public HSSFFont findFont(short boldWeight, short color, short fontHeight, 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); if (hssfFont.getBoldweight() == boldWeight && hssfFont.getColor() == color && hssfFont.getFontHeight() == fontHeight && hssfFont.getFontName().equals(name) && hssfFont.getItalic() == italic && hssfFont.getStrikeout() == strikeout && hssfFont.getTypeOffset() == typeOffset && hssfFont.getUnderline() == underline) { return hssfFont; } } return null; }
/** * Finds a font that matches the one with the supplied attributes */ @Override public HSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { int numberOfFonts = getNumberOfFontsAsInt(); for (int i = 0; i <= numberOfFonts; i++) { // Remember - there is no 4! if(i == 4) { continue; } HSSFFont hssfFont = getFontAt(i); if (hssfFont.getBold() == bold && hssfFont.getColor() == color && hssfFont.getFontHeight() == fontHeight && hssfFont.getFontName().equals(name) && hssfFont.getItalic() == italic && hssfFont.getStrikeout() == strikeout && hssfFont.getTypeOffset() == typeOffset && hssfFont.getUnderline() == underline) { return hssfFont; } } return null; }
fontNew.setStrikeout(fontOld.getStrikeout()); fontNew.setTypeOffset(fontOld.getTypeOffset()); fontNew.setUnderline(fontOld.getUnderline()); return fontNew;
(cf.getColor() == forecolor) && (cf.getFontHeightInPoints() == fontSize) && ((cf.getUnderline() == HSSFFont.U_SINGLE)?(font.isUnderline()):(!font.isUnderline())) && (cf.getStrikeout() == font.isStrikeThrough()) && ((cf.getBoldweight() == HSSFFont.BOLDWEIGHT_BOLD)?(font.isBold()):(!font.isBold())) &&
newFont.setCharSet(cellFont.getCharSet()); newFont.setColor(cellFont.getColor()); newFont.setUnderline(cellFont.getUnderline()); newFont.setFontHeight(cellFont.getFontHeight()); newFont.setFontHeightInPoints(cellFont.getFontHeightInPoints());
newFont.setCharSet(cellFont.getCharSet()); newFont.setColor(cellFont.getColor()); newFont.setUnderline(cellFont.getUnderline()); newFont.setFontHeight(cellFont.getFontHeight()); newFont.setFontHeightInPoints(cellFont.getFontHeightInPoints());
style.setItalic(true); if(font.getUnderline()!=Font.U_NONE){ style.setUnderline(true);