]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbutton.C
Don't remove cell selections after fontchange.
[lyx.git] / src / insets / insetbutton.C
index c3b8907f6ea462826753dcbd49ef53606655a678..b171dc91012285ed9dea6f930bd58abfe237ddad 100644 (file)
@@ -38,22 +38,12 @@ int InsetButton::ascent(BufferView * bv, LyXFont const &) const
        int descent;
         string const s = getScreenLabel(bv->buffer());
 
-#if 0
-        if (editable()) {
-               bv->painter().buttonText(0, 0, s, font,
-                                        false, width, ascent, descent);
-       } else {
-               bv->painter().rectText(0, 0, s, font,
-                                      LColor::commandbg, LColor::commandframe,
-                                      false, width, ascent, descent);
-       }
-#else
         if (editable()) {
                lyxfont::buttonText(s, font, width, ascent, descent);
        } else {
                lyxfont::rectText(s, font, width, ascent, descent);
        }
-#endif
+
        return ascent;
 }
 
@@ -70,22 +60,12 @@ int InsetButton::descent(BufferView * bv, LyXFont const &) const
        int descent;
         string const s = getScreenLabel(bv->buffer());
 
-#if 0
-        if (editable()) {
-               bv->painter().buttonText(0, 0, s, font,
-                                        false, width, ascent, descent);
-       } else {
-               bv->painter().rectText(0, 0, s, font,
-                                  LColor::commandbg, LColor::commandframe,
-                                  false, width, ascent, descent);
-       }
-#else
         if (editable()) {
                lyxfont::buttonText(s, font, width, ascent, descent);
        } else {
                lyxfont::rectText(s, font, width, ascent, descent);
        }
-#endif
+
        return descent;
 }
 
@@ -102,22 +82,12 @@ int InsetButton::width(BufferView * bv, LyXFont const &) const
        int descent;
         string const s = getScreenLabel(bv->buffer());
 
-#if 0
-        if (editable()) {
-               bv->painter().buttonText(0, 0, s, font,
-                                        false, width, ascent, descent);
-       } else {
-               bv->painter().rectText(0, 0, s, font,
-                                      LColor::commandbg, LColor::commandframe,
-                                      false, width, ascent, descent);
-       }
-#else
         if (editable()) {
                lyxfont::buttonText(s, font, width, ascent, descent);
        } else {
                lyxfont::rectText(s, font, width, ascent, descent);
        }
-#endif
+
        return width + 4;
 }
 
@@ -134,27 +104,12 @@ void InsetButton::draw(BufferView * bv, LyXFont const &,
 
        string const s = getScreenLabel(bv->buffer());
 
-#if 0
-       int width;
-       if (editable()) {
-               pain.buttonText(int(x) + 2, baseline, s, font, true, width);
-       } else {
-               pain.rectText(int(x) + 2, baseline, s, font,
-                             LColor::commandbg, LColor::commandframe,
-                             true, width);
-       }
-#else
        if (editable()) {
                pain.buttonText(int(x) + 2, baseline, s, font);
        } else {
                pain.rectText(int(x) + 2, baseline, s, font,
                              LColor::commandbg, LColor::commandframe);
        }
-#endif
 
-#if 0
-       x += width + 4;
-#else
        x += width(bv, font);
-#endif
 }