]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathAMSArray.C
fix reading UTF8 encoded symbol file
[lyx.git] / src / mathed / InsetMathAMSArray.C
index 2a6e00ae7273078ce674ae974e9407e98d3898eb..18b3502ed8ab219809d20b70924894d372bb5ebd 100644 (file)
@@ -13,7 +13,7 @@
 #include "LaTeXFeatures.h"
 #include "InsetMathAMSArray.h"
 #include "MathData.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 
 #include "support/lstrings.h"
 #include "support/std_ostream.h"
 
-using std::string;
 using std::auto_ptr;
 
-
 namespace lyx {
 
 using support::bformat;
 
 
-InsetMathAMSArray::InsetMathAMSArray(string const & name, int m, int n)
+InsetMathAMSArray::InsetMathAMSArray(docstring const & name, int m, int n)
        : InsetMathGrid(m, n), name_(name)
 {}
 
 
-InsetMathAMSArray::InsetMathAMSArray(string const & name)
+InsetMathAMSArray::InsetMathAMSArray(docstring const & name)
        : InsetMathGrid(1, 1), name_(name)
 {}
 
@@ -94,8 +92,8 @@ void InsetMathAMSArray::draw(PainterInfo & pi, int x, int y) const
 {
        int const yy = y - dim_.ascent();
        // Drawing the deco after an ArrayChanger does not work
-       mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), name_left());
-       mathed_draw_deco(pi, x + dim_.width() - 8, yy, 5, dim_.height(), name_right());
+       mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), from_ascii(name_left()));
+       mathed_draw_deco(pi, x + dim_.width() - 8, yy, 5, dim_.height(), from_ascii(name_right()));
        ArrayChanger dummy(pi.base);
        InsetMathGrid::drawWithMargin(pi, x, y, 6, 8);
 }
@@ -109,8 +107,7 @@ bool InsetMathAMSArray::getStatus(LCursor & cur, FuncRequest const & cmd,
                docstring const & s = cmd.argument();
                if (s == "add-vline-left" || s == "add-vline-right") {
                        flag.message(bformat(
-                       from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
-                               from_utf8(name_)));
+                               from_utf8(N_("Can't add vertical grid lines in '%1$s'")),       name_));
                        flag.enabled(false);
                        return true;
                }
@@ -130,9 +127,9 @@ void InsetMathAMSArray::write(WriteStream & os) const
 }
 
 
-void InsetMathAMSArray::infoize(std::ostream & os) const
+void InsetMathAMSArray::infoize(odocstream & os) const
 {
-       string name = name_;
+       docstring name = name_;
        name[0] = support::uppercase(name[0]);
        os << name << ' ';
 }