]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiPainter.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiPainter.cpp
index ee0f65a3ce54f51350d9685a9b911de2099ff776..ca639668fb962b118de2e90b65fa43f812230975 100644 (file)
@@ -198,6 +198,7 @@ void GuiPainter::lines(int const * xp, int const * yp, int np,
                return;
 
        // double the size if needed
+       // FIXME THREAD
        static QVector<QPoint> points(32);
        if (np > points.size())
                points.resize(2 * np);
@@ -275,33 +276,6 @@ int GuiPainter::text(int x, int y, char_type c, FontInfo const & f)
 }
 
 
-int GuiPainter::smallCapsText(int x, int y,
-       QString const & s, FontInfo const & f)
-{
-       FontInfo smallfont(f);
-       smallfont.decSize().decSize().setShape(UP_SHAPE);
-
-       QFont const & qfont = getFont(f);
-       QFont const & qsmallfont = getFont(smallfont);
-
-       setQPainterPen(computeColor(f.realColor()));
-       int textwidth = 0;
-       size_t const ls = s.length();
-       for (unsigned int i = 0; i < ls; ++i) {
-               QChar const c = s[i].toUpper();
-               if (c != s.at(i)) {
-                       setFont(qsmallfont);
-               } else {
-                       setFont(qfont);
-               }
-               if (isDrawingEnabled())
-                       drawText(x + textwidth, y, c);
-               textwidth += fontMetrics().width(c);
-       }
-       return textwidth;
-}
-
-
 int GuiPainter::text(int x, int y, docstring const & s,
                FontInfo const & f)
 {
@@ -333,12 +307,6 @@ int GuiPainter::text(int x, int y, docstring const & s,
 
        int textwidth;
 
-       if (f.realShape() == SMALLCAPS_SHAPE) {
-               textwidth = smallCapsText(x, y, str, f);
-               textDecoration(f, x, y, textwidth);
-               return textwidth;
-       }
-
        // Here we use the font width cache instead of
        //   textwidth = fontMetrics().width(str);
        // because the above is awfully expensive on MacOSX
@@ -352,6 +320,12 @@ int GuiPainter::text(int x, int y, docstring const & s,
        // same as that of a soft-hyphen (0x00ad), unless it
        // occurs at a line-break. As a kludge, we force Qt to
        // render this glyph using a one-column line.
+       // This is needed for some math glyphs.
+       // FIXME In texted, this behaves differently depending
+       // on lyxrc.force_paint_single_char status.
+       // Should the soft hyphen char be displayed at all?
+       // I don't think so (i.e., Qt is correct as far as
+       // texted is concerned). /spitz
        if (s.size() == 1 && str[0].unicode() == 0x00ad) {
                setQPainterPen(computeColor(f.realColor()));
                QTextLayout adsymbol(str);