]> git.lyx.org Git - features.git/blobdiff - src/mathed/MathMacro.cpp
Make macro xhtml export more secure
[features.git] / src / mathed / MathMacro.cpp
index db64c839535b4808fe41bbf8059ae139930d22f5..c7339528614cc4f571570fbe799e0dd3ce19924f 100644 (file)
@@ -793,12 +793,11 @@ void MathMacro::maple(MapleStream & os) const
 
 void MathMacro::mathmlize(MathStream & os) const
 {
-       MathWordList const & words = mathedWordList();
-       MathWordList::const_iterator it = words.find(name());
-       if (it != words.end()) {
-               docstring const xmlname = it->second.xmlname;
+       LATTEST(macro_);
+       if (macro_) {
+               docstring const xmlname = macro_->xmlname();
                if (!xmlname.empty()) {
-                       char const * type = it->second.MathMLtype();
+                       char const * type = macro_->MathMLtype();
                        os << '<' << type << "> " << xmlname << " /<"
                           << type << '>';
                        return;
@@ -815,10 +814,9 @@ void MathMacro::mathmlize(MathStream & os) const
 
 void MathMacro::htmlize(HtmlStream & os) const
 {
-       MathWordList const & words = mathedWordList();
-       MathWordList::const_iterator it = words.find(name());
-       if (it != words.end()) {
-               docstring const xmlname = it->second.xmlname;
+       LATTEST(macro_);
+       if (macro_) {
+               docstring const xmlname = macro_->xmlname();
                if (!xmlname.empty()) {
                        os << ' ' << xmlname << ' ';
                        return;