5 #include "command_inset.h"
6 #include "math_mathmlstream.h"
7 #include "funcrequest.h"
10 CommandInset::CommandInset(string const & data)
14 string::size_type idx0 = data.find("|++|");
15 name_ = data.substr(0, idx0);
16 if (idx0 == string::npos)
19 string::size_type idx1 = data.find("|++|", idx0);
20 cell(0) = asArray(data.substr(idx0, idx1 - idx0));
21 if (idx1 == string::npos)
23 cell(1) = asArray(data.substr(idx1 + 4));
27 MathInset * CommandInset::clone() const
29 return new CommandInset(*this);
33 MathInset::result_type
34 CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
38 return ButtonInset::dispatch(cmd, idx, pos);
44 void CommandInset::write(WriteStream & os) const
46 os << '\\' << name_.c_str();
48 os << '[' << cell(1) << ']';
49 os << '{' << cell(0) << '}';
53 string CommandInset::screenLabel() const