]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/qt_helpers.h
* qt_helpers.h:
[lyx.git] / src / frontends / qt4 / qt_helpers.h
index 57c68f285a6e56878098849602afd226c523aba4..82a14383f396f51389a9b6e5a3da5272aaa548ee 100644 (file)
@@ -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<unsigned short>(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<int>(ls);
+       s.resize(i);
+       for (i ; --i >= 0; )
                s[i] = ucs4_to_qchar(str[i]);
 }
 
@@ -104,7 +110,7 @@ void qstring_to_ucs4(QString const & qstr, std::vector<char_type> & ucs4);
  *
  * Use this in qt4/ instead of qt_()
  */
-QString const qt_(char const * str);
+QString const qt_(char const * str, const char * comment);
 
 
 /**