Expose another common property, strikeout.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782987 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Greg Woolsey 2017-02-14 16:45:47 +00:00
parent 653c627b1f
commit 05125678ab
2 changed files with 19 additions and 0 deletions

View File

@ -136,6 +136,12 @@ public interface FontFormatting {
*/ */
boolean isItalic(); boolean isItalic();
/**
* @return true if font strikeout is on
*/
boolean isStruckout();
/** /**
* set font style options. * set font style options.
* *

View File

@ -22,6 +22,7 @@ import org.apache.poi.ss.usermodel.*;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty;
@ -70,6 +71,18 @@ public class XSSFFontFormatting implements FontFormatting {
} }
} }
/**
* 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()) if (bProp.getVal()) return true;
return false;
}
/** /**
* @return font color index * @return font color index
*/ */