]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroArgument.C
we rely on Windows and maybe Linux on a Qt bug
[lyx.git] / src / mathed / MathMacroArgument.C
index 0ffaa799ec017fa69c28e56891d8e1387cf20a00..3bb72bde94a0a4728257dd52ad71307822abc5ba 100644 (file)
 
 #include "MathMacroArgument.h"
 #include "InsetMathMacro.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
 #include "MathSupport.h"
+#include "support/convert.h"
 #include "debug.h"
 
+
+namespace lyx {
+
 using std::endl;
 using std::auto_ptr;
 using std::size_t;
+using std::vector;
 
 
 MathMacroArgument::MathMacroArgument(size_t n)
@@ -29,9 +34,7 @@ MathMacroArgument::MathMacroArgument(size_t n)
                lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
                        << n << endl;
        }
-       str_[0] = '#';
-       str_[1] = static_cast<unsigned char>('0' + n);
-       str_[2] = '\0';
+       str_ = '#' + convert<docstring>(n);
 }
 
 
@@ -49,15 +52,14 @@ void MathMacroArgument::write(WriteStream & os) const
 
 void MathMacroArgument::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       mathed_string_dim(mi.base.font, lyx::from_utf8(str_), dim_);
+       mathed_string_dim(mi.base.font, str_, dim_);
        dim = dim_;
 }
 
 
 void MathMacroArgument::draw(PainterInfo & pi, int x, int y) const
 {
-       // FIXME UNICODE
-       drawStrRed(pi, x, y, lyx::from_utf8(str_));
+       drawStrRed(pi, x, y, str_);
        setPosCache(pi, x, y);
 }
 
@@ -66,3 +68,6 @@ void MathMacroArgument::normalize(NormalStream & os) const
 {
        os << "[macroarg " << str_ << "] ";
 }
+
+
+} // namespace lyx