! * Add one ConditionalFormatting \a cf to the sheet. * Returns true on success. */
| 1064 | * Returns true on success. |
| 1065 | */ |
| 1066 | bool Worksheet::addConditionalFormatting(const ConditionalFormatting &cf) |
| 1067 | { |
| 1068 | Q_D(Worksheet); |
| 1069 | if (cf.ranges().isEmpty()) |
| 1070 | return false; |
| 1071 | |
| 1072 | for (int i=0; i<cf.d->cfRules.size(); ++i) { |
| 1073 | const std::shared_ptr<XlsxCfRuleData> &rule = cf.d->cfRules[i]; |
| 1074 | if (!rule->dxfFormat.isEmpty()) |
| 1075 | d->workbook->styles()->addDxfFormat(rule->dxfFormat); |
| 1076 | rule->priority = 1; |
| 1077 | } |
| 1078 | d->conditionalFormattingList.append(cf); |
| 1079 | return true; |
| 1080 | } |
| 1081 | |
| 1082 | /*! |
| 1083 | * Insert an \a image at the position \a row, \a column |