Fix Issue 7: Cell string misplacement when rich text exist
A private class RichString has been added. More work is needed
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
QT += testlib xlsx xlsx-private
|
||||
CONFIG += testcase
|
||||
DEFINES += XLSX_TEST
|
||||
|
||||
TARGET = tst_richstringtest
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
SOURCES += tst_richstringtest.cpp
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
@@ -0,0 +1,41 @@
|
||||
#include "private/xlsxrichstring_p.h"
|
||||
#include <QtTest>
|
||||
#include <QDebug>
|
||||
|
||||
class RichstringTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RichstringTest();
|
||||
|
||||
private Q_SLOTS:
|
||||
void testEqual();
|
||||
};
|
||||
|
||||
RichstringTest::RichstringTest()
|
||||
{
|
||||
}
|
||||
|
||||
void RichstringTest::testEqual()
|
||||
{
|
||||
QXlsx::RichString rs;
|
||||
rs.addFragment("Hello", 0);
|
||||
rs.addFragment(" RichText", 0);
|
||||
|
||||
QXlsx::RichString rs2;
|
||||
rs2.addFragment("Hello", 0);
|
||||
rs2.addFragment(" Qt!", 0);
|
||||
|
||||
QXlsx::RichString rs3;
|
||||
rs3.addFragment("Hello", 0);
|
||||
rs3.addFragment(" Qt!", 0);
|
||||
|
||||
QVERIFY2(rs2 != rs, "Failure");
|
||||
QVERIFY2(rs2 == rs3, "Failure");
|
||||
QVERIFY2(rs2 != QStringLiteral("Hello Qt!"), "Failure");
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(RichstringTest)
|
||||
|
||||
#include "tst_richstringtest.moc"
|
||||
Reference in New Issue
Block a user