mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Fix up the math stream.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33969 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b5d2302180
commit
9ee805185c
@ -54,7 +54,7 @@ void InsetMathBox::normalize(NormalStream & os) const
|
|||||||
|
|
||||||
void InsetMathBox::mathmlize(MathStream & ms) const
|
void InsetMathBox::mathmlize(MathStream & ms) const
|
||||||
{
|
{
|
||||||
SetMode textmode(ms, true, from_ascii("class='mathbox'"));
|
SetMode textmode(ms, true, "class='mathbox'");
|
||||||
ms << cell(0);
|
ms << cell(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ void InsetMathFBox::normalize(NormalStream & os) const
|
|||||||
|
|
||||||
void InsetMathFBox::mathmlize(MathStream & ms) const
|
void InsetMathFBox::mathmlize(MathStream & ms) const
|
||||||
{
|
{
|
||||||
SetMode textmode(ms, true, from_ascii("class='fbox'"));
|
SetMode textmode(ms, true, "class='fbox'");
|
||||||
ms << cell(0);
|
ms << cell(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ void InsetMathMakebox::mathmlize(MathStream & ms) const
|
|||||||
{
|
{
|
||||||
// FIXME We could do something with the other arguments.
|
// FIXME We could do something with the other arguments.
|
||||||
std::string const cssclass = framebox_ ? "framebox" : "makebox";
|
std::string const cssclass = framebox_ ? "framebox" : "makebox";
|
||||||
SetMode textmode(ms, true, from_ascii("class='" + cssclass + "'"));
|
SetMode textmode(ms, true, "class='" + cssclass + "'");
|
||||||
ms << cell(2);
|
ms << cell(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ void InsetMathBoxed::infoize(odocstream & os) const
|
|||||||
|
|
||||||
void InsetMathBoxed::mathmlize(MathStream & ms) const
|
void InsetMathBoxed::mathmlize(MathStream & ms) const
|
||||||
{
|
{
|
||||||
SetMode mathmode(ms, false, from_ascii("class='boxed'"));
|
SetMode mathmode(ms, false, "class='boxed'");
|
||||||
ms << cell(0);
|
ms << cell(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,18 +437,18 @@ HtmlStream & operator<<(HtmlStream & ms, docstring const & s)
|
|||||||
SetMode::SetMode(MathStream & os, bool text)
|
SetMode::SetMode(MathStream & os, bool text)
|
||||||
: os_(os), opened_(false)
|
: os_(os), opened_(false)
|
||||||
{
|
{
|
||||||
init(text, from_ascii(""));
|
init(text, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SetMode::SetMode(MathStream & os, bool text, docstring attrs)
|
SetMode::SetMode(MathStream & os, bool text, string const & attrs)
|
||||||
: os_(os), opened_(false)
|
: os_(os), opened_(false)
|
||||||
{
|
{
|
||||||
init(text, attrs);
|
init(text, attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SetMode::init(bool text, docstring attrs)
|
void SetMode::init(bool text, string const & attrs)
|
||||||
{
|
{
|
||||||
was_text_ = os_.inText();
|
was_text_ = os_.inText();
|
||||||
if (was_text_)
|
if (was_text_)
|
||||||
@ -457,12 +457,12 @@ void SetMode::init(bool text, docstring attrs)
|
|||||||
os_.setTextMode();
|
os_.setTextMode();
|
||||||
os_ << "<mtext";
|
os_ << "<mtext";
|
||||||
if (!attrs.empty())
|
if (!attrs.empty())
|
||||||
os_ << " " << attrs;
|
os_ << " " << from_utf8(attrs);
|
||||||
os_ << ">";
|
os_ << ">";
|
||||||
opened_ = true;
|
opened_ = true;
|
||||||
} else {
|
} else {
|
||||||
if (!attrs.empty()) {
|
if (!attrs.empty()) {
|
||||||
os_ << "<mstyle " << attrs << ">";
|
os_ << "<mstyle " << from_utf8(attrs) << ">";
|
||||||
opened_ = true;
|
opened_ = true;
|
||||||
}
|
}
|
||||||
os_.setMathMode();
|
os_.setMathMode();
|
||||||
@ -493,21 +493,27 @@ SetMode::~SetMode()
|
|||||||
SetHTMLMode::SetHTMLMode(HtmlStream & os, bool text)
|
SetHTMLMode::SetHTMLMode(HtmlStream & os, bool text)
|
||||||
: os_(os), opened_(false)
|
: os_(os), opened_(false)
|
||||||
{
|
{
|
||||||
was_text_ = os_.inText();
|
init(text, "");
|
||||||
if (text)
|
|
||||||
os_.setTextMode();
|
|
||||||
else
|
|
||||||
os_.setMathMode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SetHTMLMode::SetHTMLMode(HtmlStream & os, bool text, string attrs)
|
SetHTMLMode::SetHTMLMode(HtmlStream & os, bool text, string attrs)
|
||||||
: os_(os), opened_(true)
|
: os_(os), opened_(true)
|
||||||
|
{
|
||||||
|
init(text, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetHTMLMode::init(bool text, string const & attrs)
|
||||||
{
|
{
|
||||||
was_text_ = os_.inText();
|
was_text_ = os_.inText();
|
||||||
if (text) {
|
if (text) {
|
||||||
os_.setTextMode();
|
os_.setTextMode();
|
||||||
|
if (attrs.empty())
|
||||||
|
os_ << MTag("span");
|
||||||
|
else
|
||||||
os_ << MTag("span", attrs);
|
os_ << MTag("span", attrs);
|
||||||
|
opened_ = true;
|
||||||
} else
|
} else
|
||||||
os_.setMathMode();
|
os_.setMathMode();
|
||||||
}
|
}
|
||||||
|
@ -335,14 +335,14 @@ MathStream & operator<<(MathStream &, ETag const &);
|
|||||||
class SetMode {
|
class SetMode {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
explicit SetMode(MathStream & os, bool text, docstring attrs);
|
explicit SetMode(MathStream & os, bool text, std::string const & attrs);
|
||||||
///
|
///
|
||||||
explicit SetMode(MathStream & os, bool text);
|
explicit SetMode(MathStream & os, bool text);
|
||||||
///
|
///
|
||||||
~SetMode();
|
~SetMode();
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
void init(bool, docstring);
|
void init(bool, std::string const &);
|
||||||
///
|
///
|
||||||
MathStream & os_;
|
MathStream & os_;
|
||||||
///
|
///
|
||||||
@ -422,6 +422,8 @@ public:
|
|||||||
///
|
///
|
||||||
~SetHTMLMode();
|
~SetHTMLMode();
|
||||||
private:
|
private:
|
||||||
|
///
|
||||||
|
void init(bool, std::string const &);
|
||||||
///
|
///
|
||||||
HtmlStream & os_;
|
HtmlStream & os_;
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user