X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FCommandInset.cpp;h=0cf041c23ea7e59b2ec9fc62cf30690fca02cda5;hb=c9d9309c1ecffa218dee04ce4f7991ed4fc0c9bb;hp=3ad90d1eb88f49109ce00674f53eb24d82c7a023;hpb=31713932b247802b5b59482f5157c8a4f7206825;p=lyx.git diff --git a/src/mathed/CommandInset.cpp b/src/mathed/CommandInset.cpp index 3ad90d1eb8..0cf041c23e 100644 --- a/src/mathed/CommandInset.cpp +++ b/src/mathed/CommandInset.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ @@ -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; @@ -65,12 +64,12 @@ void CommandInset::draw(PainterInfo & pi, int x, int y) const void CommandInset::write(WriteStream & os) const { - bool brace = ensureMath(os, needs_math_mode_); - os << '\\' << name_.c_str(); - if (cell(1).size()) + ModeSpecifier specifier(os, currentMode(), lockedMode(), asciiOnly()); + MathEnsurer ensurer(os, needs_math_mode_); + os << '\\' << name_; + if (!cell(1).empty()) os << '[' << cell(1) << ']'; os << '{' << cell(0) << '}'; - os.pendingBrace(brace); }