@@ -132,17 +132,17 @@ public XSSFConditionalFormattingRule createConditionalFormattingRule(String form
132132 */
133133 public XSSFConditionalFormattingRule createConditionalFormattingRule (XSSFColor color ) {
134134 XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule (_sheet );
135-
135+
136136 // Have it setup, with suitable defaults
137137 rule .createDataBarFormatting (color );
138-
138+
139139 // All done!
140140 return rule ;
141141 }
142142 public XSSFConditionalFormattingRule createConditionalFormattingRule (ExtendedColor color ) {
143143 return createConditionalFormattingRule ((XSSFColor )color );
144144 }
145-
145+
146146 /**
147147 * A factory method allowing the creation of conditional formatting
148148 * rules using an Icon Set / Multi-State formatting.
@@ -154,10 +154,10 @@ public XSSFConditionalFormattingRule createConditionalFormattingRule(ExtendedCol
154154 */
155155 public XSSFConditionalFormattingRule createConditionalFormattingRule (IconSet iconSet ) {
156156 XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule (_sheet );
157-
157+
158158 // Have it setup, with suitable defaults
159159 rule .createMultiStateFormatting (iconSet );
160-
160+
161161 // All done!
162162 return rule ;
163163 }
@@ -174,14 +174,14 @@ public XSSFConditionalFormattingRule createConditionalFormattingRule(IconSet ico
174174 */
175175 public XSSFConditionalFormattingRule createConditionalFormattingColorScaleRule () {
176176 XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule (_sheet );
177-
177+
178178 // Have it setup, with suitable defaults
179179 rule .createColorScaleFormatting ();
180-
180+
181181 // All done!
182182 return rule ;
183183 }
184-
184+
185185 public int addConditionalFormatting (CellRangeAddress [] regions , ConditionalFormattingRule [] cfRules ) {
186186 if (regions == null ) {
187187 throw new IllegalArgumentException ("regions must not be null" );
@@ -194,9 +194,6 @@ public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalForma
194194 if (cfRules .length == 0 ) {
195195 throw new IllegalArgumentException ("cfRules must not be empty" );
196196 }
197- if (cfRules .length > 3 ) {
198- throw new IllegalArgumentException ("Number of rules must not exceed 3" );
199- }
200197
201198 CellRangeAddress [] mergeCellRanges = CellRangeUtil .mergeCellRanges (regions );
202199 CTConditionalFormatting cf = _sheet .getCTWorksheet ().addNewConditionalFormatting ();
@@ -218,22 +215,22 @@ public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalForma
218215 }
219216
220217 public int addConditionalFormatting (CellRangeAddress [] regions ,
221- ConditionalFormattingRule rule1 )
218+ ConditionalFormattingRule rule1 )
222219 {
223220 return addConditionalFormatting (regions ,
224221 rule1 == null ? null : new XSSFConditionalFormattingRule [] {
225- (XSSFConditionalFormattingRule )rule1
226- });
222+ (XSSFConditionalFormattingRule )rule1
223+ });
227224 }
228225
229226 public int addConditionalFormatting (CellRangeAddress [] regions ,
230- ConditionalFormattingRule rule1 , ConditionalFormattingRule rule2 )
227+ ConditionalFormattingRule rule1 , ConditionalFormattingRule rule2 )
231228 {
232229 return addConditionalFormatting (regions ,
233230 rule1 == null ? null : new XSSFConditionalFormattingRule [] {
234- (XSSFConditionalFormattingRule )rule1 ,
235- (XSSFConditionalFormattingRule )rule2
236- });
231+ (XSSFConditionalFormattingRule )rule1 ,
232+ (XSSFConditionalFormattingRule )rule2
233+ });
237234 }
238235
239236 /**
@@ -256,29 +253,29 @@ public int addConditionalFormatting( ConditionalFormatting cf ) {
256253 }
257254
258255 /**
259- * gets Conditional Formatting object at a particular index
260- *
261- * @param index
262- * of the Conditional Formatting object to fetch
263- * @return Conditional Formatting object
264- */
256+ * gets Conditional Formatting object at a particular index
257+ *
258+ * @param index
259+ * of the Conditional Formatting object to fetch
260+ * @return Conditional Formatting object
261+ */
265262 public XSSFConditionalFormatting getConditionalFormattingAt (int index ) {
266263 checkIndex (index );
267264 CTConditionalFormatting cf = _sheet .getCTWorksheet ().getConditionalFormattingArray (index );
268265 return new XSSFConditionalFormatting (_sheet , cf );
269266 }
270267
271268 /**
272- * @return number of Conditional Formatting objects of the sheet
273- */
269+ * @return number of Conditional Formatting objects of the sheet
270+ */
274271 public int getNumConditionalFormattings () {
275272 return _sheet .getCTWorksheet ().sizeOfConditionalFormattingArray ();
276273 }
277274
278275 /**
279- * removes a Conditional Formatting object by index
280- * @param index of a Conditional Formatting object to remove
281- */
276+ * removes a Conditional Formatting object by index
277+ * @param index of a Conditional Formatting object to remove
278+ */
282279 public void removeConditionalFormatting (int index ) {
283280 checkIndex (index );
284281 _sheet .getCTWorksheet ().removeConditionalFormatting (index );
@@ -292,4 +289,4 @@ private void checkIndex(int index) {
292289 }
293290 }
294291
295- }
292+ }
0 commit comments