]> git.lyx.org Git - features.git/commitdiff
Compilation fix for QT2
authorDekel Tsur <dekelts@tau.ac.il>
Tue, 15 Oct 2002 16:48:53 +0000 (16:48 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Tue, 15 Oct 2002 16:48:53 +0000 (16:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5417 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/QLPainter.C
src/frontends/qt2/qfont_metrics.C

index 471e00ed3c381f448d325b48b6960328d7a1d25e..197f39f3159a2349473ba2e255c98de2c0267751 100644 (file)
@@ -257,14 +257,16 @@ Painter & QLPainter::text(int x, int y,
                encoding = encodings.symbol_encoding();
 
        QString str;
+#if QT_VERSION >= 0x030000
        str.setLength(ls);
        for (size_t i = 0; i < ls; ++i)
                str[i] = QChar(encoding->ucs(s[i]));
-
-#if QT_VERSION >= 0x030000
        // HACK: QT3 refuses to show single compose characters
        if (ls = 1 && str[0].unicode() >= 0x05b0 && str[0].unicode() <= 0x05c2)
                str = ' '+str;
+#else
+       for (size_t i = 0; i < ls; ++i)
+               str += QChar(encoding->ucs(s[i]));
 #endif
 
        if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
index 57b65a2eb13a8bc202bfaa922ccd7f5d52bef9f3..44992d504917449832e9ed44d864de320272ebd9 100644 (file)
@@ -85,9 +85,14 @@ int width(char const * s, size_t ls, LyXFont const & f)
                encoding = encodings.symbol_encoding();
 
        QString str;
+#if QT_VERSION >= 0x030000
        str.setLength(ls);
        for (size_t i = 0; i < ls; ++i)
                str[i] = QChar(encoding->ucs(s[i]));
+#else
+       for (size_t i = 0; i < ls; ++i)
+               str += QChar(encoding->ucs(s[i]));
+#endif
 
        if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
                return metrics(f).width(str);