]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathNumber.cpp
Account for old versions of Pygments
[lyx.git] / src / mathed / InsetMathNumber.cpp
index 5247af48770d27880e22b1a6d885c571653377cc..5237cebab65a95747b5a67c1489950ee0e133ae7 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 #include "MathStream.h"
 #include "MathSupport.h"
 
+#include "MetricsInfo.h"
+
+using namespace std;
 
-namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-using std::vector;
+namespace lyx {
 
 InsetMathNumber::InsetMathNumber(docstring const & s)
        : str_(s)
 {}
 
 
-auto_ptr<Inset> InsetMathNumber::doClone() const
+Inset * InsetMathNumber::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathNumber(*this));
+       return new InsetMathNumber(*this);
 }
 
 
-bool InsetMathNumber::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetMathNumber::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        mathed_string_dim(mi.base.font, str_, dim);
-       if (dim_ == dim)
-               return false;
-       dim_ = dim;
-       return true;
 }
 
 
@@ -75,7 +71,13 @@ void InsetMathNumber::octave(OctaveStream & os) const
 
 void InsetMathNumber::mathmlize(MathStream & os) const
 {
-       os << "<mi> " << str_ << " </mi>";
+       os << "<mn>" << str_ << "</mn>";
+}
+
+
+void InsetMathNumber::htmlize(HtmlStream & os) const
+{
+       os << str_;
 }