summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlocale
diff options
context:
space:
mode:
authorminiak <milan.burda@gmail.com>2009-07-01 09:50:29 (GMT)
committerMarius Storm-Olsen <marius@trolltech.com>2009-07-01 09:51:25 (GMT)
commitd2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db (patch)
tree946e359589d671f050c6a6a2f7f00b01e0ca6416 /tests/auto/qlocale
parentc447ce31632e25fdd40404cc96b6980aa0adcef8 (diff)
downloadQt-d2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db.zip
Qt-d2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db.tar.gz
Qt-d2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db.tar.bz2
tests: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT support
Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'tests/auto/qlocale')
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp31
1 files changed, 4 insertions, 27 deletions
diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp
index 8ac6ef0..9ef7f1d 100644
--- a/tests/auto/qlocale/tst_qlocale.cpp
+++ b/tests/auto/qlocale/tst_qlocale.cpp
@@ -1093,12 +1093,7 @@ void tst_QLocale::macDefaultLocale()
static QString getWinLocaleInfo(LCTYPE type)
{
LCID id = GetThreadLocale();
- int cnt = 0;
- QT_WA({
- cnt = GetLocaleInfoW(id, type, 0, 0)*2;
- } , {
- cnt = GetLocaleInfoA(id, type, 0, 0);
- });
+ int cnt = GetLocaleInfo(id, type, 0, 0) * 2;
if (cnt == 0) {
qWarning("QLocale: empty windows locale info (%d)", type);
@@ -1107,38 +1102,20 @@ static QString getWinLocaleInfo(LCTYPE type)
QByteArray buff(cnt, 0);
- QT_WA({
- cnt = GetLocaleInfoW(id, type,
- reinterpret_cast<wchar_t*>(buff.data()),
- buff.size()/2);
- } , {
- cnt = GetLocaleInfoA(id, type,
- buff.data(), buff.size());
- });
+ cnt = GetLocaleInfo(id, type, reinterpret_cast<wchar_t*>(buff.data()), buff.size() / 2);
if (cnt == 0) {
qWarning("QLocale: empty windows locale info (%d)", type);
return QString();
}
- QString result;
- QT_WA({
- result = QString::fromUtf16(reinterpret_cast<ushort*>(buff.data()));
- } , {
- result = QString::fromLocal8Bit(buff.data());
- });
- return result;
+ return QString::fromWCharArray(reinterpret_cast<wchar_t*>(buff.data()));
}
static void setWinLocaleInfo(LCTYPE type, const QString &value)
{
LCID id = GetThreadLocale();
-
- QT_WA({
- SetLocaleInfoW(id, type, reinterpret_cast<const wchar_t*>(value.utf16()));
- } , {
- SetLocaleInfoA(id, type, value.toLocal8Bit());
- });
+ SetLocaleInfo(id, type, reinterpret_cast<const wchar_t*>(value.utf16()));
}
class RestoreLocaleHelper {