]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QLPainter.C
* qt_helpers.[Ch]: new conversion from/to ucs4 strings and chars to/from QChar and...
[lyx.git] / src / frontends / qt4 / QLPainter.C
index 8b8bebac72e3192218c204fc57abb9e094d4e4ab..4fdbd7f28bea087c1f8ec55f858c4987841c354f 100644 (file)
@@ -19,6 +19,7 @@
 #include "FontLoader.h"
 
 #include "Application.h"
+#include "qt_helpers.h"
 
 #include "debug.h"
 #include "language.h"
@@ -210,7 +211,7 @@ void QLPainter::smallCapsText(int x, int y,
        int tmpx = x;
        size_t ls = s.length();
        for (unsigned int i = 0; i < ls; ++i) {
-               QChar const c = s[i].upper();
+               QChar const c = s[i].toUpper();
                if (c != s.at(i)) {
                        qp_->setFont(qsmallfont);
                        qp_->drawText(tmpx, y, c);
@@ -239,11 +240,7 @@ void QLPainter::text(int x, int y, char_type const * s, size_t ls,
        for (unsigned int i = 0; i < ls; ++i)
                str[i] = QChar(encoding->ucs(s[i]));
 #else
-       //std::vector<boost::uint32_t> in(s, s + ls);
-       //std::vector<unsigned short> ucs2 = ucs4_to_ucs2(in);
-       std::vector<unsigned short> ucs2 = ucs4_to_ucs2(s, ls);
-       ucs2.push_back(0);
-       QString str = QString::fromUcs2(&ucs2[0]);
+       QString str = ucs4_to_qstring(s, ls);
 #endif
 
 #if 0