]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathExFunc.C
fix reading UTF8 encoded symbol file
[lyx.git] / src / mathed / InsetMathExFunc.C
index 6ee9479e50e8756984768af72a8bf26bb8cff395..4b9ba777cb7bba7c0b10c0992288c8d2da58341e 100644 (file)
 
 #include "InsetMathExFunc.h"
 #include "MathData.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 
 
-using std::string;
+namespace lyx {
+
 using std::auto_ptr;
+using std::vector;
+using std::string;
 
 
-InsetMathExFunc::InsetMathExFunc(string const & name)
+InsetMathExFunc::InsetMathExFunc(docstring const & name)
        : InsetMathNest(1), name_(name)
 {}
 
 
-InsetMathExFunc::InsetMathExFunc(string const & name, MathArray const & ar)
+InsetMathExFunc::InsetMathExFunc(docstring const & name, MathArray const & ar)
        : InsetMathNest(1), name_(name)
 {
        cell(0) = ar;
@@ -51,7 +54,7 @@ void InsetMathExFunc::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-string InsetMathExFunc::name() const
+docstring InsetMathExFunc::name() const
 {
        return name_;
 }
@@ -75,7 +78,7 @@ void InsetMathExFunc::maxima(MaximaStream & os) const
 }
 
 
-string asMathematicaName(string const & name)
+static string asMathematicaName(string const & name)
 {
        if (name == "sin")    return "Sin";
        if (name == "sinh")   return "Sinh";
@@ -107,13 +110,19 @@ string asMathematicaName(string const & name)
 }
 
 
+static docstring asMathematicaName(docstring const & name)
+{
+       return from_utf8(asMathematicaName(to_utf8(name)));
+}
+
+
 void InsetMathExFunc::mathematica(MathematicaStream & os) const
 {
        os << asMathematicaName(name_) << '[' << cell(0) << ']';
 }
 
 
-void InsetMathExFunc::mathmlize(MathMLStream & os) const
+void InsetMathExFunc::mathmlize(MathStream & os) const
 {
        os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
 }
@@ -123,3 +132,6 @@ void InsetMathExFunc::octave(OctaveStream & os) const
 {
        os << name_ << '(' << cell(0) << ')';
 }
+
+
+} // namespace lyx