]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathCommand.C
fix reading UTF8 encoded symbol file
[lyx.git] / src / mathed / InsetMathCommand.C
index a001ff413292120ebc161339650ffda37c85d19f..415c72b355346f3174f643d93a997f7aa4dc7b02 100644 (file)
 
 #include "InsetMathCommand.h"
 #include "MathData.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
 #include "dispatchresult.h"
 #include "funcrequest.h"
 
 #include <sstream>
 
-using lyx::docstring;
 
-using std::string;
-using std::auto_ptr;
-using std::ostringstream;
+namespace lyx {
 
+using std::auto_ptr;
+using std::string;
 
-CommandInset::CommandInset(string const & name)
+CommandInset::CommandInset(docstring const & name)
        : InsetMathNest(2), name_(name), set_label_(false)
 {
        lock_ = true;
@@ -74,16 +73,18 @@ void CommandInset::write(WriteStream & os) const
 
 docstring const CommandInset::screenLabel() const
 {
-       return lyx::from_ascii(name_);
+       return name_;
 }
 
 
 string const CommandInset::createDialogStr(string const & name) const
 {
-       ostringstream os;
-       os << name << " LatexCommand ";
+       odocstringstream os;
+       os << from_ascii(name + " LatexCommand ");
        WriteStream ws(os);
        write(ws);
-       ws << "\n\\end_inset\n\n";
-       return os.str();
+       return to_utf8(os.str()) + "\n\\end_inset\n\n";
 }
+
+
+} // namespace lyx