From da260795787e692efc083ef361fc5aa1e136d79a Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 31 Mar 2010 20:47:55 +0000 Subject: [PATCH] HTML for math spaces. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33986 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathSpace.cpp | 34 ++++++++++++++++++++++++++++++++++ src/mathed/InsetMathSpace.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index bd426008cd..985e93f127 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -207,6 +207,40 @@ void InsetMathSpace::mathmlize(MathStream & ms) const } +void InsetMathSpace::htmlize(HtmlStream & ms) const +{ + SpaceInfo const & si = space_info[space_]; + switch (si.kind) { + case InsetSpaceParams::THIN: + ms << from_ascii(" "); + break; + case InsetSpaceParams::MEDIUM: + ms << from_ascii(" "); + break; + case InsetSpaceParams::THICK: + ms << from_ascii(" "); + break; + case InsetSpaceParams::ENSKIP: + ms << from_ascii(" "); + break; + case InsetSpaceParams::QUAD: + ms << from_ascii(" "); + break; + case InsetSpaceParams::QQUAD: + ms << from_ascii("  "); + break; + case InsetSpaceParams::CUSTOM: { + string l = length_.asHTMLString(); + ms << MTag("span", "width='" + l + "'") + << from_ascii(" ") << ETag("span"); + break; + } + default: + break; + } +} + + void InsetMathSpace::normalize(NormalStream & os) const { os << "[space " << int(space_) << "] "; diff --git a/src/mathed/InsetMathSpace.h b/src/mathed/InsetMathSpace.h index 381562178c..8f633fffa8 100644 --- a/src/mathed/InsetMathSpace.h +++ b/src/mathed/InsetMathSpace.h @@ -53,6 +53,8 @@ public: /// void mathmlize(MathStream & ms) const; /// + void htmlize(HtmlStream & ms) const; + /// void write(WriteStream & os) const; /// generate something that will be understood by the Dialogs. InsetSpaceParams params() const; -- 2.39.2