]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiPainter.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiPainter.cpp
index 9b06147d2c9068df9acbad6fbd98d655f810ce71..275c8d3eeac774334b6a67f1008acd4ee595cff2 100644 (file)
 #include "GuiApplication.h"
 #include "GuiFontMetrics.h"
 #include "GuiImage.h"
-
-#include "GuiApplication.h"
 #include "qt_helpers.h"
 
-#include "support/debug.h"
 #include "Language.h"
 #include "LyXRC.h"
 
+#include "support/debug.h"
+
 #include <QPixmapCache>
 #include <QTextLayout>
 
@@ -365,8 +364,6 @@ int GuiPainter::text(int x, int y, docstring const & s,
                        setFont(fi.font);
                // We need to draw the text as LTR as we use our own bidi code.
                setLayoutDirection(Qt::LeftToRight);
-               // We need to draw the text as LTR as we use our own bidi code.
-               setLayoutDirection(Qt::LeftToRight);
                drawText(x, y, str);
                //LYXERR(Debug::PAINTING, "draw " << string(str.toUtf8())
                //      << " at " << x << "," << y);
@@ -433,7 +430,6 @@ void GuiPainter::buttonFrame(int x, int y, int w, int h)
        line(x, y + h - 1, x - 1 + w, y + h - 1, Color_buttonframe);
 }
 
-static int const d = Inset::TEXT_TO_INSET_OFFSET / 2;
 
 void GuiPainter::rectText(int x, int y, docstring const & str,
        FontInfo const & font, ColorCode back, ColorCode frame)
@@ -466,6 +462,8 @@ void GuiPainter::buttonText(int x, int y, docstring const & str,
        FontMetrics const & fm = theFontMetrics(font);
        fm.buttonText(str, width, ascent, descent);
 
+       static int const d = Inset::TEXT_TO_INSET_OFFSET / 2;
+
        button(x + d, y - ascent, width - d, descent + ascent, mouseHover);
        text(x + Inset::TEXT_TO_INSET_OFFSET, y, str, font);
 }