summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qgb18030codec.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-06-24 23:45:22 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-25 02:23:18 +0200
commitd75a97793a803064bbacf97dca5beb670ad3e0b6 (patch)
tree60916a8376c0fc1079c54ff5a03e2d7797a8dfe8 /src/corelib/codecs/qgb18030codec.cpp
parent587b80f67dee42bd6231a2cd836dded05e5dfd13 (diff)
Remove the font codecs
These codecs have only been used for XLFD based fonts. These are not supported anymore by Qt 5. Change-Id: I7dc083f2efcd42363b144b24bd62c169d83390cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/codecs/qgb18030codec.cpp')
-rw-r--r--src/corelib/codecs/qgb18030codec.cpp146
1 files changed, 0 insertions, 146 deletions
diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp
index badba7d09b..030b353090 100644
--- a/src/corelib/codecs/qgb18030codec.cpp
+++ b/src/corelib/codecs/qgb18030codec.cpp
@@ -580,152 +580,6 @@ QByteArray QGb2312Codec::convertFromUnicode(const QChar *uc, int len, ConverterS
}
-#ifdef Q_OS_UNIX
-
-QFontGb2312Codec::QFontGb2312Codec()
-{
-}
-
-
-QByteArray QFontGb2312Codec::_name()
-{
- return "gb2312.1980-0";
-}
-
-
-int QFontGb2312Codec::_mibEnum()
-{
- return 57;
-}
-
-
-QString QFontGb2312Codec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
-{
- return QString();
-}
-
-QByteArray QFontGb2312Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
-{
- QByteArray result;
- result.resize(len * 2);
- uchar *rdata = (uchar *) result.data();
- const QChar *ucp = uc;
-
- //qDebug("QFontGb2312Codec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
- uchar buf[8];
- for (int i = 0; i < len; i++) {
- QChar ch(*ucp++);
-
- int len = qt_UnicodeToGbk(ch.unicode(), buf);
-
- if (len == 2 && buf[0] > 0xa0 && buf[1] > 0xa0) {
- *rdata++ = buf[0] & 0x7f;
- *rdata++ = buf[1] & 0x7f;
- } else {
- *rdata++ = 0;
- *rdata++ = 0;
- }
- }
- return result;
-}
-
-
-QFontGbkCodec::QFontGbkCodec()
-{
-}
-
-
-QByteArray QFontGbkCodec::_name()
-{
- return "gbk-0";
-}
-
-
-int QFontGbkCodec::_mibEnum()
-{
- return -113;
-}
-
-
-QString QFontGbkCodec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
-{
- return QString();
-}
-
-QByteArray QFontGbkCodec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
-{
- QByteArray result;
- result.resize(len * 2);
- uchar *rdata = (uchar *) result.data();
- const QChar *ucp = uc;
-
- //qDebug("QFontGbkCodec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
- for (int i = 0; i < len; i++) {
- QChar ch(*ucp++);
- uchar buf[8];
-
- int len = qt_UnicodeToGbk(ch.unicode(), buf);
-
- if (len == 2) {
- *rdata++ = buf[0];
- *rdata++ = buf[1];
- } else {
- *rdata++ = 0;
- *rdata++ = 0;
- }
- }
- return result;
-}
-
-
-QFontGb18030_0Codec::QFontGb18030_0Codec()
-{
- //qDebug("QFontGb18030_0Codec::QFontGb18030_0Codec()");
-}
-
-
-QByteArray QFontGb18030_0Codec::_name()
-{
- //qDebug("QFontGb18030_0Codec::name() = \"gb18030-0\"");
- return "gb18030-0";
-}
-
-
-int QFontGb18030_0Codec::_mibEnum()
-{
- //qDebug("QFontGb18030_0Codec::mibEnum() = -114");
- return -114;
-}
-
-
-QString QFontGb18030_0Codec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
-{
- return QString();
-}
-
-QByteArray QFontGb18030_0Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
-{
- QByteArray result;
- result.resize(len * 2);
- uchar *rdata = (uchar *) result.data();
- const QChar *ucp = uc;
-
- //qDebug("QFontGb18030_0Codec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
- for (int i = 0; i < len; i++) {
- QChar ch(*ucp++);
- if (ch.row () > 0 && !(ch.row () >= 0xd8 && ch.row () < 0xe0)) {
- *rdata++ = ch.row();
- *rdata++ = ch.cell();
- } else {
- *rdata++ = 0x0;
- *rdata++ = 0x0;
- }
- }
- return result;
-}
-
-#endif // Q_OS_UNIX
-
static const indexTbl_t gb18030_to_ucs_index[154] = {
/* U+00__ */ {0x00, 0xFF, 0x0000, 0x0000}, {0x00, 0xFF, 0x0000, 0x0000},