HTML for dots.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33958 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-03-30 22:14:00 +00:00
parent 8d51923b8b
commit caf170d612
2 changed files with 25 additions and 3 deletions

View File

@ -93,14 +93,12 @@ void InsetMathDots::mathmlize(MathStream & os) const
std::string ent; std::string ent;
if (n == "dots" || n == "dotsc" || n == "dotso" || n == "ldots") if (n == "dots" || n == "dotsc" || n == "dotso" || n == "ldots")
ent = "…"; ent = "…";
else if (n == "adots") else if (n == "adots" || n == "iddots")
ent = "⋰"; ent = "⋰";
else if (n == "cdots" || n == "dotsb" || n == "dotsi" || n == "dotsm") else if (n == "cdots" || n == "dotsb" || n == "dotsi" || n == "dotsm")
ent = "⋯"; ent = "⋯";
else if (n == "ddots") else if (n == "ddots")
ent = "⋱"; ent = "⋱";
else if (n == "iddots")
ent = "⋰";
else if (n == "vdots") else if (n == "vdots")
ent = "⋮"; ent = "⋮";
else else
@ -108,4 +106,26 @@ void InsetMathDots::mathmlize(MathStream & os) const
os << MTag("mi") << from_ascii(ent) << ETag("mi"); os << MTag("mi") << from_ascii(ent) << ETag("mi");
} }
void InsetMathDots::htmlize(HtmlStream & os) const
{
// which symbols we support is decided by what is listed in
// lib/symbols as generating a dots inset
docstring const & n = key_->name;
std::string ent;
if (n == "dots" || n == "dotsc" || n == "dotso" || n == "ldots")
ent = "&#x02026;";
else if (n == "adots" || n == "iddots")
ent = "&#x022F0;";
else if (n == "cdots" || n == "dotsb" || n == "dotsi" || n == "dotsm")
ent = "&#x022EF;";
else if (n == "ddots")
ent = "&#x022F1;";
else if (n == "vdots")
ent = "&#x022EE;";
else
LASSERT(false, ent = "#x02026;");
os << from_ascii(ent);
}
} // namespace lyx } // namespace lyx

View File

@ -36,6 +36,8 @@ public:
InsetCode lyxCode() const { return MATH_DOTS_CODE; } InsetCode lyxCode() const { return MATH_DOTS_CODE; }
/// ///
void mathmlize(MathStream & os) const; void mathmlize(MathStream & os) const;
///
void htmlize(HtmlStream & os) const;
protected: protected:
/// cache for the thing's height /// cache for the thing's height
mutable int dh_; mutable int dh_;