Search in sources :

Example 1 with FontFormatting

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;
}
Also used : PatternFormatting(org.apache.poi.hssf.record.cf.PatternFormatting) BorderFormatting(org.apache.poi.hssf.record.cf.BorderFormatting) FontFormatting(org.apache.poi.hssf.record.cf.FontFormatting)

Example 2 with FontFormatting

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());
}
Also used : PatternFormatting(org.apache.poi.hssf.record.cf.PatternFormatting) BorderFormatting(org.apache.poi.hssf.record.cf.BorderFormatting) FontFormatting(org.apache.poi.hssf.record.cf.FontFormatting)

Example 3 with FontFormatting

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);
}
Also used : FontFormatting(org.apache.poi.hssf.record.cf.FontFormatting)

Aggregations

FontFormatting (org.apache.poi.hssf.record.cf.FontFormatting)3 BorderFormatting (org.apache.poi.hssf.record.cf.BorderFormatting)2 PatternFormatting (org.apache.poi.hssf.record.cf.PatternFormatting)2