Rename WriteStream to TeXMathStream.

This commit is contained in:
Thibaut Cuvelier 2020-12-26 20:04:36 +01:00
parent ecafea8227
commit 649755f481
119 changed files with 217 additions and 217 deletions

View File

@ -1879,7 +1879,7 @@ void Cursor::normalize()
<< " in atom: '";
odocstringstream os;
otexrowstream ots(os);
WriteStream wi(ots, false, true, WriteStream::wsDefault);
TeXMathStream wi(ots, false, true, TeXMathStream::wsDefault);
inset().asInsetMath()->write(wi);
lyxerr << to_utf8(os.str()) << endl;
pos() = lastpos();

View File

@ -819,11 +819,11 @@ void PreviewLoader::Impl::dumpPreamble(otexstream & os, Flavor flavor) const
buffer_.writeLaTeXSource(os, buffer_.filePath(), runparams, Buffer::OnlyPreamble);
// FIXME! This is a HACK! The proper fix is to control the 'true'
// passed to WriteStream below:
// passed to TeXMathStream below:
// int InsetMathNest::latex(Buffer const &, odocstream & os,
// OutputParams const & runparams) const
// {
// WriteStream wi(os, runparams.moving_arg, true);
// TeXMathStream wi(os, runparams.moving_arg, true);
// par_->write(wi);
// return wi.line();
// }

View File

@ -3441,7 +3441,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
for (int s = cur.depth() - 1; s >= 0; --s) {
CursorSlice const & cs = cur[s];
if (cs.asInsetMath() && cs.asInsetMath()->asHullInset()) {
WriteStream ws(os);
TeXMathStream ws(os);
cs.asInsetMath()->asHullInset()->header_write(ws);
break;
}
@ -3465,7 +3465,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
CursorSlice const & cs2 = cur[s];
InsetMath * inset = cs2.asInsetMath();
if (inset && inset->asHullInset()) {
WriteStream ws(os);
TeXMathStream ws(os);
inset->asHullInset()->footer_write(ws);
break;
}

View File

@ -111,7 +111,7 @@ bool InsetMath::addToMathRow(MathRow & mrow, MetricsInfo & mi) const
/// write LaTeX and LyX code
void InsetMath::writeLimits(WriteStream & os) const
void InsetMath::writeLimits(TeXMathStream & os) const
{
if (limits() == LIMITS) {
os << "\\limits";
@ -128,7 +128,7 @@ void InsetMath::dump() const
lyxerr << "---------------------------------------------" << endl;
odocstringstream os;
otexrowstream ots(os);
WriteStream wi(ots, false, true, WriteStream::wsDefault);
TeXMathStream wi(ots, false, true, TeXMathStream::wsDefault);
write(wi);
lyxerr << to_utf8(os.str());
lyxerr << "\n---------------------------------------------" << endl;
@ -147,7 +147,7 @@ void InsetMath::drawT(TextPainter &, int, int) const
}
void InsetMath::write(WriteStream & os) const
void InsetMath::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
docstring const s = name();
@ -232,7 +232,7 @@ ostream & operator<<(ostream & os, MathAtom const & at)
{
odocstringstream oss;
otexrowstream ots(oss);
WriteStream wi(ots, false, false, WriteStream::wsDefault);
TeXMathStream wi(ots, false, false, TeXMathStream::wsDefault);
at->write(wi);
return os << to_utf8(oss.str());
}
@ -241,7 +241,7 @@ ostream & operator<<(ostream & os, MathAtom const & at)
odocstream & operator<<(odocstream & os, MathAtom const & at)
{
otexrowstream ots(os);
WriteStream wi(ots, false, false, WriteStream::wsDefault);
TeXMathStream wi(ots, false, false, TeXMathStream::wsDefault);
at->write(wi);
return os;
}

View File

@ -105,7 +105,7 @@ class MapleStream;
class MaximaStream;
class MathematicaStream;
class MathMLStream;
class WriteStream;
class TeXMathStream;
class MathData;
class InsetMathMacroTemplate;
@ -216,7 +216,7 @@ public:
/// sets types of sub/superscripts
virtual void limits(Limits) {}
/// write limits status for LaTeX and LyX code
void writeLimits(WriteStream & os) const;
void writeLimits(TeXMathStream & os) const;
/// replace things by other things
virtual void replace(ReplaceData &) {}
@ -231,7 +231,7 @@ public:
// write(). This is to shut off a clang warning.
using Inset::write;
/// write LaTeX and LyX code
virtual void write(WriteStream & os) const;
virtual void write(TeXMathStream & os) const;
/// write normalized content
virtual void normalize(NormalStream &) const;
/// write content as something readable by Maple

View File

@ -146,7 +146,7 @@ bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd,
}
void InsetMathAMSArray::write(WriteStream & os) const
void InsetMathAMSArray::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\begin{" << name_ << '}';

View File

@ -44,7 +44,7 @@ public:
bool getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void infoize(odocstream & os) const override;
///

View File

@ -88,7 +88,7 @@ void InsetMathArray::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathArray::write(WriteStream & os) const
void InsetMathArray::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);

View File

@ -38,7 +38,7 @@ public:
InsetMathArray const * asArrayInset() const override { return this; }
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void infoize(odocstream & os) const override;
///

View File

@ -120,7 +120,7 @@ void InsetMathBig::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathBig::write(WriteStream & os) const
void InsetMathBig::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << '\\' << name_ << delim_;

View File

@ -31,7 +31,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream & os) const override;
///

View File

@ -90,7 +90,7 @@ void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
}
void InsetMathBoldSymbol::write(WriteStream & os) const
void InsetMathBoldSymbol::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
switch (kind_) {

View File

@ -40,7 +40,7 @@ public:
///
void validate(LaTeXFeatures & features) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void mathmlize(MathMLStream &) const override;
///

View File

@ -42,7 +42,7 @@ InsetMathBox::InsetMathBox(Buffer * buf, docstring const & name)
{}
void InsetMathBox::write(WriteStream & os) const
void InsetMathBox::write(TeXMathStream & os) const
{
ModeSpecifier specifier(os, TEXT_MODE);
os << '\\' << name_ << '{' << cell(0) << '}';
@ -150,7 +150,7 @@ void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathFBox::write(WriteStream & os) const
void InsetMathFBox::write(TeXMathStream & os) const
{
ModeSpecifier specifier(os, TEXT_MODE);
os << "\\fbox{" << cell(0) << '}';
@ -279,7 +279,7 @@ void InsetMathMakebox::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathMakebox::write(WriteStream & os) const
void InsetMathMakebox::write(TeXMathStream & os) const
{
ModeSpecifier specifier(os, TEXT_MODE);
os << (framebox_ ? "\\framebox" : "\\makebox");
@ -372,7 +372,7 @@ void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathBoxed::write(WriteStream & os) const
void InsetMathBoxed::write(TeXMathStream & os) const
{
ModeSpecifier specifier(os, MATH_MODE);
os << "\\boxed{" << cell(0) << '}';

View File

@ -29,7 +29,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream & ns) const override;
///
@ -64,7 +64,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream & ns) const override;
///
@ -91,7 +91,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream & ns) const override;
///
@ -126,7 +126,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void mathmlize(MathMLStream & ms) const override;
///

View File

@ -72,7 +72,7 @@ void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathBrace::write(WriteStream & os) const
void InsetMathBrace::write(TeXMathStream & os) const
{
os << '{' << cell(0) << '}';
}

View File

@ -34,7 +34,7 @@ public:
///
void draw(PainterInfo &, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream & ns) const override;
///

View File

@ -77,7 +77,7 @@ void InsetMathCancel::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathCancel::write(WriteStream & os) const
void InsetMathCancel::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
switch (kind_) {

View File

@ -32,7 +32,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream & ns) const override;
///

View File

@ -88,7 +88,7 @@ void InsetMathCancelto::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathCancelto::write(WriteStream & os) const
void InsetMathCancelto::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\cancelto{" << cell(1) << "}{" << cell(0) << '}';

View File

@ -28,7 +28,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream & ns) const override;
///

View File

@ -111,7 +111,7 @@ bool InsetMathCases::getStatus(Cursor & cur, FuncRequest const & cmd,
}
void InsetMathCases::write(WriteStream & os) const
void InsetMathCases::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
if (os.fragile())

View File

@ -45,7 +45,7 @@ public:
///
void htmlize(HtmlStream &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void validate(LaTeXFeatures & features) const override;
///

View File

@ -195,7 +195,7 @@ void InsetMathChar::drawT(TextPainter & pain, int x, int y) const
}
void InsetMathChar::write(WriteStream & os) const
void InsetMathChar::write(TeXMathStream & os) const
{
os.os().put(char_);
}

View File

@ -35,7 +35,7 @@ public:
int kerning(BufferView const *) const override { return kerning_; }
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void validate(LaTeXFeatures & features) const override;
///

View File

@ -49,7 +49,7 @@ void InsetMathClass::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathClass::write(WriteStream & os) const
void InsetMathClass::write(TeXMathStream & os) const
{
InsetMathNest::write(os);
writeLimits(os);

View File

@ -41,7 +41,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void infoize(odocstream & os) const override;
///

View File

@ -94,7 +94,7 @@ void InsetMathColor::validate(LaTeXFeatures & features) const
}
void InsetMathColor::write(WriteStream & os) const
void InsetMathColor::write(TeXMathStream & os) const
{
// We have to ensure correct spacing when the front and/or back
// atoms are not ordinary ones (bug 11827).

View File

@ -35,7 +35,7 @@ public:
/// we need package color
void validate(LaTeXFeatures & features) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// FIXME XHTML For now, we do nothing with color.
void mathmlize(MathMLStream &) const override {}
/// FIXME XHTML For now, we do nothing with color.

View File

@ -59,7 +59,7 @@ void InsetMathCommand::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathCommand::write(WriteStream & os) const
void InsetMathCommand::write(TeXMathStream & os) const
{
ModeSpecifier specifier(os, currentMode(), lockedMode(), asciiOnly());
MathEnsurer ensurer(os, needs_math_mode_);

View File

@ -36,7 +36,7 @@ public:
///
Inset * editXY(Cursor &, int, int) override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
//
// void infoize(odocstream & os) const;
///

View File

@ -71,7 +71,7 @@ void InsetMathComment::drawT(TextPainter & pain, int x, int y) const
}
void InsetMathComment::write(WriteStream & os) const
void InsetMathComment::write(TeXMathStream & os) const
{
os << '%' << cell(0) << "\n";
}

View File

@ -36,7 +36,7 @@ public:
void drawT(TextPainter & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void maple(MapleStream &) const override;
///

View File

@ -146,7 +146,7 @@ void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathDecoration::write(WriteStream & os) const
void InsetMathDecoration::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
if (os.fragile() && protect())

View File

@ -30,7 +30,7 @@ public:
///
void draw(PainterInfo &, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///

View File

@ -74,7 +74,7 @@ void InsetMathDelim::validate(LaTeXFeatures & features) const
}
void InsetMathDelim::write(WriteStream & os) const
void InsetMathDelim::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\left" << convertDelimToLatexName(left_) << cell(0)

View File

@ -48,7 +48,7 @@ public:
///
void validate(LaTeXFeatures & features) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream &) const override;
///

View File

@ -66,7 +66,7 @@ void InsetMathDiagram::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathDiagram::write(WriteStream & os) const
void InsetMathDiagram::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\Diagram";

View File

@ -35,7 +35,7 @@ public:
int rowsep() const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void infoize(odocstream & os) const override;
///

View File

@ -95,7 +95,7 @@ void InsetMathDiff::mathematica(MathematicaStream & os) const
}
void InsetMathDiff::write(WriteStream &) const
void InsetMathDiff::write(TeXMathStream &) const
{
LYXERR0("should not happen");
}

View File

@ -41,7 +41,7 @@ public:
///
void maxima(MaximaStream &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
InsetCode lyxCode() const override { return MATH_DIFF_CODE; }
private:

View File

@ -62,7 +62,7 @@ void InsetMathEnsureMath::drawT(TextPainter & pain, int x, int y) const
}
void InsetMathEnsureMath::write(WriteStream & os) const
void InsetMathEnsureMath::write(TeXMathStream & os) const
{
ModeSpecifier specifier(os, MATH_MODE);
os << "\\ensuremath{" << cell(0) << "}";

View File

@ -34,7 +34,7 @@ public:
///
void drawT(TextPainter & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void mathmlize(MathMLStream &) const override;
///

View File

@ -51,7 +51,7 @@ void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathEnv::write(WriteStream & os) const
void InsetMathEnv::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';

View File

@ -26,7 +26,7 @@ public:
///
void draw(PainterInfo &, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream & ns) const override;
///

View File

@ -190,7 +190,7 @@ void InsetMathExInt::htmlize(HtmlStream & os) const
}
void InsetMathExInt::write(WriteStream &) const
void InsetMathExInt::write(TeXMathStream &) const
{
LYXERR0("should not happen");
}

View File

@ -56,7 +56,7 @@ public:
///
void htmlize(HtmlStream &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
InsetCode lyxCode() const override { return MATH_EXINT_CODE; }
private:

View File

@ -62,7 +62,7 @@ bool InsetMathFont::lockedMode() const
}
void InsetMathFont::write(WriteStream & os) const
void InsetMathFont::write(TeXMathStream & os) const
{
// Close the mode changing command inserted during export if
// we are going to output another mode changing command that

View File

@ -34,7 +34,7 @@ public:
/// do we allow changing mode during latex export?
bool lockedMode() const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
docstring name() const override;
///

View File

@ -94,7 +94,7 @@ void InsetMathFontOld::drawT(TextPainter & pain, int x, int y) const
}
void InsetMathFontOld::write(WriteStream & os) const
void InsetMathFontOld::write(TeXMathStream & os) const
{
os << "{\\" << key_->name << ' ' << cell(0) << '}';
}

View File

@ -38,7 +38,7 @@ public:
///
void drawT(TextPainter & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///

View File

@ -386,7 +386,7 @@ void InsetMathFrac::drawT(TextPainter & /*pain*/, int /*x*/, int /*y*/) const
}
void InsetMathFrac::write(WriteStream & os) const
void InsetMathFrac::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
switch (kind_) {
@ -698,7 +698,7 @@ bool InsetMathBinom::extraBraces() const
}
void InsetMathBinom::write(WriteStream & os) const
void InsetMathBinom::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
switch (kind_) {

View File

@ -82,7 +82,7 @@ public:
///
bool extraBraces() const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void maple(MapleStream &) const override;
///
@ -121,7 +121,7 @@ public:
///
explicit InsetMathBinom(Buffer * buf, Kind kind = BINOM);
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
/// Generalized fractions are of inner class (see The TeXbook, p.292)

View File

@ -1237,14 +1237,14 @@ void InsetMathGrid::validate(LaTeXFeatures & features) const
}
void InsetMathGrid::write(WriteStream & os) const
void InsetMathGrid::write(TeXMathStream & os) const
{
write(os, 0, 0, nrows(), ncols());
}
void InsetMathGrid::write(WriteStream & os,
row_type beg_row, col_type beg_col,
row_type end_row, col_type end_col) const
void InsetMathGrid::write(TeXMathStream & os,
row_type beg_row, col_type beg_col,
row_type end_row, col_type end_col) const
{
MathEnsurer ensurer(os, false);
docstring eol;

View File

@ -208,11 +208,11 @@ public:
virtual bool handlesMulticolumn() const { return false; }
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void write(WriteStream & os,
row_type beg_row, col_type beg_col,
row_type end_row, col_type end_col) const;
void write(TeXMathStream & os,
row_type beg_row, col_type beg_col,
row_type end_row, col_type end_col) const;
///
void normalize(NormalStream &) const override;
///

View File

@ -121,28 +121,28 @@ namespace {
// writes a preamble for underlined or struck out math display
void writeMathdisplayPreamble(WriteStream & os)
void writeMathdisplayPreamble(TeXMathStream & os)
{
if (os.strikeoutMath())
return;
if (os.ulemCmd() == WriteStream::UNDERLINE)
if (os.ulemCmd() == TeXMathStream::UNDERLINE)
os << "\\raisebox{-\\belowdisplayshortskip}{"
"\\parbox[b]{\\linewidth}{";
else if (os.ulemCmd() == WriteStream::STRIKEOUT)
else if (os.ulemCmd() == TeXMathStream::STRIKEOUT)
os << "\\parbox{\\linewidth}{";
}
// writes a postamble for underlined or struck out math display
void writeMathdisplayPostamble(WriteStream & os)
void writeMathdisplayPostamble(TeXMathStream & os)
{
if (os.strikeoutMath())
return;
if (os.ulemCmd() == WriteStream::UNDERLINE)
if (os.ulemCmd() == TeXMathStream::UNDERLINE)
os << "}}\\\\\n";
else if (os.ulemCmd() == WriteStream::STRIKEOUT)
else if (os.ulemCmd() == TeXMathStream::STRIKEOUT)
os << "}\\\\\n";
}
@ -678,7 +678,7 @@ void InsetMathHull::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
} else {
odocstringstream os;
otexrowstream ots(os);
WriteStream wi(ots, false, true, WriteStream::wsDefault);
TeXMathStream wi(ots, false, true, TeXMathStream::wsDefault);
write(wi);
dim.wid = os.str().size();
dim.asc = 1;
@ -694,7 +694,7 @@ void InsetMathHull::drawT(TextPainter & pain, int x, int y) const
} else {
odocstringstream os;
otexrowstream ots(os);
WriteStream wi(ots, false, true, WriteStream::wsDefault);
TeXMathStream wi(ots, false, true, TeXMathStream::wsDefault);
write(wi);
pain.draw(x, y, os.str().c_str());
}
@ -713,7 +713,7 @@ static docstring latexString(InsetMathHull const & inset)
if (inset.isBufferValid())
encoding = &(inset.buffer().params().encoding());
otexrowstream ots(ls);
WriteStream wi(ots, false, true, WriteStream::wsPreview, encoding);
TeXMathStream wi(ots, false, true, TeXMathStream::wsPreview, encoding);
inset.write(wi);
return ls.str();
}
@ -1122,7 +1122,7 @@ CtObject InsetMathHull::getCtObject(OutputParams const & runparams) const
}
void InsetMathHull::header_write(WriteStream & os) const
void InsetMathHull::header_write(TeXMathStream & os) const
{
bool n = numberedType();
@ -1188,7 +1188,7 @@ void InsetMathHull::header_write(WriteStream & os) const
}
void InsetMathHull::footer_write(WriteStream & os) const
void InsetMathHull::footer_write(TeXMathStream & os) const
{
bool n = numberedType();
@ -1698,7 +1698,7 @@ docstring InsetMathHull::eolString(row_type row, bool fragile, bool latex,
return res + InsetMathGrid::eolString(row, fragile, latex, last_eoln);
}
void InsetMathHull::write(WriteStream & os) const
void InsetMathHull::write(TeXMathStream & os) const
{
ModeSpecifier specifier(os, MATH_MODE);
header_write(os);
@ -2304,7 +2304,7 @@ void InsetMathHull::write(ostream & os) const
{
odocstringstream oss;
otexrowstream ots(oss);
WriteStream wi(ots, false, false, WriteStream::wsDefault);
TeXMathStream wi(ots, false, false, TeXMathStream::wsDefault);
oss << "Formula ";
write(wi);
os << to_utf8(oss.str());
@ -2348,7 +2348,7 @@ int InsetMathHull::plaintext(odocstringstream & os,
odocstringstream oss;
otexrowstream ots(oss);
Encoding const * const enc = encodings.fromLyXName("utf8");
WriteStream wi(ots, false, true, WriteStream::wsDefault, enc);
TeXMathStream wi(ots, false, true, TeXMathStream::wsDefault, enc);
// Fix Bug #6139
if (type_ == hullRegexp)
@ -2415,7 +2415,7 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
// Workaround for db2latex: db2latex always includes equations with
// \ensuremath{} or \begin{display}\end{display}
// so we strip LyX' math environment
WriteStream wi(ols, false, false, WriteStream::wsDefault, runparams.encoding);
TeXMathStream wi(ols, false, false, TeXMathStream::wsDefault, runparams.encoding);
InsetMathGrid::write(wi);
ms << from_utf8(subst(subst(to_utf8(ls.str()), "&", "&amp;"), "<", "&lt;"));
ms << "</" << from_ascii("alt") << ">";
@ -2541,7 +2541,7 @@ void InsetMathHull::mathmlize(MathMLStream & ms) const
}
void InsetMathHull::mathAsLatex(WriteStream & os) const
void InsetMathHull::mathAsLatex(TeXMathStream & os) const
{
MathEnsurer ensurer(os, false);
bool havenumbers = haveNumbers();
@ -2677,7 +2677,7 @@ docstring InsetMathHull::xhtml(XMLStream & xs, OutputParams const & op) const
// $...$ or whatever.
odocstringstream ls;
otexrowstream ots(ls);
WriteStream wi(ots, false, true, WriteStream::wsPreview);
TeXMathStream wi(ots, false, true, TeXMathStream::wsPreview);
ModeSpecifier specifier(wi, MATH_MODE);
mathAsLatex(wi);
docstring const latex = ls.str();

View File

@ -124,7 +124,7 @@ public:
char displayColAlign(idx_type idx) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///
@ -133,9 +133,9 @@ public:
///
void write(std::ostream & os) const override;
///
void header_write(WriteStream &) const;
void header_write(TeXMathStream &) const;
///
void footer_write(WriteStream &) const;
void footer_write(TeXMathStream &) const;
///
void read(Lexer & lex) override;
///
@ -152,7 +152,7 @@ public:
///
void htmlize(HtmlStream &) const override;
///
void mathAsLatex(WriteStream &) const;
void mathAsLatex(TeXMathStream &) const;
///
void toString(odocstream &) const override;
///

View File

@ -57,7 +57,7 @@ void InsetMathKern::draw(PainterInfo &, int, int) const
{}
void InsetMathKern::write(WriteStream & os) const
void InsetMathKern::write(TeXMathStream & os) const
{
if (wid_.empty())
os << "\\kern" << ' ';

View File

@ -36,7 +36,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream & ns) const override;
///

View File

@ -71,7 +71,7 @@ void InsetMathLim::mathematica(MathematicaStream & os) const
}
void InsetMathLim::write(WriteStream &) const
void InsetMathLim::write(TeXMathStream &) const
{
LYXERR0("should not happen");
}

View File

@ -40,7 +40,7 @@ public:
///
void mathematica(MathematicaStream &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
InsetCode lyxCode() const override { return MATH_LIM_CODE; }

View File

@ -1133,7 +1133,7 @@ bool InsetMathMacro::folded() const
}
void InsetMathMacro::write(WriteStream & os) const
void InsetMathMacro::write(TeXMathStream & os) const
{
mode_type mode = currentMode();
MathEnsurer ensurer(os, mode == MATH_MODE, true, mode == TEXT_MODE);

View File

@ -95,7 +95,7 @@ public:
mode_type currentMode() const override;
/// Assumes that macros are up-to-date
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream & os) const override;
///

View File

@ -28,7 +28,7 @@ Inset * InsetMathHash::clone() const
}
void InsetMathHash::write(WriteStream & os) const
void InsetMathHash::write(TeXMathStream & os) const
{
os << str_;
}

View File

@ -32,7 +32,7 @@ public:
///
void normalize(NormalStream &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
private:
Inset * clone() const override;

View File

@ -1170,20 +1170,20 @@ void InsetMathMacroTemplate::write(ostream & os) const
{
odocstringstream oss;
otexrowstream ots(oss);
WriteStream wi(ots, false, false, WriteStream::wsDefault);
TeXMathStream wi(ots, false, false, TeXMathStream::wsDefault);
oss << "FormulaMacro\n";
write(wi);
os << to_utf8(oss.str());
}
void InsetMathMacroTemplate::write(WriteStream & os) const
void InsetMathMacroTemplate::write(TeXMathStream & os) const
{
write(os, false);
}
int InsetMathMacroTemplate::write(WriteStream & os, bool overwriteRedefinition) const
int InsetMathMacroTemplate::write(TeXMathStream & os, bool overwriteRedefinition) const
{
int num_lines = 0;

View File

@ -47,10 +47,10 @@ public:
///
void write(std::ostream & os) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// Output LaTeX code, but assume that the macro is not defined yet
/// if overwriteRedefinition is true
int write(WriteStream & os, bool overwriteRedefinition) const;
int write(TeXMathStream & os, bool overwriteRedefinition) const;
/// Nothing happens. This is simply to suppress the default output.
docstring xhtml(XMLStream &, OutputParams const &) const override;
///

View File

@ -32,7 +32,7 @@ Inset * InsetMathMatrix::clone() const
}
void InsetMathMatrix::write(WriteStream & os) const
void InsetMathMatrix::write(TeXMathStream & os) const
{
InsetMathGrid::write(os);
}

View File

@ -30,7 +30,7 @@ public:
InsetMathMatrix const * asMatrixInset() const override { return this; }
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///

View File

@ -255,7 +255,7 @@ void InsetMathNest::dump() const
{
odocstringstream oss;
otexrowstream ots(oss);
WriteStream os(ots);
TeXMathStream os(ots);
os << "---------------------------------------------\n";
write(os);
os << "\n";
@ -326,7 +326,7 @@ MathData InsetMathNest::glue() const
}
void InsetMathNest::write(WriteStream & os) const
void InsetMathNest::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os, currentMode() == MATH_MODE);
ModeSpecifier specifier(os, currentMode(), lockedMode());
@ -358,16 +358,16 @@ void InsetMathNest::normalize(NormalStream & os) const
void InsetMathNest::latex(otexstream & os, OutputParams const & runparams) const
{
WriteStream wi(os, runparams.moving_arg, true,
runparams.dryrun ? WriteStream::wsDryrun : WriteStream::wsDefault,
runparams.encoding);
TeXMathStream wi(os, runparams.moving_arg, true,
runparams.dryrun ? TeXMathStream::wsDryrun : TeXMathStream::wsDefault,
runparams.encoding);
wi.strikeoutMath(runparams.inDeletedInset);
if (runparams.inulemcmd) {
wi.ulemCmd(WriteStream::UNDERLINE);
wi.ulemCmd(TeXMathStream::UNDERLINE);
if (runparams.local_font) {
FontInfo f = runparams.local_font->fontInfo();
if (f.strikeout() == FONT_ON)
wi.ulemCmd(WriteStream::STRIKEOUT);
wi.ulemCmd(TeXMathStream::STRIKEOUT);
}
}
wi.canBreakLine(os.canBreakLine());

View File

@ -104,7 +104,7 @@ public:
void dump() const override;
/// writes \\, name(), and args in braces and '\\lyxlock' if necessary
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// writes [, name(), and args in []
void normalize(NormalStream & os) const override;
///

View File

@ -82,7 +82,7 @@ void InsetMathNumber::htmlize(HtmlStream & os) const
}
void InsetMathNumber::write(WriteStream & os) const
void InsetMathNumber::write(TeXMathStream & os) const
{
os << str_;
}

View File

@ -47,7 +47,7 @@ public:
///
void htmlize(HtmlStream &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
InsetCode lyxCode() const override { return MATH_NUMBER_CODE; }

View File

@ -88,7 +88,7 @@ bool InsetMathOverset::idxLast(Cursor & cur) const
}
void InsetMathOverset::write(WriteStream & os) const
void InsetMathOverset::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
if (os.fragile())

View File

@ -34,7 +34,7 @@ public:
///
bool idxLast(Cursor &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///

View File

@ -42,7 +42,7 @@ void InsetMathPar::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathPar::write(WriteStream & os) const
void InsetMathPar::write(TeXMathStream & os) const
{
for (idx_type i = 0; i < nargs(); ++i)
os << cell(i) << "\n";

View File

@ -33,7 +33,7 @@ public:
///
void infoize(odocstream & os) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
InsetCode lyxCode() const override { return MATH_PAR_CODE; }

View File

@ -249,7 +249,7 @@ void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathPhantom::write(WriteStream & os) const
void InsetMathPhantom::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
if (os.fragile())

View File

@ -38,7 +38,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream & ns) const override;
///

View File

@ -29,7 +29,7 @@ public:
///
void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
///
//void write(WriteStream & os) const override;
//void write(TeXMathStream & os) const override;
///
void infoize(odocstream & os) const override;
///

View File

@ -132,7 +132,7 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathRoot::write(WriteStream & os) const
void InsetMathRoot::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\sqrt[" << cell(1) << "]{" << cell(0) << '}';

View File

@ -41,7 +41,7 @@ public:
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///

View File

@ -505,7 +505,7 @@ bool InsetMathScript::idxUpDown(Cursor & cur, bool up) const
}
void InsetMathScript::write(WriteStream & os) const
void InsetMathScript::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);

View File

@ -57,7 +57,7 @@ public:
size_type lastIdx() const override { return 0; }
/// write LaTeX and Lyx code
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream &) const override;
/// write content as something readable by Maple

View File

@ -334,7 +334,7 @@ bool InsetMathSideset::idxUpDown(Cursor & cur, bool up) const
}
void InsetMathSideset::write(WriteStream & os) const
void InsetMathSideset::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);

View File

@ -50,7 +50,7 @@ public:
size_type lastIdx() const override { return 0; }
/// write LaTeX and Lyx code
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// write normalized content
void normalize(NormalStream &) const override;
/// write content as MathML

View File

@ -59,7 +59,7 @@ void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathSize::write(WriteStream & os) const
void InsetMathSize::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "{\\" << key_->name << ' ' << cell(0) << '}';

View File

@ -35,7 +35,7 @@ public:
void draw(PainterInfo &, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///

View File

@ -266,7 +266,7 @@ void InsetMathSpace::normalize(NormalStream & os) const
}
void InsetMathSpace::write(WriteStream & os) const
void InsetMathSpace::write(TeXMathStream & os) const
{
// All kinds work in text and math mode, so simply suspend
// writing a possibly pending mode closing brace.

View File

@ -56,7 +56,7 @@ public:
///
void htmlize(HtmlStream & ms) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
/// generate something that will be understood by the Dialogs.
InsetSpaceParams params() const;
///

View File

@ -91,7 +91,7 @@ void InsetMathSpecialChar::drawT(TextPainter & pain, int x, int y) const
}
void InsetMathSpecialChar::write(WriteStream & os) const
void InsetMathSpecialChar::write(TeXMathStream & os) const
{
os << '\\' << name_;
if (name_.size() != 1)

View File

@ -35,7 +35,7 @@ public:
///
int kerning(BufferView const *) const override { return kerning_; }
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void validate(LaTeXFeatures & features) const override;
///

View File

@ -142,7 +142,7 @@ bool InsetMathSplit::getStatus(Cursor & cur, FuncRequest const & cmd,
}
void InsetMathSplit::write(WriteStream & ws) const
void InsetMathSplit::write(TeXMathStream & ws) const
{
MathEnsurer ensurer(ws);
if (ws.fragile())

View File

@ -31,7 +31,7 @@ public:
bool getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const override;
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void infoize(odocstream & os) const override;
///

View File

@ -69,7 +69,7 @@ void InsetMathSqrt::drawT(TextPainter & /*pain*/, int /*x*/, int /*y*/) const
}
void InsetMathSqrt::write(WriteStream & os) const
void InsetMathSqrt::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\sqrt{" << cell(0) << '}';

View File

@ -34,7 +34,7 @@ public:
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///

View File

@ -122,7 +122,7 @@ void InsetMathStackrel::draw(PainterInfo & pi, int x, int y) const
}
void InsetMathStackrel::write(WriteStream & os) const
void InsetMathStackrel::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\stackrel";

View File

@ -34,7 +34,7 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
void normalize(NormalStream &) const override;
///

View File

@ -101,7 +101,7 @@ void InsetMathString::mathmlize(MathMLStream &) const
}
void InsetMathString::write(WriteStream & os) const
void InsetMathString::write(TeXMathStream & os) const
{
writeString(str_, os);
}

View File

@ -49,7 +49,7 @@ public:
///
void mathmlize(MathMLStream &) const override;
///
void write(WriteStream & os) const override;
void write(TeXMathStream & os) const override;
///
InsetCode lyxCode() const override { return MATH_STRING_CODE; }

Some files were not shown because too many files have changed in this diff Show More