MCPcopy Create free account
hub / github.com/KDE/labplot / readCfColorScale

Method readCfColorScale

src/3rdparty/QXlsx/source/xlsxconditionalformatting.cpp:539–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537}
538
539bool ConditionalFormattingPrivate::readCfColorScale(QXmlStreamReader &reader, XlsxCfRuleData *rule)
540{
541 Q_ASSERT(reader.name() == QLatin1String("colorScale"));
542
543 while (!reader.atEnd()) {
544 reader.readNextStartElement();
545 if (reader.tokenType() == QXmlStreamReader::StartElement) {
546 if (reader.name() == QLatin1String("cfvo")) {
547 XlsxCfVoData data;
548 readCfVo(reader, data);
549 if (!rule->attrs.contains(XlsxCfRuleData::A_cfvo1))
550 rule->attrs[XlsxCfRuleData::A_cfvo1] = QVariant::fromValue(data);
551 else if (!rule->attrs.contains(XlsxCfRuleData::A_cfvo2))
552 rule->attrs[XlsxCfRuleData::A_cfvo2] = QVariant::fromValue(data);
553 else
554 rule->attrs[XlsxCfRuleData::A_cfvo3] = QVariant::fromValue(data);
555 } else if (reader.name() == QLatin1String("color")) {
556 XlsxColor color;
557 color.loadFromXml(reader);
558 if (!rule->attrs.contains(XlsxCfRuleData::A_color1))
559 rule->attrs[XlsxCfRuleData::A_color1] = color;
560 else if (!rule->attrs.contains(XlsxCfRuleData::A_color2))
561 rule->attrs[XlsxCfRuleData::A_color2] = color;
562 else
563 rule->attrs[XlsxCfRuleData::A_color3] = color;
564 }
565 }
566 if (reader.tokenType() == QXmlStreamReader::EndElement
567 && reader.name() == QStringLiteral("colorScale")) {
568 break;
569 }
570 }
571
572 return true;
573}
574
575bool ConditionalFormattingPrivate::readCfVo(QXmlStreamReader &reader, XlsxCfVoData &cfvo)
576{

Callers

nothing calls this directly

Calls 4

atEndMethod · 0.80
nameMethod · 0.45
containsMethod · 0.45
loadFromXmlMethod · 0.45

Tested by

no test coverage detected