diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-05-02 16:32:26 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-04 12:45:52 +0200 |
commit | 575ede308e7a237980c3c1ba50a7e80941cd34c6 (patch) | |
tree | 8114a3f5c5719d81ecf800a5ccaca9335bac6b68 /tests/auto/gui/text | |
parent | 712ca9d95a92d62eda809c959998313413516aa9 (diff) |
Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtGui]
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.
Task-number: QTBUG-21872
Change-Id: I2850033159508ebb1ff7564e15b99a146dbee94c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/gui/text')
3 files changed, 18 insertions, 18 deletions
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index 213b388895..6fb3ab9cd5 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -279,23 +279,23 @@ void tst_QTextDocument::find_data() QTest::newRow("1") << "Hello World" << "World" << int(QTextDocument::FindCaseSensitively) << 0 << 6 << 11; - QTest::newRow("2") << QString::fromAscii("Hello") + QString(QChar::ParagraphSeparator) + QString::fromAscii("World") + QTest::newRow("2") << QString::fromLatin1("Hello") + QString(QChar::ParagraphSeparator) + QString::fromLatin1("World") << "World" << int(QTextDocument::FindCaseSensitively) << 1 << 6 << 11; - QTest::newRow("3") << QString::fromAscii("Hello") + QString(QChar::ParagraphSeparator) + QString::fromAscii("World") + QTest::newRow("3") << QString::fromLatin1("Hello") + QString(QChar::ParagraphSeparator) + QString::fromLatin1("World") << "Hello" << int(QTextDocument::FindCaseSensitively | QTextDocument::FindBackward) << 10 << 0 << 5; - QTest::newRow("4wholewords") << QString::fromAscii("Hello Blah World") + QTest::newRow("4wholewords") << QString::fromLatin1("Hello Blah World") << "Blah" << int(QTextDocument::FindWholeWords) << 0 << 6 << 10; - QTest::newRow("5wholewords") << QString::fromAscii("HelloBlahWorld") + QTest::newRow("5wholewords") << QString::fromLatin1("HelloBlahWorld") << "Blah" << int(QTextDocument::FindWholeWords) << 0 << -1 << -1; - QTest::newRow("6wholewords") << QString::fromAscii("HelloBlahWorld Blah Hah") + QTest::newRow("6wholewords") << QString::fromLatin1("HelloBlahWorld Blah Hah") << "Blah" << int(QTextDocument::FindWholeWords) << 0 << 15 << 19; - QTest::newRow("7wholewords") << QString::fromAscii("HelloBlahWorld Blah Hah") + QTest::newRow("7wholewords") << QString::fromLatin1("HelloBlahWorld Blah Hah") << "Blah" << int(QTextDocument::FindWholeWords | QTextDocument::FindBackward) << 23 << 15 << 19; - QTest::newRow("8wholewords") << QString::fromAscii("Hello: World\n") + QTest::newRow("8wholewords") << QString::fromLatin1("Hello: World\n") << "orld" << int(QTextDocument::FindWholeWords) << 0 << -1 << -1; - QTest::newRow("across-paragraphs") << QString::fromAscii("First Parag\nSecond Parag with a lot more text") + QTest::newRow("across-paragraphs") << QString::fromLatin1("First Parag\nSecond Parag with a lot more text") << "Parag" << int(QTextDocument::FindBackward) << 15 << 6 << 11; @@ -350,7 +350,7 @@ void tst_QTextDocument::findWithRegExp_data() // match ampersands but not & QTest::newRow("2") << "His & hers & theirs" << "&(?!amp;)"<< int(QTextDocument::FindCaseSensitively) << 0 << 15 << 16; //backward search - QTest::newRow("3") << QString::fromAscii("HelloBlahWorld Blah Hah") + QTest::newRow("3") << QString::fromLatin1("HelloBlahWorld Blah Hah") << "h" << int(QTextDocument::FindBackward) << 18 << 8 << 9; } diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index 7ca4fc981b..d9fc5da3a2 100644 --- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -884,7 +884,7 @@ void tst_QTextDocumentFragment::hrefAnchor() const char html[] = "<a href=\"test\">blah</a>"; setHtml(QString::fromLatin1(html)); QVERIFY(doc->begin().begin().fragment().charFormat().isAnchor()); - QCOMPARE(doc->begin().begin().fragment().charFormat().anchorHref(), QString::fromAscii("test")); + QCOMPARE(doc->begin().begin().fragment().charFormat().anchorHref(), QString::fromLatin1("test")); QVERIFY(doc->begin().begin().fragment().charFormat().fontUnderline() == true); } @@ -912,13 +912,13 @@ void tst_QTextDocumentFragment::namedAnchorFragments() // the 'a' QVERIFY(it.fragment().isValid()); - QCOMPARE(it.fragment().text(), QString::fromAscii("a")); + QCOMPARE(it.fragment().text(), QString::fromLatin1("a")); QVERIFY(it.fragment().charFormat().isAnchor() == false); // the 'b' of 'blah' as separate fragment with the anchor attribute ++it; QVERIFY(it.fragment().isValid()); - QCOMPARE(it.fragment().text(), QString::fromAscii("b")); + QCOMPARE(it.fragment().text(), QString::fromLatin1("b")); QVERIFY(it.fragment().charFormat().isAnchor()); // the 'lah' of 'blah' as remainder @@ -938,12 +938,12 @@ void tst_QTextDocumentFragment::namedAnchorFragments2() QTextBlock::Iterator it = doc->begin().begin(); QVERIFY(!it.atEnd()); - QCOMPARE(it.fragment().text(), QString::fromAscii("H")); + QCOMPARE(it.fragment().text(), QString::fromLatin1("H")); QVERIFY(it.fragment().charFormat().isAnchor()); ++it; - QCOMPARE(it.fragment().text(), QString::fromAscii("ello")); + QCOMPARE(it.fragment().text(), QString::fromLatin1("ello")); QVERIFY(!it.fragment().charFormat().isAnchor()); } @@ -956,7 +956,7 @@ void tst_QTextDocumentFragment::namedAnchorFragments3() QTextBlock::Iterator it = doc->begin().begin(); QVERIFY(!it.atEnd()); - QCOMPARE(it.fragment().text(), QString::fromAscii("T")); + QCOMPARE(it.fragment().text(), QString::fromLatin1("T")); QVERIFY(it.fragment().charFormat().isAnchor()); QCOMPARE(it.fragment().charFormat().anchorName(), QString("target")); QStringList targets; targets << "target" << "target2"; @@ -964,7 +964,7 @@ void tst_QTextDocumentFragment::namedAnchorFragments3() ++it; - QCOMPARE(it.fragment().text(), QString::fromAscii("ext")); + QCOMPARE(it.fragment().text(), QString::fromLatin1("ext")); QVERIFY(!it.fragment().charFormat().isAnchor()); } @@ -1068,7 +1068,7 @@ void tst_QTextDocumentFragment::mayNotHaveChildren() // make sure the Hey does not end up as tag text for the img tag const char html[] = "<img />Hey"; setHtml(QString::fromLatin1(html)); - QCOMPARE(doc->toPlainText().mid(1), QString::fromAscii("Hey")); + QCOMPARE(doc->toPlainText().mid(1), QString::fromLatin1("Hey")); } void tst_QTextDocumentFragment::inheritAlignment() diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index 8920e63957..d83f1e9a36 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -530,7 +530,7 @@ void tst_QTextLayout::defaultWordSeparators_data() QString separators(".,:;-<>[](){}=/+%&^*"); separators += QLatin1String("!?"); for (int i = 0; i < separators.count(); ++i) { - QTest::newRow(QString::number(i).toAscii().data()) + QTest::newRow(QString::number(i).toLatin1().data()) << QString::fromLatin1("abcd") + separators.at(i) + QString::fromLatin1("efgh") << 0 << 4; } |