/** * XMLBeans and the XSD make this look like it can have multiple values, but it is maxOccurrs=1. * Use get*Array(), it is much faster than get*List(). * * @see org.apache.poi.ss.usermodel.FontFormatting#isStruckout() */ @Override public boolean isStruckout() { for (CTBooleanProperty bProp : _font.getStrikeArray()) return bProp.getVal(); return false; }
/** * get a boolean value that specify whether to use italics or not * * @return boolean - value for italic */ public boolean getItalic() { CTBooleanProperty italic = _ctFont.sizeOfIArray() == 0 ? null : _ctFont.getIArray(0); return italic != null && italic.getVal(); }
/** * get a boolean value that specify whether to use a strikeout horizontal line through the text or not * * @return boolean - value for strikeout */ public boolean getStrikeout() { CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? null : _ctFont.getStrikeArray(0); return strike != null && strike.getVal(); }
/** * get a boolean value for the boldness to use. * * @return boolean - bold */ public boolean getBold() { CTBooleanProperty bold = _ctFont.sizeOfBArray() == 0 ? null : _ctFont.getBArray(0); return (bold != null && bold.getVal()); }
/** * get whether the font weight is set to bold or not * * @return bold - whether the font is bold or not */ @Override public boolean isBold(){ return _font.sizeOfBArray() == 1 && _font.getBArray(0).getVal(); }
/** * @return true if font style was set to <i>italic</i> */ @Override public boolean isItalic(){ return _font.sizeOfIArray() == 1 && _font.getIArray(0).getVal(); }
/** * Copy font attributes from CTFont bean into CTRPrElt bean */ private void setRunAttributes(CTFont ctFont, CTRPrElt pr){ if(ctFont.sizeOfBArray() > 0) pr.addNewB().setVal(ctFont.getBArray(0).getVal()); if(ctFont.sizeOfUArray() > 0) pr.addNewU().setVal(ctFont.getUArray(0).getVal()); if(ctFont.sizeOfIArray() > 0) pr.addNewI().setVal(ctFont.getIArray(0).getVal()); if(ctFont.sizeOfColorArray() > 0) { CTColor c1 = ctFont.getColorArray(0); CTColor c2 = pr.addNewColor(); if(c1.isSetAuto()) c2.setAuto(c1.getAuto()); if(c1.isSetIndexed()) c2.setIndexed(c1.getIndexed()); if(c1.isSetRgb()) c2.setRgb(c1.getRgb()); if(c1.isSetTheme()) c2.setTheme(c1.getTheme()); if(c1.isSetTint()) c2.setTint(c1.getTint()); } if(ctFont.sizeOfSzArray() > 0) pr.addNewSz().setVal(ctFont.getSzArray(0).getVal()); if(ctFont.sizeOfNameArray() > 0) pr.addNewRFont().setVal(ctFont.getNameArray(0).getVal()); if(ctFont.sizeOfFamilyArray() > 0) pr.addNewFamily().setVal(ctFont.getFamilyArray(0).getVal()); if(ctFont.sizeOfSchemeArray() > 0) pr.addNewScheme().setVal(ctFont.getSchemeArray(0).getVal()); if(ctFont.sizeOfCharsetArray() > 0) pr.addNewCharset().setVal(ctFont.getCharsetArray(0).getVal()); if(ctFont.sizeOfCondenseArray() > 0) pr.addNewCondense().setVal(ctFont.getCondenseArray(0).getVal()); if(ctFont.sizeOfExtendArray() > 0) pr.addNewExtend().setVal(ctFont.getExtendArray(0).getVal()); if(ctFont.sizeOfVertAlignArray() > 0) pr.addNewVertAlign().setVal(ctFont.getVertAlignArray(0).getVal()); if(ctFont.sizeOfOutlineArray() > 0) pr.addNewOutline().setVal(ctFont.getOutlineArray(0).getVal()); if(ctFont.sizeOfShadowArray() > 0) pr.addNewShadow().setVal(ctFont.getShadowArray(0).getVal()); if(ctFont.sizeOfStrikeArray() > 0) pr.addNewStrike().setVal(ctFont.getStrikeArray(0).getVal()); }
if(pr.sizeOfBArray() > 0) ctFont.addNewB().setVal(pr.getBArray(0).getVal()); if(pr.sizeOfUArray() > 0) ctFont.addNewU().setVal(pr.getUArray(0).getVal()); if(pr.sizeOfIArray() > 0) ctFont.addNewI().setVal(pr.getIArray(0).getVal()); if(pr.sizeOfColorArray() > 0) { CTColor c1 = pr.getColorArray(0); if(pr.sizeOfSchemeArray() > 0) ctFont.addNewScheme().setVal(pr.getSchemeArray(0).getVal()); if(pr.sizeOfCharsetArray() > 0) ctFont.addNewCharset().setVal(pr.getCharsetArray(0).getVal()); if(pr.sizeOfCondenseArray() > 0) ctFont.addNewCondense().setVal(pr.getCondenseArray(0).getVal()); if(pr.sizeOfExtendArray() > 0) ctFont.addNewExtend().setVal(pr.getExtendArray(0).getVal()); if(pr.sizeOfVertAlignArray() > 0) ctFont.addNewVertAlign().setVal(pr.getVertAlignArray(0).getVal()); if(pr.sizeOfOutlineArray() > 0) ctFont.addNewOutline().setVal(pr.getOutlineArray(0).getVal()); if(pr.sizeOfShadowArray() > 0) ctFont.addNewShadow().setVal(pr.getShadowArray(0).getVal()); if(pr.sizeOfStrikeArray() > 0) ctFont.addNewStrike().setVal(pr.getStrikeArray(0).getVal());
/** * XMLBeans and the XSD make this look like it can have multiple values, but it is maxOccurrs=1. * Use get*Array(), it is much faster than get*List(). * * @see org.apache.poi.ss.usermodel.FontFormatting#isStruckout() */ @Override public boolean isStruckout() { for (CTBooleanProperty bProp : _font.getStrikeArray()) return bProp.getVal(); return false; }
/** * get whether the font weight is set to bold or not * * @return bold - whether the font is bold or not */ @Override public boolean isBold(){ return _font.sizeOfBArray() == 1 && _font.getBArray(0).getVal(); }
/** * get a boolean value for the boldness to use. * * @return boolean - bold */ public boolean getBold() { CTBooleanProperty bold = _ctFont.sizeOfBArray() == 0 ? null : _ctFont.getBArray(0); return (bold != null && bold.getVal()); }
/** * get a boolean value that specify whether to use a strikeout horizontal line through the text or not * * @return boolean - value for strikeout */ public boolean getStrikeout() { CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? null : _ctFont.getStrikeArray(0); return strike != null && strike.getVal(); }
/** * @return true if font style was set to <i>italic</i> */ @Override public boolean isItalic(){ return _font.sizeOfIArray() == 1 && _font.getIArray(0).getVal(); }
/** * get a boolean value that specify whether to use italics or not * * @return boolean - value for italic */ public boolean getItalic() { CTBooleanProperty italic = _ctFont.sizeOfIArray() == 0 ? null : _ctFont.getIArray(0); return italic != null && italic.getVal(); }
/** * get a boolean value that specify whether to use a strikeout horizontal line through the text or not * * @return boolean - value for strikeout */ public boolean getStrikeout() { CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? null : _ctFont.getStrikeArray(0); return strike != null && strike.getVal(); }
/** * get a boolean value that specify whether to use italics or not * * @return boolean - value for italic */ public boolean getItalic() { CTBooleanProperty italic = _ctFont.sizeOfIArray() == 0 ? null : _ctFont.getIArray(0); return italic != null && italic.getVal(); }
/** * get whether the font weight is set to bold or not * * @return bold - whether the font is bold or not */ public boolean isBold(){ return _font.sizeOfBArray() == 1 && _font.getBArray(0).getVal(); }
/** * @return true if font style was set to <i>italic</i> */ public boolean isItalic(){ return _font.sizeOfIArray() == 1 && _font.getIArray(0).getVal(); }
/** * get a boolean value for the boldness to use. * * @return boolean - bold */ public boolean getBold() { CTBooleanProperty bold = _ctFont.sizeOfBArray() == 0 ? null : _ctFont.getBArray(0); return (bold != null && bold.getVal()); }