X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathCancel.cpp;h=755470fdd8ea40766ffe5390ced2b9129026d98e;hb=c56d524cd6af5d0ed0d50fef51ab434ce418d1e0;hp=3010054a503d08f9076a133f912d6abb48b58690;hpb=65f26a7a1418d3a481949f49fd3f9868fe06e352;p=lyx.git diff --git a/src/mathed/InsetMathCancel.cpp b/src/mathed/InsetMathCancel.cpp index 3010054a50..755470fdd8 100644 --- a/src/mathed/InsetMathCancel.cpp +++ b/src/mathed/InsetMathCancel.cpp @@ -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. */ @@ -47,13 +47,15 @@ void InsetMathCancel::draw(PainterInfo & pi, int x, int y) const cell(0).draw(pi, x + 1, y); Dimension const dim = dimension(*pi.base.bv); - // y1 \ / - // \ / - // \/ - // /\ - // / \ - // y2 / \ - // x1 x2 + /* + * y1 \ / + * \ / + * \/ + * /\ + * / \ + * y2 / \ + * x1 x2 + */ int const x2 = x + dim.wid; int const x1 = x; @@ -123,6 +125,41 @@ 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"); + break; + case bcancel: + 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"); + break; + } +} + + void InsetMathCancel::validate(LaTeXFeatures & features) const { InsetMathNest::validate(features);