]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/CommandInset.cpp
Account for old versions of Pygments
[lyx.git] / src / mathed / CommandInset.cpp
index c5448a21fc688ab89ad915a30385f5521a1d938e..344c570323a32aef7156509539c2574617d242b0 100644 (file)
@@ -14,7 +14,6 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "DispatchResult.h"
-#include "FuncRequest.h"
 
 #include <sstream>
 
@@ -41,11 +40,9 @@ void CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        if (!set_label_) {
                set_label_ = true;
-               button_.update(screenLabel(), true);
+               button_.update(screenLabel(), true, false);
        }
        button_.metrics(mi, dim);
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
 }
 
 
@@ -59,21 +56,17 @@ Inset * CommandInset::editXY(Cursor & cur, int /*x*/, int /*y*/)
 void CommandInset::draw(PainterInfo & pi, int x, int y) const
 {
        button_.draw(pi, x, y);
-       setPosCache(pi, x, y);
 }
 
 
 void CommandInset::write(WriteStream & os) const
 {
-       ModeSpecifier specifier(os, currentMode(), lockedMode());
+       ModeSpecifier specifier(os, currentMode(), lockedMode(), asciiOnly());
        MathEnsurer ensurer(os, needs_math_mode_);
-       bool const ascii = os.asciiOnly();
-       os.asciiOnly(asciiOnly());
        os << '\\' << name_;
-       if (cell(1).size())
+       if (!cell(1).empty())
                os << '[' << cell(1) << ']';
        os << '{' << cell(0) << '}';
-       os.asciiOnly(ascii);
 }