Add dataBar and colorScale write support
This commit is contained in:
@@ -19,6 +19,7 @@ public:
|
||||
private Q_SLOTS:
|
||||
void testHighlightRules();
|
||||
void testHighlightRules_data();
|
||||
void testDataBarRules();
|
||||
};
|
||||
|
||||
ConditionalFormattingTest::ConditionalFormattingTest()
|
||||
@@ -78,6 +79,25 @@ void ConditionalFormattingTest::testHighlightRules()
|
||||
QVERIFY(buffer.buffer().contains(result));
|
||||
}
|
||||
|
||||
void ConditionalFormattingTest::testDataBarRules()
|
||||
{
|
||||
ConditionalFormatting cf;
|
||||
cf.addDataBarRule(Qt::blue);
|
||||
cf.addRange("C3:C10");
|
||||
|
||||
QBuffer buffer;
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter writer(&buffer);
|
||||
cf.saveToXml(writer);
|
||||
qDebug()<<buffer.buffer();
|
||||
QByteArray res = "<cfRule type=\"dataBar\" priority=\"1\">"
|
||||
"<dataBar><cfvo type=\"min\" val=\"0\"/>"
|
||||
"<cfvo type=\"max\" val=\"0\"/>"
|
||||
"<color rgb=\"FF0000ff\"/></dataBar>"
|
||||
"</cfRule>";
|
||||
QVERIFY(buffer.buffer().contains(res));
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(ConditionalFormattingTest)
|
||||
|
||||
#include "tst_conditionalformattingtest.moc"
|
||||
|
||||
Reference in New Issue
Block a user