]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_symbolinset.C
infrastructure for requiring "amssymb".
[lyx.git] / src / mathed / math_symbolinset.C
index 9b0a9e41dea40168fa79f345d711c3975bda0396..f2f0f5c6a2273a88990a9af1558fd148f7c4a4ff 100644 (file)
@@ -1,5 +1,8 @@
+#include <config.h>
+
 #include "math_symbolinset.h"
 #include "math_mathmlstream.h"
+#include "math_streamstr.h"
 #include "math_support.h"
 #include "math_parser.h"
 #include "debug.h"
@@ -15,6 +18,11 @@ MathSymbolInset::MathSymbolInset(const char * name)
 {}
 
 
+MathSymbolInset::MathSymbolInset(string const & name)
+       : sym_(in_word_set(name.c_str())), h_(0)
+{}
+
+
 
 MathInset * MathSymbolInset::clone() const
 {
@@ -114,7 +122,7 @@ bool MathSymbolInset::takesLimits() const
 
 void MathSymbolInset::normalize(NormalStream & os) const
 {
-       os << "[symbol " << name().c_str() << "]";
+       os << "[symbol " << name() << "]";
 }
 
 
@@ -123,7 +131,7 @@ void MathSymbolInset::maplize(MapleStream & os) const
        if (name() == "cdot")
                os << '*';
        else
-               os << name().c_str();
+               os << name();
 }
 
 
@@ -147,9 +155,9 @@ void MathSymbolInset::mathmlize(MathMLStream & os) const
        char const * type = MathMLtype(sym_->type);
        os << '<' << type << "> ";
        if (sym_->xmlname == "x") // unknown so far
-               os << name().c_str();
+               os << name();
        else
-               os << sym_->xmlname.c_str();
+               os << sym_->xmlname;
        os << " </" << type << '>';
 }
 
@@ -159,13 +167,24 @@ void MathSymbolInset::octavize(OctaveStream & os) const
        if (name() == "cdot")
                os << '*';
        else
-               os << name().c_str();
+               os << name();
 }
 
 
 void MathSymbolInset::write(WriteStream & os) const
 {
-       os << '\\' << name().c_str() << ' ';
+       os << '\\' << name() << ' ';
+}
+
+
+void MathSymbolInset::infoize(std::ostream & os) const
+{
+       os << '\\' << name();
 }
 
 
+void MathSymbolInset::validate(LaTeXFeatures & features) const
+{
+       // if (...)
+       //      features.require("amssymb");
+}