#include "InsetMathDelim.h"
#include "MathData.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
#include "MathStream.h"
#include "MathSupport.h"
+namespace lyx {
+
+
using std::string;
using std::max;
using std::auto_ptr;
-namespace {
-string convertDelimToLatexName(string const & name)
+static docstring convertDelimToLatexName(docstring const & name)
{
- if (name == "<")
- return name;
- if (name == "(")
- return name;
- if (name == "[")
- return name;
- if (name == ".")
- return name;
- if (name == ">")
- return name;
- if (name == ")")
- return name;
- if (name == "]")
- return name;
- if (name == "/")
- return name;
- if (name == "|")
- return name;
+ if (name.size() == 1) {
+ char_type const c = name[0];
+ if (c == '<' || c == '(' || c == '[' || c == '.'
+ || c == '>' || c == ')' || c == ']' || c == '/' || c == '|')
+ return name;
+ }
return '\\' + name + ' ';
}
-}
-
-
-InsetMathDelim::InsetMathDelim(string const & l, string const & r)
+InsetMathDelim::InsetMathDelim(docstring const & l, docstring const & r)
: InsetMathNest(1), left_(l), right_(r)
{}
InsetMathDelim::InsetMathDelim
- (string const & l, string const & r, MathArray const & ar)
+ (docstring const & l, docstring const & r, MathArray const & ar)
: InsetMathNest(1), left_(l), right_(r)
{
cell(0) = ar;
os << left_ << cell(0) << right_;
}
+
void InsetMathDelim::maxima(MaximaStream & os) const
{
if (isAbs()) {
}
-void InsetMathDelim::mathmlize(MathMLStream & os) const
+void InsetMathDelim::mathmlize(MathStream & os) const
{
os << "<fenced open=\"" << left_ << "\" close=\""
<< right_ << "\">" << cell(0) << "</fenced>";
else
os << left_ << cell(0) << right_;
}
+
+
+} // namespace lyx