X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2Fqt_helpers.h;h=82a14383f396f51389a9b6e5a3da5272aaa548ee;hb=591d47a64b8ba894be5c793472397374d0496984;hp=29a3fbfaee527761b4f8190de6f8dbf993d69e8f;hpb=c56671cec7147f3f2fbee4a5a93188c717eb4fe8;p=lyx.git diff --git a/src/frontends/qt4/qt_helpers.h b/src/frontends/qt4/qt_helpers.h index 29a3fbfaee..82a14383f3 100644 --- a/src/frontends/qt4/qt_helpers.h +++ b/src/frontends/qt4/qt_helpers.h @@ -78,6 +78,11 @@ inline char_type const qchar_to_ucs4(QChar const & qchar) { } inline QChar const ucs4_to_qchar(char_type const ucs4) { + // FIXME: The following cast is not a real conversion but it work + // for the ucs2 subrange of unicode. Instead of an assertion we should + // return some special characters that indicates that its display is + // not supported. + BOOST_ASSERT(ucs4 < 65536); return QChar(static_cast(ucs4)); } @@ -87,8 +92,9 @@ void ucs4_to_qstring(docstring const & str, QString & s); inline void ucs4_to_qstring(char_type const * str, size_t ls, QString & s) { - s.resize(ls); - for (int i = ls; --i >= 0; ) + int i = static_cast(ls); + s.resize(i); + for (i ; --i >= 0; ) s[i] = ucs4_to_qchar(str[i]); }