use of org.apache.poi.hssf.record.cf.FontFormatting in project poi by apache.
the class CFRuleBase method readFormatOptions.
protected int readFormatOptions(RecordInputStream in) {
formatting_options = in.readInt();
formatting_not_used = in.readShort();
int len = 6;
if (containsFontFormattingBlock()) {
_fontFormatting = new FontFormatting(in);
len += _fontFormatting.getDataLength();
}
if (containsBorderFormattingBlock()) {
_borderFormatting = new BorderFormatting(in);
len += _borderFormatting.getDataLength();
}
if (containsPatternFormattingBlock()) {
_patternFormatting = new PatternFormatting(in);
len += _patternFormatting.getDataLength();
}
return len;
}
use of org.apache.poi.hssf.record.cf.FontFormatting in project poi by apache.
the class TestCFRuleRecord method testCFRuleBase.
private void testCFRuleBase(CFRuleBase record) {
FontFormatting fontFormatting = new FontFormatting();
testFontFormattingAccessors(fontFormatting);
assertFalse(record.containsFontFormattingBlock());
record.setFontFormatting(fontFormatting);
assertTrue(record.containsFontFormattingBlock());
BorderFormatting borderFormatting = new BorderFormatting();
testBorderFormattingAccessors(borderFormatting);
assertFalse(record.containsBorderFormattingBlock());
record.setBorderFormatting(borderFormatting);
assertTrue(record.containsBorderFormattingBlock());
PatternFormatting patternFormatting = new PatternFormatting();
testPatternFormattingAccessors(patternFormatting);
assertFalse(record.containsPatternFormattingBlock());
record.setPatternFormatting(patternFormatting);
assertTrue(record.containsPatternFormattingBlock());
}
use of org.apache.poi.hssf.record.cf.FontFormatting in project poi by apache.
the class HSSFConditionalFormattingRule method getFontFormatting.
private HSSFFontFormatting getFontFormatting(boolean create) {
FontFormatting fontFormatting = cfRuleRecord.getFontFormatting();
if (fontFormatting == null) {
if (!create)
return null;
fontFormatting = new FontFormatting();
cfRuleRecord.setFontFormatting(fontFormatting);
}
return new HSSFFontFormatting(cfRuleRecord, workbook);
}
Aggregations