]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathCancel.cpp
Merge branch 'betterspacing'
[lyx.git] / src / mathed / InsetMathCancel.cpp
index 545e6f5d20019bb4ec2252c8eea0219a2314b4eb..0a8aad90fa65832dfb0ab2b03a19aeced794e179 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 Uwe Stöhr
+ * \author Uwe Stöhr
  *
  * Full author contact details are available in file CREDITS.
  */
 
 #include "InsetMathCancel.h"
 
-#include "LaTeXFeatures.h"
 #include "MathStream.h"
 
+#include "LaTeXFeatures.h"
+#include "MetricsInfo.h"
+
 #include "frontends/Painter.h"
 
 #include <ostream>
@@ -36,7 +38,7 @@ Inset * InsetMathCancel::clone() const
 void InsetMathCancel::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        cell(0).metrics(mi, dim);
-       metricsMarkers(dim);
+       metricsMarkers(mi, dim);
 }
 
 
@@ -126,21 +128,35 @@ void InsetMathCancel::infoize(odocstream & os) const
 }
 
 
+// unfortunately, we do not have many options here, so we have to treat
+// them all the same way.
+void InsetMathCancel::htmlize(HtmlStream & os) const
+{
+       os << MTag("span", "style='text-decoration: line-through;'")
+          << cell(0)
+          << ETag("span");
+}
+
+
 void InsetMathCancel::mathmlize(MathStream & os) const
 {
        switch (kind_) {
        case cancel:
-               os << MTag("menclose", "notation='updiagonalstrike'") << cell(0) << ETag("menclose"); 
+               os << MTag("menclose", "notation='updiagonalstrike'")
+                  << cell(0)
+                  << ETag("menclose"); 
                break;
        case bcancel:
-               os << MTag("menclose", "notation='downdiagonalstrike'") << cell(0) << ETag("menclose"); 
+               os << MTag("menclose", "notation='downdiagonalstrike'")
+                  << cell(0)
+                  << ETag("menclose"); 
                break;
        case xcancel:
                os << MTag("menclose", "notation='updiagonalstrike'")
                   << MTag("menclose", "notation='downdiagonalstrike'")
                   << cell(0)
                   << ETag("menclose")
-                  << ETag("menclose"); 
+                  << ETag("menclose");
                break;
        }
 }