From: Richard Heck Date: Thu, 31 Dec 2009 15:46:39 +0000 (+0000) Subject: Revert r32684, per Andre's suggestion. X-Git-Tag: 2.0.0~4664 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c060a85d811674888c31db9ee0407d8b5cc37b6e;p=features.git Revert r32684, per Andre's suggestion. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32689 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index a5cd28a284..0a9772c676 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -120,13 +120,12 @@ void InsetMath::mathematica(MathematicaStream & os) const } -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(); } diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h index 12ea7ab06c..555762c8c7 100644 --- a/src/mathed/InsetMath.h +++ b/src/mathed/InsetMath.h @@ -187,7 +187,7 @@ public: /// 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; diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp index 128cade0d6..463b628dbe 100644 --- a/src/mathed/InsetMathBig.cpp +++ b/src/mathed/InsetMathBig.cpp @@ -102,7 +102,7 @@ void InsetMathBig::normalize(NormalStream & os) const } -docstring InsetMathBig::mathmlize(MathStream & os) const +void InsetMathBig::mathmlize(MathStream & os) const { os << ""; if (delim_ == "(" || delim_ == ")" @@ -146,7 +146,6 @@ docstring InsetMathBig::mathmlize(MathStream & os) const else if (delim_ == "\\Updownarrow") os << "⇕"; os << ""; - return docstring();; } diff --git a/src/mathed/InsetMathBig.h b/src/mathed/InsetMathBig.h index 8049b9460a..e6df71fd1c 100644 --- a/src/mathed/InsetMathBig.h +++ b/src/mathed/InsetMathBig.h @@ -35,7 +35,7 @@ public: /// void normalize(NormalStream & os) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void infoize2(odocstream & os) const; /// diff --git a/src/mathed/InsetMathBox.cpp b/src/mathed/InsetMathBox.cpp index 701a0bb634..d432794fc0 100644 --- a/src/mathed/InsetMathBox.cpp +++ b/src/mathed/InsetMathBox.cpp @@ -52,7 +52,7 @@ void InsetMathBox::normalize(NormalStream & 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 @@ -60,7 +60,6 @@ docstring InsetMathBox::mathmlize(MathStream & ms) const ms << MTag("mtext"); ms.os() << cell(0); ms << ETag("mtext"); - return docstring(); } diff --git a/src/mathed/InsetMathBox.h b/src/mathed/InsetMathBox.h index 03d2da9f9e..4ef299401d 100644 --- a/src/mathed/InsetMathBox.h +++ b/src/mathed/InsetMathBox.h @@ -35,7 +35,7 @@ public: /// void normalize(NormalStream & ns) const; /// - docstring mathmlize(MathStream & ms) const; + void mathmlize(MathStream & ms) const; /// void infoize(odocstream & os) const; /// @@ -66,7 +66,7 @@ public: /// write normalized content void normalize(NormalStream & ns) const; /// - //docstring mathmlize(MathStream & ms) const; + //void mathmlize(MathStream & ms) const; /// void infoize(odocstream & os) const; private: @@ -89,7 +89,7 @@ public: /// 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; } /// @@ -116,7 +116,7 @@ public: /// void write(WriteStream & os) const; /// - //docstring mathmlize(MathStream & ms) const; + //void mathmlize(MathStream & ms) const; /// write normalized content void normalize(NormalStream & ns) const; /// diff --git a/src/mathed/InsetMathBrace.cpp b/src/mathed/InsetMathBrace.cpp index 4bf24dfb81..c1034c9aee 100644 --- a/src/mathed/InsetMathBrace.cpp +++ b/src/mathed/InsetMathBrace.cpp @@ -13,7 +13,6 @@ #include "InsetMathBrace.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "MathSupport.h" #include "MetricsInfo.h" @@ -95,12 +94,9 @@ void InsetMathBrace::octave(OctaveStream & os) const } -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"); } diff --git a/src/mathed/InsetMathBrace.h b/src/mathed/InsetMathBrace.h index 6af0ca32b0..e8e3ea9557 100644 --- a/src/mathed/InsetMathBrace.h +++ b/src/mathed/InsetMathBrace.h @@ -46,7 +46,7 @@ public: /// void octave(OctaveStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void infoize(odocstream & os) const; /// diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp index 27093e8504..8e02c6a92c 100644 --- a/src/mathed/InsetMathChar.cpp +++ b/src/mathed/InsetMathChar.cpp @@ -165,12 +165,12 @@ void InsetMathChar::octave(OctaveStream & 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 << "<"; return docstring(); - case '>': ms << ">"; return docstring(); - case '&': ms << "&"; return docstring(); + case '<': ms << "<"; return; + case '>': ms << ">"; return; + case '&': ms << "&"; return; default: break; } @@ -179,7 +179,6 @@ docstring InsetMathChar::mathmlize(MathStream & ms) const ? "mi" : "mo"; // we don't use MTag and ETag because we do not want the spacing ms << "<" << type << ">" << char(char_) << ""; - return docstring(); } diff --git a/src/mathed/InsetMathChar.h b/src/mathed/InsetMathChar.h index d1a865fc15..6dba328c4e 100644 --- a/src/mathed/InsetMathChar.h +++ b/src/mathed/InsetMathChar.h @@ -41,7 +41,7 @@ public: /// void octave(OctaveStream & os) const; /// - docstring mathmlize(MathStream & ms) const; + void mathmlize(MathStream & ms) const; /// identifies Charinsets InsetMathChar const * asCharInset() const { return this; } /// diff --git a/src/mathed/InsetMathComment.cpp b/src/mathed/InsetMathComment.cpp index 92693a2c7e..ebfba7a859 100644 --- a/src/mathed/InsetMathComment.cpp +++ b/src/mathed/InsetMathComment.cpp @@ -86,10 +86,9 @@ void InsetMathComment::octave(OctaveStream &) const {} -docstring InsetMathComment::mathmlize(MathStream & os) const +void InsetMathComment::mathmlize(MathStream & os) const { os << MTag("comment") << cell(0) << cell(1) << ETag("comment"); - return docstring(); } diff --git a/src/mathed/InsetMathComment.h b/src/mathed/InsetMathComment.h index 2ab35c2805..bb775a74cb 100644 --- a/src/mathed/InsetMathComment.h +++ b/src/mathed/InsetMathComment.h @@ -44,7 +44,7 @@ public: /// void octave(OctaveStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void infoize(odocstream & os) const; /// diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index 825b212c9d..629a440abf 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -14,7 +14,6 @@ #include "InsetMathDecoration.h" #include "MathData.h" -#include "MathExtern.h" #include "MathParser.h" #include "MathSupport.h" #include "MathStream.h" @@ -206,18 +205,16 @@ namespace { } } -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("" + cur->second.tag + "") << ETag(outag); - return rv; } diff --git a/src/mathed/InsetMathDecoration.h b/src/mathed/InsetMathDecoration.h index 7d77b49ae3..22c9f9bed3 100644 --- a/src/mathed/InsetMathDecoration.h +++ b/src/mathed/InsetMathDecoration.h @@ -42,7 +42,7 @@ public: /// InsetCode lyxCode() const { return MATH_DECORATION_CODE; } /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; private: virtual Inset * clone() const; diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 6da49562eb..459866c924 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -14,7 +14,6 @@ #include "InsetMathDelim.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "MathSupport.h" #include "MetricsInfo.h" @@ -162,12 +161,10 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const } -docstring InsetMathDelim::mathmlize(MathStream & os) const +void InsetMathDelim::mathmlize(MathStream & os) const { - os << "" << left_ << ""; - docstring const rv = lyx::mathmlize(cell(0),os); - os << "" << right_ << ""; - return rv; + os << "" << left_ << "" + << cell(0) << "" << right_ << ""; } diff --git a/src/mathed/InsetMathDelim.h b/src/mathed/InsetMathDelim.h index fb70f24927..67e1db0906 100644 --- a/src/mathed/InsetMathDelim.h +++ b/src/mathed/InsetMathDelim.h @@ -56,7 +56,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void octave(OctaveStream &) const; /// diff --git a/src/mathed/InsetMathDiff.cpp b/src/mathed/InsetMathDiff.cpp index f044ab8f15..1e990d7ffb 100644 --- a/src/mathed/InsetMathDiff.cpp +++ b/src/mathed/InsetMathDiff.cpp @@ -12,7 +12,6 @@ #include "InsetMathDiff.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "support/debug.h" @@ -96,17 +95,15 @@ void InsetMathDiff::mathematica(MathematicaStream & os) const } -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; } diff --git a/src/mathed/InsetMathDiff.h b/src/mathed/InsetMathDiff.h index f9f1aba088..6253168397 100644 --- a/src/mathed/InsetMathDiff.h +++ b/src/mathed/InsetMathDiff.h @@ -39,7 +39,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void maxima(MaximaStream &) const; /// diff --git a/src/mathed/InsetMathDots.cpp b/src/mathed/InsetMathDots.cpp index d1b18fa9b4..8ca2a1e469 100644 --- a/src/mathed/InsetMathDots.cpp +++ b/src/mathed/InsetMathDots.cpp @@ -85,7 +85,7 @@ void InsetMathDots::validate(LaTeXFeatures & features) 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 @@ -106,7 +106,6 @@ docstring InsetMathDots::mathmlize(MathStream & os) const else LASSERT(false, ent = "…"); os << MTag("mi") << from_ascii(ent) << ETag("mi"); - return docstring(); } } // namespace lyx diff --git a/src/mathed/InsetMathDots.h b/src/mathed/InsetMathDots.h index 4ba13351e9..4f2428712c 100644 --- a/src/mathed/InsetMathDots.h +++ b/src/mathed/InsetMathDots.h @@ -35,7 +35,7 @@ public: /// 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_; diff --git a/src/mathed/InsetMathEnsureMath.cpp b/src/mathed/InsetMathEnsureMath.cpp index 149bae7d2c..8f738a8dae 100644 --- a/src/mathed/InsetMathEnsureMath.cpp +++ b/src/mathed/InsetMathEnsureMath.cpp @@ -13,9 +13,8 @@ #include "InsetMathEnsureMath.h" -#include "MathExtern.h" -#include "MathData.h" #include "MathStream.h" +#include "MathData.h" #include @@ -68,9 +67,9 @@ void InsetMathEnsureMath::write(WriteStream & os) const } -docstring InsetMathEnsureMath::mathmlize(MathStream & os) const +void InsetMathEnsureMath::mathmlize(MathStream & os) const { - return lyx::mathmlize(cell(0), os); + os << cell(0); } diff --git a/src/mathed/InsetMathEnsureMath.h b/src/mathed/InsetMathEnsureMath.h index c8e58bbe97..ccc136a157 100644 --- a/src/mathed/InsetMathEnsureMath.h +++ b/src/mathed/InsetMathEnsureMath.h @@ -36,7 +36,7 @@ public: /// void write(WriteStream & os) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void infoize(odocstream & os) const; /// diff --git a/src/mathed/InsetMathExFunc.cpp b/src/mathed/InsetMathExFunc.cpp index 173436eb61..25c8dcbaf9 100644 --- a/src/mathed/InsetMathExFunc.cpp +++ b/src/mathed/InsetMathExFunc.cpp @@ -13,7 +13,6 @@ #include "InsetMathExFunc.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "MathSupport.h" #include "MetricsInfo.h" @@ -123,10 +122,10 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const } -docstring InsetMathExFunc::mathmlize(MathStream & os) const +void InsetMathExFunc::mathmlize(MathStream & os) const { os << "" << name_ << ""; - return lyx::mathmlize(cell(0), os); + os << cell(0); } diff --git a/src/mathed/InsetMathExFunc.h b/src/mathed/InsetMathExFunc.h index 0517484f38..fb6dda8b36 100644 --- a/src/mathed/InsetMathExFunc.h +++ b/src/mathed/InsetMathExFunc.h @@ -43,7 +43,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void octave(OctaveStream &) const; /// diff --git a/src/mathed/InsetMathExInt.cpp b/src/mathed/InsetMathExInt.cpp index 5277b6cde8..88970e0e96 100644 --- a/src/mathed/InsetMathExInt.cpp +++ b/src/mathed/InsetMathExInt.cpp @@ -12,7 +12,6 @@ #include "InsetMathExInt.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "MathStream.h" #include "InsetMathSymbol.h" @@ -123,7 +122,7 @@ void InsetMathExInt::mathematica(MathematicaStream & os) const } -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 @@ -151,11 +150,9 @@ docstring InsetMathExInt::mathmlize(MathStream & os) const os << ETag("msub"); else if (upper) os << ETag("msup"); - docstring rv = lyx::mathmlize(cell(0), os); - os << "" + os << cell(0) << "" << MTag("mrow") << "" << cell(1) << ETag("mrow"); - return rv; } diff --git a/src/mathed/InsetMathExInt.h b/src/mathed/InsetMathExInt.h index 55aa1f78f2..ced825b890 100644 --- a/src/mathed/InsetMathExInt.h +++ b/src/mathed/InsetMathExInt.h @@ -52,7 +52,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void write(WriteStream & os) const; /// diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 3fbd56d8fd..11d24469db 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -17,7 +17,6 @@ #include "Cursor.h" #include "LaTeXFeatures.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "MathSupport.h" #include "MetricsInfo.h" @@ -385,14 +384,12 @@ void InsetMathFrac::octave(OctaveStream & os) const } -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"); } @@ -536,9 +533,8 @@ void InsetMathBinom::normalize(NormalStream & os) const } -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"); @@ -551,7 +547,6 @@ docstring InsetMathBinom::mathmlize(MathStream & os) const os << MTag("mdbinom") << cell(0) << cell(1) << ETag("mdbinom"); break; } - return docstring(); } diff --git a/src/mathed/InsetMathFrac.h b/src/mathed/InsetMathFrac.h index 14af2f8be3..36e7ba363b 100644 --- a/src/mathed/InsetMathFrac.h +++ b/src/mathed/InsetMathFrac.h @@ -82,7 +82,7 @@ public: /// void octave(OctaveStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void validate(LaTeXFeatures & features) const; public: @@ -121,7 +121,7 @@ public: /// bool extraBraces() const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void validate(LaTeXFeatures & features) const; /// diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index c4fa241857..432a39a2f2 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -14,7 +14,6 @@ #include "InsetMathGrid.h" #include "MathData.h" -#include "MathExtern.h" #include "MathParser.h" #include "MathStream.h" #include "MetricsInfo.h" @@ -968,21 +967,19 @@ void InsetMathGrid::normalize(NormalStream & os) const } -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; } diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index aaef2aaa21..926216ea1c 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -219,7 +219,7 @@ public: /// //void maple(MapleStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// //void octave(OctaveStream &) const; diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 492e748d79..57137db2f2 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1092,9 +1092,9 @@ void InsetMathHull::normalize(NormalStream & os) const } -docstring InsetMathHull::mathmlize(MathStream & os) const +void InsetMathHull::mathmlize(MathStream & os) const { - return InsetMathGrid::mathmlize(os); + InsetMathGrid::mathmlize(os); } @@ -1782,9 +1782,9 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const &) const 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(); } diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h index a48edd1da5..db4d2ff89c 100644 --- a/src/mathed/InsetMathHull.h +++ b/src/mathed/InsetMathHull.h @@ -102,7 +102,7 @@ public: /// void write(WriteStream & os) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void normalize(NormalStream &) const; /// diff --git a/src/mathed/InsetMathKern.cpp b/src/mathed/InsetMathKern.cpp index fddecfe58e..7f990f9968 100644 --- a/src/mathed/InsetMathKern.cpp +++ b/src/mathed/InsetMathKern.cpp @@ -73,10 +73,4 @@ void InsetMathKern::normalize(NormalStream & os) const } -docstring InsetMathKern::mathmlize(MathStream &) const -{ - return docstring(); -} - - } // namespace lyx diff --git a/src/mathed/InsetMathKern.h b/src/mathed/InsetMathKern.h index db701cf158..bd26e4e021 100644 --- a/src/mathed/InsetMathKern.h +++ b/src/mathed/InsetMathKern.h @@ -39,7 +39,7 @@ public: /// void normalize(NormalStream & ns) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const { } /// InsetCode lyxCode() const { return MATH_KERN_CODE; } diff --git a/src/mathed/InsetMathLim.cpp b/src/mathed/InsetMathLim.cpp index 91335f3c3b..a5eae28bb7 100644 --- a/src/mathed/InsetMathLim.cpp +++ b/src/mathed/InsetMathLim.cpp @@ -12,7 +12,6 @@ #include "InsetMathLim.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "support/debug.h" @@ -72,16 +71,13 @@ void InsetMathLim::mathematica(MathematicaStream & os) const } -docstring InsetMathLim::mathmlize(MathStream & os) const +void InsetMathLim::mathmlize(MathStream & os) const { // FIXME XHTML We need a form of MTag that takes attributes. os << "" << "" << "lim" << "" - << "" << cell(1) << "" << cell(2) - << "" << "("; - docstring const rv = lyx::mathmlize(cell(0), os); - os << ")"; - return rv; + << "" << cell(1) << "" << cell(2) << "" + << "(" << cell(0) << ")" ; } diff --git a/src/mathed/InsetMathLim.h b/src/mathed/InsetMathLim.h index 5d1f1a4c6a..11d18dc06e 100644 --- a/src/mathed/InsetMathLim.h +++ b/src/mathed/InsetMathLim.h @@ -40,7 +40,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void write(WriteStream & os) const; /// diff --git a/src/mathed/InsetMathMatrix.cpp b/src/mathed/InsetMathMatrix.cpp index 7b73d3803e..d368f217b7 100644 --- a/src/mathed/InsetMathMatrix.cpp +++ b/src/mathed/InsetMathMatrix.cpp @@ -12,7 +12,6 @@ #include "InsetMathMatrix.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" @@ -90,25 +89,20 @@ void InsetMathMatrix::mathematica(MathematicaStream & os) const } -docstring InsetMathMatrix::mathmlize(MathStream & os) const +void InsetMathMatrix::mathmlize(MathStream & os) const { os << "" << left_ << ""; 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 << "" << right_ << ""; - return rv; } diff --git a/src/mathed/InsetMathMatrix.h b/src/mathed/InsetMathMatrix.h index e9639811c8..a62c8ea44b 100644 --- a/src/mathed/InsetMathMatrix.h +++ b/src/mathed/InsetMathMatrix.h @@ -40,7 +40,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void octave(OctaveStream &) const; /// diff --git a/src/mathed/InsetMathNumber.cpp b/src/mathed/InsetMathNumber.cpp index eb2e85bdc7..fdacf0c7bc 100644 --- a/src/mathed/InsetMathNumber.cpp +++ b/src/mathed/InsetMathNumber.cpp @@ -67,10 +67,9 @@ void InsetMathNumber::octave(OctaveStream & os) const } -docstring InsetMathNumber::mathmlize(MathStream & os) const +void InsetMathNumber::mathmlize(MathStream & os) const { os << " " << str_ << " "; - return docstring(); } diff --git a/src/mathed/InsetMathNumber.h b/src/mathed/InsetMathNumber.h index ed9e95ffcb..a6ca9dae29 100644 --- a/src/mathed/InsetMathNumber.h +++ b/src/mathed/InsetMathNumber.h @@ -43,7 +43,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void write(WriteStream & os) const; /// diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp index 7ca7706ba0..38c09469c9 100644 --- a/src/mathed/InsetMathRoot.cpp +++ b/src/mathed/InsetMathRoot.cpp @@ -13,7 +13,6 @@ #include "InsetMathRoot.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "Cursor.h" @@ -113,13 +112,9 @@ void InsetMathRoot::octave(OctaveStream & os) const } -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"); } diff --git a/src/mathed/InsetMathRoot.h b/src/mathed/InsetMathRoot.h index e05cc807a3..cfcac0a7f3 100644 --- a/src/mathed/InsetMathRoot.h +++ b/src/mathed/InsetMathRoot.h @@ -36,7 +36,7 @@ public: /// void normalize(NormalStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void maple(MapleStream &) const; /// diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index 74420279cb..1af0e57345 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -18,7 +18,6 @@ #include "InsetMathScript.h" #include "InsetMathSymbol.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "MathSupport.h" @@ -617,7 +616,7 @@ void InsetMathScript::mathematica(MathematicaStream & os) const // 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(); @@ -629,12 +628,9 @@ docstring InsetMathScript::mathmlize(MathStream & os) const 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 << ""; if (u && d) @@ -645,7 +641,6 @@ docstring InsetMathScript::mathmlize(MathStream & os) const os << MTag("mrow") << up() << ETag("mrow") << ETag("msup"); else if (d) os << MTag("mrow") << down() << ETag("mrow") << ETag("msub"); - return rv; } diff --git a/src/mathed/InsetMathScript.h b/src/mathed/InsetMathScript.h index 8d704dca9f..569bc79f35 100644 --- a/src/mathed/InsetMathScript.h +++ b/src/mathed/InsetMathScript.h @@ -61,7 +61,7 @@ public: /// 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; diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index b2a321234d..c771d2595b 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -192,11 +192,11 @@ void InsetMathSpace::octave(OctaveStream & os) 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(); @@ -210,7 +210,6 @@ docstring InsetMathSpace::mathmlize(MathStream & ms) const if (!l.empty()) ms << " width=\"" << from_ascii(l) << "\""; ms << " />"; - return docstring(); } diff --git a/src/mathed/InsetMathSpace.h b/src/mathed/InsetMathSpace.h index 442fe2e799..3e60b41c12 100644 --- a/src/mathed/InsetMathSpace.h +++ b/src/mathed/InsetMathSpace.h @@ -52,7 +52,7 @@ public: /// 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. diff --git a/src/mathed/InsetMathSpecialChar.cpp b/src/mathed/InsetMathSpecialChar.cpp index b32c2e2302..2c600d0c2b 100644 --- a/src/mathed/InsetMathSpecialChar.cpp +++ b/src/mathed/InsetMathSpecialChar.cpp @@ -147,7 +147,7 @@ void InsetMathSpecialChar::octave(OctaveStream & os) const } -docstring InsetMathSpecialChar::mathmlize(MathStream & ms) const +void InsetMathSpecialChar::mathmlize(MathStream & ms) const { switch (char_) { case '&': @@ -157,7 +157,6 @@ docstring InsetMathSpecialChar::mathmlize(MathStream & ms) const ms.os().put(char_); break; } - return docstring(); } diff --git a/src/mathed/InsetMathSpecialChar.h b/src/mathed/InsetMathSpecialChar.h index 5dcc012801..c672b504f6 100644 --- a/src/mathed/InsetMathSpecialChar.h +++ b/src/mathed/InsetMathSpecialChar.h @@ -45,7 +45,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream & ms) const; + void mathmlize(MathStream & ms) const; /// identifies SpecialChar insets InsetMathSpecialChar const * asSpecialCharInset() const { return this; } /// diff --git a/src/mathed/InsetMathSqrt.cpp b/src/mathed/InsetMathSqrt.cpp index dc154f8f6b..f738e2c17b 100644 --- a/src/mathed/InsetMathSqrt.cpp +++ b/src/mathed/InsetMathSqrt.cpp @@ -12,7 +12,6 @@ #include "InsetMathSqrt.h" #include "MathData.h" -#include "MathExtern.h" #include "MathStream.h" #include "TextPainter.h" #include "frontends/Painter.h" @@ -108,12 +107,9 @@ void InsetMathSqrt::octave(OctaveStream & os) const } -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"); } diff --git a/src/mathed/InsetMathSqrt.h b/src/mathed/InsetMathSqrt.h index 2cdc0e5a37..485f66a574 100644 --- a/src/mathed/InsetMathSqrt.h +++ b/src/mathed/InsetMathSqrt.h @@ -44,7 +44,7 @@ public: /// void octave(OctaveStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// InsetCode lyxCode() const { return MATH_SQRT_CODE; } diff --git a/src/mathed/InsetMathString.cpp b/src/mathed/InsetMathString.cpp index 28069ca6ad..ac951a1838 100644 --- a/src/mathed/InsetMathString.cpp +++ b/src/mathed/InsetMathString.cpp @@ -89,6 +89,13 @@ void InsetMathString::octave(OctaveStream & os) const } +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()) { diff --git a/src/mathed/InsetMathString.h b/src/mathed/InsetMathString.h index 95b2937c1c..9f94a7457f 100644 --- a/src/mathed/InsetMathString.h +++ b/src/mathed/InsetMathString.h @@ -47,6 +47,8 @@ public: /// void mathematica(MathematicaStream &) const; /// + void mathmlize(MathStream &) const; + /// void write(WriteStream & os) const; /// InsetCode lyxCode() const { return MATH_STRING_CODE; } diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp index d09d40b02c..a4a761171f 100644 --- a/src/mathed/InsetMathSymbol.cpp +++ b/src/mathed/InsetMathSymbol.cpp @@ -184,7 +184,7 @@ char const * MathMLtype(docstring const & s) } -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 @@ -197,7 +197,6 @@ docstring InsetMathSymbol::mathmlize(MathStream & os) const else os << sym_->xmlname; os << " '; - return docstring(); } diff --git a/src/mathed/InsetMathSymbol.h b/src/mathed/InsetMathSymbol.h index a9b96fc4b5..5382f72e85 100644 --- a/src/mathed/InsetMathSymbol.h +++ b/src/mathed/InsetMathSymbol.h @@ -61,7 +61,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void octave(OctaveStream &) const; /// diff --git a/src/mathed/InsetMathUnknown.cpp b/src/mathed/InsetMathUnknown.cpp index ae6f8ce005..2cd11c2a86 100644 --- a/src/mathed/InsetMathUnknown.cpp +++ b/src/mathed/InsetMathUnknown.cpp @@ -86,10 +86,9 @@ void InsetMathUnknown::mathematica(MathematicaStream & os) const } -docstring InsetMathUnknown::mathmlize(MathStream & os) const +void InsetMathUnknown::mathmlize(MathStream & os) const { os << MTag("mi") << name_ << ETag("mi"); - return docstring(); } diff --git a/src/mathed/InsetMathUnknown.h b/src/mathed/InsetMathUnknown.h index 9493ecfc28..b43bcfd672 100644 --- a/src/mathed/InsetMathUnknown.h +++ b/src/mathed/InsetMathUnknown.h @@ -50,7 +50,7 @@ public: /// void mathematica(MathematicaStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void octave(OctaveStream &) const; /// diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index ee7ceebe4f..f9b9f42af2 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -1413,22 +1413,20 @@ void mathematica(MathData const & dat, MathematicaStream & os) } -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 << ""; 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 diff --git a/src/mathed/MathExtern.h b/src/mathed/MathExtern.h index d367b1e901..199295ae96 100644 --- a/src/mathed/MathExtern.h +++ b/src/mathed/MathExtern.h @@ -30,7 +30,7 @@ void normalize(MathData const &, NormalStream &); 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); diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index dd7ccf3e71..5564600d06 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -73,10 +73,7 @@ public: } // 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)) { @@ -743,10 +740,9 @@ void MathMacro::maple(MapleStream & os) const } -docstring MathMacro::mathmlize(MathStream & os) const +void MathMacro::mathmlize(MathStream & os) const { os << expanded_.cell(0); - return docstring(); } diff --git a/src/mathed/MathMacro.h b/src/mathed/MathMacro.h index bb9ed723ca..b431a9a9a5 100644 --- a/src/mathed/MathMacro.h +++ b/src/mathed/MathMacro.h @@ -71,7 +71,7 @@ public: /// void maple(MapleStream &) const; /// - docstring mathmlize(MathStream &) const; + void mathmlize(MathStream &) const; /// void octave(OctaveStream &) const; ///