}
-docstring InsetMath::mathmlize(MathStream & os) const
+void InsetMath::mathmlize(MathStream & os) const
{
os << MTag("mi");
NormalStream ns(os.os());
normalize(ns);
os << ETag("mi");
- return docstring();
}
/// write content as something readable by Mathematica
virtual void mathematica(MathematicaStream &) const;
/// write content as something resembling MathML
- virtual docstring mathmlize(MathStream &) const;
+ virtual void mathmlize(MathStream &) const;
/// write content as something readable by Octave
virtual void octave(OctaveStream &) const;
}
-docstring InsetMathBig::mathmlize(MathStream & os) const
+void InsetMathBig::mathmlize(MathStream & os) const
{
os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true'>";
if (delim_ == "(" || delim_ == ")"
else if (delim_ == "\\Updownarrow")
os << "⇕";
os << "</mo>";
- return docstring();;
}
///
void normalize(NormalStream & os) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void infoize2(odocstream & os) const;
///
}
-docstring InsetMathBox::mathmlize(MathStream & ms) const
+void InsetMathBox::mathmlize(MathStream & ms) const
{
// FIXME This doesn't actually work yet. We need to be able to signal
// that we are in text mode and then just call ms << cell(0). So we
ms << MTag("mtext");
ms.os() << cell(0);
ms << ETag("mtext");
- return docstring();
}
///
void normalize(NormalStream & ns) const;
///
- docstring mathmlize(MathStream & ms) const;
+ void mathmlize(MathStream & ms) const;
///
void infoize(odocstream & os) const;
///
/// write normalized content
void normalize(NormalStream & ns) const;
///
- //docstring mathmlize(MathStream & ms) const;
+ //void mathmlize(MathStream & ms) const;
///
void infoize(odocstream & os) const;
private:
/// write normalized content
void normalize(NormalStream & ns) const;
///
- //docstring mathmlize(MathStream & ms) const;
+ //void mathmlize(MathStream & ms) const;
///
mode_type currentMode() const { return TEXT_MODE; }
///
///
void write(WriteStream & os) const;
///
- //docstring mathmlize(MathStream & ms) const;
+ //void mathmlize(MathStream & ms) const;
/// write normalized content
void normalize(NormalStream & ns) const;
///
#include "InsetMathBrace.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "MathSupport.h"
#include "MetricsInfo.h"
}
-docstring InsetMathBrace::mathmlize(MathStream & os) const
+void InsetMathBrace::mathmlize(MathStream & os) const
{
- os << MTag("mrow");
- docstring const rv = lyx::mathmlize(cell(0), os);
- os << ETag("mrow");
- return rv;
+ os << MTag("mrow") << cell(0) << ETag("mrow");
}
///
void octave(OctaveStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void infoize(odocstream & os) const;
///
// mathalpha, then we'll treat it as an identifier, otherwise as an
// operator.
// Worst case: We get bad spacing, or bad italics.
-docstring InsetMathChar::mathmlize(MathStream & ms) const
+void InsetMathChar::mathmlize(MathStream & ms) const
{
switch (char_) {
- case '<': ms << "<mo><</mo>"; return docstring();
- case '>': ms << "<mo>></mo>"; return docstring();
- case '&': ms << "<mo>&</mo>"; return docstring();
+ case '<': ms << "<mo><</mo>"; return;
+ case '>': ms << "<mo>></mo>"; return;
+ case '&': ms << "<mo>&</mo>"; return;
default: break;
}
? "mi" : "mo";
// we don't use MTag and ETag because we do not want the spacing
ms << "<" << type << ">" << char(char_) << "</" << type << ">";
- return docstring();
}
///
void octave(OctaveStream & os) const;
///
- docstring mathmlize(MathStream & ms) const;
+ void mathmlize(MathStream & ms) const;
/// identifies Charinsets
InsetMathChar const * asCharInset() const { return this; }
///
{}
-docstring InsetMathComment::mathmlize(MathStream & os) const
+void InsetMathComment::mathmlize(MathStream & os) const
{
os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
- return docstring();
}
///
void octave(OctaveStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void infoize(odocstream & os) const;
///
#include "InsetMathDecoration.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathParser.h"
#include "MathSupport.h"
#include "MathStream.h"
}
}
-docstring InsetMathDecoration::mathmlize(MathStream & os) const
+void InsetMathDecoration::mathmlize(MathStream & os) const
{
Translator const & t = translator();
Translator::const_iterator cur = t.find(to_utf8(key_->name));
- LASSERT(cur != t.end(), return docstring());
+ LASSERT(cur != t.end(), return);
char const * const outag = cur->second.over ? "mover" : "munder";
- os << MTag(outag) << MTag("mrow");
- docstring const rv = lyx::mathmlize(cell(0), os);
- os << ETag("mrow")
+ os << MTag(outag)
+ << MTag("mrow") << cell(0) << ETag("mrow")
<< from_ascii("<mo stretchy=\"true\">" + cur->second.tag + "</mo>")
<< ETag(outag);
- return rv;
}
///
InsetCode lyxCode() const { return MATH_DECORATION_CODE; }
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
private:
virtual Inset * clone() const;
#include "InsetMathDelim.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "MathSupport.h"
#include "MetricsInfo.h"
}
-docstring InsetMathDelim::mathmlize(MathStream & os) const
+void InsetMathDelim::mathmlize(MathStream & os) const
{
- os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true'>" << left_ << "</mo>";
- docstring const rv = lyx::mathmlize(cell(0),os);
- os << "<mo form='postfix' fence='true' stretchy='true' symmetric='true'>" << right_ << "</mo>";
- return rv;
+ os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true'>" << left_ << "</mo>"
+ << cell(0) << "<mo form='postfix' fence='true' stretchy='true' symmetric='true'>" << right_ << "</mo>";
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
///
#include "InsetMathDiff.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "support/debug.h"
}
-docstring InsetMathDiff::mathmlize(MathStream & os) const
+void InsetMathDiff::mathmlize(MathStream & os) const
{
os << "diff(";
- docstring rv;
for (idx_type idx = 0; idx < nargs(); ++idx) {
if (idx != 0)
os << ',';
- rv += lyx::mathmlize(cell(idx), os);
+ os << cell(idx);
}
os << ')';
- return rv;
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void maxima(MaximaStream &) const;
///
}
-docstring InsetMathDots::mathmlize(MathStream & os) const
+void InsetMathDots::mathmlize(MathStream & os) const
{
// which symbols we support is decided by what is listed in
// lib/symbols as generating a dots inset
else
LASSERT(false, ent = "…");
os << MTag("mi") << from_ascii(ent) << ETag("mi");
- return docstring();
}
} // namespace lyx
///
InsetCode lyxCode() const { return MATH_DOTS_CODE; }
///
- docstring mathmlize(MathStream & os) const;
+ void mathmlize(MathStream & os) const;
protected:
/// cache for the thing's height
mutable int dh_;
#include "InsetMathEnsureMath.h"
-#include "MathExtern.h"
-#include "MathData.h"
#include "MathStream.h"
+#include "MathData.h"
#include <ostream>
}
-docstring InsetMathEnsureMath::mathmlize(MathStream & os) const
+void InsetMathEnsureMath::mathmlize(MathStream & os) const
{
- return lyx::mathmlize(cell(0), os);
+ os << cell(0);
}
///
void write(WriteStream & os) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void infoize(odocstream & os) const;
///
#include "InsetMathExFunc.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "MathSupport.h"
#include "MetricsInfo.h"
}
-docstring InsetMathExFunc::mathmlize(MathStream & os) const
+void InsetMathExFunc::mathmlize(MathStream & os) const
{
os << "<mi>" << name_ << "</mi><mo>⁡</mo>";
- return lyx::mathmlize(cell(0), os);
+ os << cell(0);
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
///
#include "InsetMathExInt.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "MathStream.h"
#include "InsetMathSymbol.h"
}
-docstring InsetMathExInt::mathmlize(MathStream & os) const
+void InsetMathExInt::mathmlize(MathStream & os) const
{
// At the moment, we are not extracting sums and the like for MathML.
// If we should decide to do so later, then we'll need to re-merge
os << ETag("msub");
else if (upper)
os << ETag("msup");
- docstring rv = lyx::mathmlize(cell(0), os);
- os << "<mo> ⁢ </mo>"
+ os << cell(0) << "<mo> ⁢ </mo>"
<< MTag("mrow") << "<mo> ⅆ </mo>"
<< cell(1) << ETag("mrow");
- return rv;
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void write(WriteStream & os) const;
///
#include "Cursor.h"
#include "LaTeXFeatures.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "MathSupport.h"
#include "MetricsInfo.h"
}
-docstring InsetMathFrac::mathmlize(MathStream & os) const
+void InsetMathFrac::mathmlize(MathStream & os) const
{
- os << MTag("mfrac") << MTag("mrow");
- docstring rv = lyx::mathmlize(cell(0), os);
- os << ETag("mrow") << MTag("mrow");
- rv += lyx::mathmlize(cell(1), os);
- os << ETag("mrow") << ETag("mfrac");
- return rv;
+ os << MTag("mfrac")
+ << MTag("mrow") << cell(0) << ETag("mrow")
+ << MTag("mrow") << cell(1) << ETag("mrow")
+ << ETag("mfrac");
}
}
-docstring InsetMathBinom::mathmlize(MathStream & os) const
+void InsetMathBinom::mathmlize(MathStream & os) const
{
- // FIXME This all needs fixing
switch (kind_) {
case BINOM:
os << MTag("mbinom") << cell(0) << cell(1) << ETag("mbinom");
os << MTag("mdbinom") << cell(0) << cell(1) << ETag("mdbinom");
break;
}
- return docstring();
}
///
void octave(OctaveStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void validate(LaTeXFeatures & features) const;
public:
///
bool extraBraces() const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void validate(LaTeXFeatures & features) const;
///
#include "InsetMathGrid.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathParser.h"
#include "MathStream.h"
#include "MetricsInfo.h"
}
-docstring InsetMathGrid::mathmlize(MathStream & os) const
+void InsetMathGrid::mathmlize(MathStream & os) const
{
bool const havetable = nrows() > 1;
if (havetable)
os << MTag("mtable");
- docstring rv;
for (row_type row = 0; row < nrows(); ++row) {
os << MTag("mrow");
for (col_type col = 0; col < ncols(); ++col)
- rv += lyx::mathmlize(cell(index(row, col)), os);
+ os << cell(index(row, col));
os << ETag("mrow");
}
if (havetable)
os << ETag("mtable");
- return rv;
}
///
//void maple(MapleStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
//void octave(OctaveStream &) const;
}
-docstring InsetMathHull::mathmlize(MathStream & os) const
+void InsetMathHull::mathmlize(MathStream & os) const
{
- return InsetMathGrid::mathmlize(os);
+ InsetMathGrid::mathmlize(os);
}
xs << StartTag("math",
"display=\"block\" xmlns=\"http://www.w3.org/1998/Math/MathML\"", true);
MathStream ms(xs.os());
- docstring const rv = InsetMathGrid::mathmlize(ms);
+ InsetMathGrid::mathmlize(ms);
xs << EndTag("math");
- return rv;
+ return docstring();
}
///
void write(WriteStream & os) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void normalize(NormalStream &) const;
///
}
-docstring InsetMathKern::mathmlize(MathStream &) const
-{
- return docstring();
-}
-
-
} // namespace lyx
///
void normalize(NormalStream & ns) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const { }
///
InsetCode lyxCode() const { return MATH_KERN_CODE; }
#include "InsetMathLim.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "support/debug.h"
}
-docstring InsetMathLim::mathmlize(MathStream & os) const
+void InsetMathLim::mathmlize(MathStream & os) const
{
// FIXME XHTML We need a form of MTag that takes attributes.
os << "<munder>"
<< "<mo form='prefix'>" << "lim" << "</mo>"
- << "<mrow>" << cell(1) << "<mo>→</mo>" << cell(2)
- << "</mrow></munder>" << "<mo>(</mo>";
- docstring const rv = lyx::mathmlize(cell(0), os);
- os << "<mo>)</mo>";
- return rv;
+ << "<mrow>" << cell(1) << "<mo>→</mo>" << cell(2) << "</mrow></munder>"
+ << "<mo>(</mo>" << cell(0) << "<mo>)</mo>" ;
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void write(WriteStream & os) const;
///
#include "InsetMathMatrix.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
}
-docstring InsetMathMatrix::mathmlize(MathStream & os) const
+void InsetMathMatrix::mathmlize(MathStream & os) const
{
os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>"
<< left_ << "</mo>";
os << MTag("mtable");
- docstring rv;
for (row_type row = 0; row < nrows(); ++row) {
os << MTag("mtr");
- for (col_type col = 0; col < ncols(); ++col) {
- os << MTag("mtd");
- rv += lyx::mathmlize(cell(index(row, col)), os);
- os << ETag("mtd");
- }
+ for (col_type col = 0; col < ncols(); ++col)
+ os << MTag("mtd") << cell(index(row, col)) << ETag("mtd");
os << ETag("mtr");
}
os << ETag("mtable");
os << "<mo form='postfix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>"
<< right_ << "</mo>";
- return rv;
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
///
}
-docstring InsetMathNumber::mathmlize(MathStream & os) const
+void InsetMathNumber::mathmlize(MathStream & os) const
{
os << "<mn> " << str_ << " </mn>";
- return docstring();
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void write(WriteStream & os) const;
///
#include "InsetMathRoot.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "Cursor.h"
}
-docstring InsetMathRoot::mathmlize(MathStream & os) const
+void InsetMathRoot::mathmlize(MathStream & os) const
{
- os << MTag("mroot");
- docstring rv = lyx::mathmlize(cell(1), os);
- rv += lyx::mathmlize(cell(0), os);
- os << ETag("mroot");
- return rv;
+ os << MTag("mroot") << cell(1) << cell(0) << ETag("mroot");
}
///
void normalize(NormalStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void maple(MapleStream &) const;
///
#include "InsetMathScript.h"
#include "InsetMathSymbol.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "MathSupport.h"
// It may be worth trying to output munder, mover, and munderover
// in certain cases, e.g., for display formulas. But then we would
// need to know if we're in a display formula.
-docstring InsetMathScript::mathmlize(MathStream & os) const
+void InsetMathScript::mathmlize(MathStream & os) const
{
bool d = hasDown() && down().size();
bool u = hasUp() && up().size();
else if (d)
os << MTag("msub");
- docstring rv;
- if (nuc().size()) {
- os << MTag("mrow");
- rv = lyx::mathmlize(nuc(), os);
- os << ETag("mrow");
- } else
+ if (nuc().size())
+ os << MTag("mrow") << nuc() << ETag("mrow");
+ else
os << "<mrow />";
if (u && d)
os << MTag("mrow") << up() << ETag("mrow") << ETag("msup");
else if (d)
os << MTag("mrow") << down() << ETag("mrow") << ETag("msub");
- return rv;
}
/// write content as something readable by Mathematica
void mathematica(MathematicaStream &) const;
/// write content as something resembling MathML
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
/// write content as something readable by Octave
void octave(OctaveStream &) const;
}
-docstring InsetMathSpace::mathmlize(MathStream & ms) const
+void InsetMathSpace::mathmlize(MathStream & ms) const
{
SpaceInfo const & si = space_info[space_];
if (si.negative || !si.visible)
- return docstring();
+ return;
string l;
if (si.custom)
l = length_.asHTMLString();
if (!l.empty())
ms << " width=\"" << from_ascii(l) << "\"";
ms << " />";
- return docstring();
}
///
void octave(OctaveStream &) const;
///
- docstring mathmlize(MathStream & ms) const;
+ void mathmlize(MathStream & ms) const;
///
void write(WriteStream & os) const;
/// generate something that will be understood by the Dialogs.
}
-docstring InsetMathSpecialChar::mathmlize(MathStream & ms) const
+void InsetMathSpecialChar::mathmlize(MathStream & ms) const
{
switch (char_) {
case '&':
ms.os().put(char_);
break;
}
- return docstring();
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream & ms) const;
+ void mathmlize(MathStream & ms) const;
/// identifies SpecialChar insets
InsetMathSpecialChar const * asSpecialCharInset() const { return this; }
///
#include "InsetMathSqrt.h"
#include "MathData.h"
-#include "MathExtern.h"
#include "MathStream.h"
#include "TextPainter.h"
#include "frontends/Painter.h"
}
-docstring InsetMathSqrt::mathmlize(MathStream & os) const
+void InsetMathSqrt::mathmlize(MathStream & os) const
{
- os << MTag("msqrt");
- docstring const rv = lyx::mathmlize(cell(0), os);
- os << ETag("msqrt");
- return rv;
+ os << MTag("msqrt") << cell(0) << ETag("msqrt");
}
///
void octave(OctaveStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
InsetCode lyxCode() const { return MATH_SQRT_CODE; }
}
+void InsetMathString::mathmlize(MathStream & /*os*/) const
+{
+ // useless, no doubt, but we should not be here
+ LASSERT(false, /* */);
+}
+
+
void InsetMathString::write(WriteStream & os) const
{
if (!os.latex() || os.lockedMode()) {
///
void mathematica(MathematicaStream &) const;
///
+ void mathmlize(MathStream &) const;
+ ///
void write(WriteStream & os) const;
///
InsetCode lyxCode() const { return MATH_STRING_CODE; }
}
-docstring InsetMathSymbol::mathmlize(MathStream & os) const
+void InsetMathSymbol::mathmlize(MathStream & os) const
{
// FIXME To get this working properly, we need to do add the
// XML entity definitions to lib/symbols. And probably do more
else
os << sym_->xmlname;
os << " </" << type << '>';
- return docstring();
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
///
}
-docstring InsetMathUnknown::mathmlize(MathStream & os) const
+void InsetMathUnknown::mathmlize(MathStream & os) const
{
os << MTag("mi") << name_ << ETag("mi");
- return docstring();
}
///
void mathematica(MathematicaStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
///
}
-docstring mathmlize(MathData const & dat, MathStream & os)
+void mathmlize(MathData const & dat, MathStream & os)
{
MathData ar = dat;
extractStructure(ar, MATHML);
- docstring retval;
if (ar.size() == 0)
os << "<mrow/>";
else if (ar.size() == 1)
- retval = ar.front()->mathmlize(os);
+ os << ar.front();
else {
os << MTag("mrow");
for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it)
- retval += (*it)->mathmlize(os);
+ (*it)->mathmlize(os);
os << ETag("mrow");
}
- return retval;
}
// convert this inset somehow to a number
void maple(MathData const &, MapleStream &);
void maxima(MathData const &, MaximaStream &);
void mathematica(MathData const &, MathematicaStream &);
-docstring mathmlize(MathData const &, MathStream &);
+void mathmlize(MathData const &, MathStream &);
void octave(MathData const &, OctaveStream &);
bool extractNumber(MathData const & ar, int & i);
}
// FIXME Other external things need similar treatment.
///
- docstring mathmlize(MathStream & ms) const {
- ms << mathMacro_.cell(idx_);
- return docstring();
- }
+ void mathmlize(MathStream & ms) const { ms << mathMacro_.cell(idx_); }
///
void draw(PainterInfo & pi, int x, int y) const {
if (mathMacro_.editMetrics(pi.base.bv)) {
}
-docstring MathMacro::mathmlize(MathStream & os) const
+void MathMacro::mathmlize(MathStream & os) const
{
os << expanded_.cell(0);
- return docstring();
}
///
void maple(MapleStream &) const;
///
- docstring mathmlize(MathStream &) const;
+ void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
///