2 #include "command_inset.h"
3 #include "math_mathmlstream.h"
4 #include "funcrequest.h"
7 CommandInset::CommandInset(string const & data)
11 string::size_type idx0 = data.find("|++|");
12 name_ = data.substr(0, idx0);
13 if (idx0 == string::npos)
16 string::size_type idx1 = data.find("|++|", idx0);
17 cell(0) = asArray(data.substr(idx0, idx1 - idx0));
18 if (idx1 == string::npos)
20 cell(1) = asArray(data.substr(idx1 + 4));
24 MathInset * CommandInset::clone() const
26 return new CommandInset(*this);
31 CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
35 return ButtonInset::dispatch(cmd, idx, pos);
41 void CommandInset::write(WriteStream & os) const
43 os << '\\' << name_.c_str();
45 os << '[' << cell(1) << ']';
46 os << '{' << cell(0) << '}';
50 string CommandInset::screenLabel() const