https://issues.apache.org/bugzilla/show_bug.cgi?id=30311





--- Comment #17 from Dmitriy Kumshayev <[EMAIL PROTECTED]>  2008-04-11 22:52:58 
PST ---
Created an attachment (id=21818)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21818)
Fixes and API improvements

Improved logic working with CFRuleRecord option flags.
Now it is possible to create correct (so that they work in Excel ) 
Conditional Formatting rules not only for FontFormatting, 
but for the other two structures: PatternFormatting and BorderFormatting.

I do not include a test working with files yet.

Improved high level API. Now it is more convenient  and consistent.
Example :
Previous approach:
-----------------------------------------
// This  patternFtmt object is detached from the rule
// and consequently cannot notify the rule when it changes.
HSSFPatternFormatting patternFmt = new HSSFPatternFormatting();


HSSFConditionalFormattingRule rule =
sheet.createConditionalFormattingRule(formula, null, null, patternFmt);

// It is also possible to share this patternFmt between more than one rules
// which creates potential conflicts between the rules,
// since changes on one patternFmt will implicitly affect all related rules
HSSFConditionalFormattingRule rule2 =
sheet.createConditionalFormattingRule(formula2, null, null, patternFmt);


-----------------------------------------

New approach:
-----------------------------------------
HSSFConditionalFormattingRule rule =
sheet.createConditionalFormattingRule(formula);

// This patternFmt always exists in context of it's parent rule.
// No conflicts possible. 
// API does not allow to share the same instance of HSSFPatternFormatting 
// between many rules.
HSSFPatternFormatting patternFmt = rule.createPatternFormatting();

-----------------------------------------


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to