diff options
author | axis <qt-info@nokia.com> | 2009-11-09 08:28:40 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-11-09 08:28:40 (GMT) |
commit | 7fdfa58b958b658feb7b20dd7a7322d235fe4bea (patch) | |
tree | 6c38ed48f7c234ad480aa8ce178b9a00b14d2440 /src/corelib/tools/qstringbuilder.cpp | |
parent | 7ea04bf5c065a037b2db667572e1947f1a1b8b2e (diff) | |
parent | 68409c24211b4639832ce86113c33a247bb68950 (diff) | |
download | Qt-7fdfa58b958b658feb7b20dd7a7322d235fe4bea.zip Qt-7fdfa58b958b658feb7b20dd7a7322d235fe4bea.tar.gz Qt-7fdfa58b958b658feb7b20dd7a7322d235fe4bea.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-s60
Conflicts:
src/gui/painting/qblendfunctions.cpp
Diffstat (limited to 'src/corelib/tools/qstringbuilder.cpp')
-rw-r--r-- | src/corelib/tools/qstringbuilder.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp index 0a13218..4a16488 100644 --- a/src/corelib/tools/qstringbuilder.cpp +++ b/src/corelib/tools/qstringbuilder.cpp @@ -41,6 +41,8 @@ #include "qstringbuilder.h" +QT_BEGIN_NAMESPACE + /*! \class QLatin1Literal \internal @@ -143,3 +145,25 @@ Converts the \c QLatin1Literal into a \c QString object. */ + +/*! \internal */ +void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) +{ +#ifndef QT_NO_TEXTCODEC + if (QString::codecForCStrings) { + QString tmp = QString::fromAscii(a); + memcpy(out, reinterpret_cast<const char *>(tmp.constData()), sizeof(QChar) * tmp.size()); + out += tmp.length(); + return; + } +#endif + if (len == -1) { + while (*a) + *out++ = QLatin1Char(*a++); + } else { + for (int i = 0; i < len - 1; ++i) + *out++ = QLatin1Char(a[i]); + } +} + +QT_END_NAMESPACE |