X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FCommandInset.cpp;h=6b9466481cd44c8a948130ee409208c164ccb1fb;hb=02e82157ec583c3900e359de86be79fac6512387;hp=84894adf2f9a8c4e5b5046fd416845076b9eb647;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/mathed/CommandInset.cpp b/src/mathed/CommandInset.cpp index 84894adf2f..6b9466481c 100644 --- a/src/mathed/CommandInset.cpp +++ b/src/mathed/CommandInset.cpp @@ -14,7 +14,6 @@ #include "MathData.h" #include "MathStream.h" #include "DispatchResult.h" -#include "FuncRequest.h" #include @@ -23,8 +22,8 @@ using namespace std; namespace lyx { -CommandInset::CommandInset(docstring const & name, bool needs_math_mode) - : InsetMathNest(2), name_(name), needs_math_mode_(needs_math_mode), +CommandInset::CommandInset(Buffer * buf, docstring const & name, bool needs_math_mode) + : InsetMathNest(buf, 2), name_(name), needs_math_mode_(needs_math_mode), set_label_(false) { lock_ = true; @@ -59,15 +58,15 @@ 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(), asciiOnly()); MathEnsurer ensurer(os, needs_math_mode_); - os << '\\' << name_.c_str(); - if (cell(1).size()) + os << '\\' << name_; + if (!cell(1).empty()) os << '[' << cell(1) << ']'; os << '{' << cell(0) << '}'; }