From ed71c32fcde088d6794b86357a408b48a1b4f5e8 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 30 Mar 2010 22:05:28 +0000 Subject: [PATCH] Treat certain decoration cases differently. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33956 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathDecoration.cpp | 39 ++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index 4077afbfc8..a5e333e308 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -215,9 +215,21 @@ void InsetMathDecoration::mathmlize(MathStream & os) const void InsetMathDecoration::htmlize(HtmlStream & os) const { + string const name = to_utf8(key_->name); + if (name == "bar") { + os << MTag("span", "class='overbar'") << cell(0) << ETag("span"); + return; + } + + if (name == "underbar" || name == "underline") { + os << MTag("span", "class='underbar'") << cell(0) << ETag("span"); + return; + } + Translator const & t = translator(); - Translator::const_iterator cur = t.find(to_utf8(key_->name)); + Translator::const_iterator cur = t.find(name); LASSERT(cur != t.end(), return); + bool symontop = cur->second.over; string const symclass = symontop ? "symontop" : "symonbot"; os << MTag("span", "class='symbolpair " + symclass + "'") @@ -240,13 +252,24 @@ void InsetMathDecoration::htmlize(HtmlStream & os) const void InsetMathDecoration::validate(LaTeXFeatures & features) const { if (features.runparams().flavor == OutputParams::HTML) { - features.addPreambleSnippet(""); + string const name = to_utf8(key_->name); + if (name == "bar") { + features.addPreambleSnippet(""); + } else if (name == "underbar" || name == "underline") { + features.addPreambleSnippet(""); + } else { + features.addPreambleSnippet(""); + } } else { if (!key_->requires.empty()) features.require(to_utf8(key_->requires)); -- 2.39.2