ms << "]]>";
ms << ETag("alt");
ms << MTag("math");
- ms << par_.nucleus();
+ ms << par_;
ms << ETag("math");
ms << ETag("equation");
return ms.line() + res;
{
NormalStream ns(lyxerr);
for (const_iterator it = begin(); it != end(); ++it)
- ns << it->nucleus() << ' ';
+ ns << *it << ' ';
}
{
NormalStream ns(lyxerr);
for (const_iterator it = begin(); it != end(); ++it)
- ns << "<" << it->nucleus() << ">";
+ ns << "<" << *it << ">";
}
void MathArray::validate(LaTeXFeatures & features) const
{
for (const_iterator it = begin(); it != end(); ++it)
- if (it->nucleus())
- it->nucleus()->validate(features);
+ (*it)->validate(features);
}
return false;
const_iterator it = begin() + pos;
for (const_iterator jt = ar.begin(); jt != ar.end(); ++jt, ++it)
- if (!jt->nucleus()->match(it->nucleus()))
+ if (!(*jt)->match(it->nucleus()))
return false;
return true;
}
void MathDelimInset::maplize(MapleStream & os) const
{
if (isAbs()) {
- bool mat =
- cell(0).size() == 1 && cell(0).begin()->nucleus()
- && cell(0).begin()->nucleus()->asMatrixInset();
- if (mat)
+ if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
os << "linalg[det](" << cell(0) << ")";
else
os << "abs(" << cell(0) << ")";
void MathDelimInset::mathematicize(MathematicaStream & os) const
{
if (isAbs()) {
- bool mat =
- cell(0).size() == 1 && cell(0).begin()->nucleus()
- && cell(0).begin()->nucleus()->asMatrixInset();
- if (mat)
+ if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
os << "Det" << cell(0) << ']';
else
os << "Abs[" << cell(0) << ']';
void MathDimInset::metricsT(TextMetricsInfo const &) const
{
+#ifndef WITH_WARNINGS
+#warning temporarily disabled
+#endif
+/*
std::ostringstream os;
- os << *this;
+ os << MathAtom(this);
dim_.w = int(os.str().size());
dim_.a = 1;
dim_.d = 0;
+*/
}
-void MathDimInset::drawT(TextPainter & pain, int x, int y) const
+void MathDimInset::drawT(TextPainter &, int, int) const
{
+/*
std::ostringstream os;
- os << *this;
+ os << MathAtom(this);
pain.draw(x, y, os.str().c_str());
+*/
}
if (ar.size() == 0)
os << "<mrow/>";
else if (ar.size() == 1)
- os << ar.begin()->nucleus();
+ os << ar.front();
else {
os << MTag("mrow");
for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it)
ostream & operator<<(ostream & os, MathAtom const & at)
-{
- if (at.nucleus())
- os << *(at.nucleus());
- else
- os << "(nil)";
- return os;
-}
-
-
-ostream & operator<<(ostream & os, MathInset const & inset)
{
WriteStream wi(os, false, false);
- inset.write(wi);
+ at->write(wi);
return os;
}
virtual string name() const;
};
-std::ostream & operator<<(std::ostream &, MathInset const &);
std::ostream & operator<<(std::ostream &, MathAtom const &);
string asString(MathArray const & ar);
#include "math_mathmlstream.h"
#include "math_inset.h"
#include "math_extern.h"
-#include "debug.h"
#include "support/lyxalgo.h"
{}
-MathMLStream & operator<<(MathMLStream & ms, MathInset const * p)
+MathMLStream & operator<<(MathMLStream & ms, MathAtom const & at)
{
- if (p)
- p->mathmlize(ms);
- else
- lyxerr << "operator<<(MathMLStream, NULL) called\n";
+ at->mathmlize(ms);
return ms;
}
//////////////////////////////////////////////////////////////////////
-MapleStream & operator<<(MapleStream & ms, MathInset const * p)
+MapleStream & operator<<(MapleStream & ms, MathAtom const & at)
{
- if (p)
- p->maplize(ms);
- else
- lyxerr << "operator<<(MapleStream, NULL) called\n";
+ at->maplize(ms);
return ms;
}
//////////////////////////////////////////////////////////////////////
-MathematicaStream & operator<<(MathematicaStream & ms, MathInset const * p)
+MathematicaStream & operator<<(MathematicaStream & ms, MathAtom const & at)
{
- if (p)
- p->mathematicize(ms);
- else
- lyxerr << "operator<<(MathematicaStream, NULL) called\n";
+ at->mathematicize(ms);
return ms;
}
//////////////////////////////////////////////////////////////////////
-OctaveStream & operator<<(OctaveStream & ns, MathInset const * p)
+OctaveStream & operator<<(OctaveStream & ns, MathAtom const & at)
{
- if (p)
- p->octavize(ns);
- else
- lyxerr << "operator<<(OctaveStream, NULL) called\n";
+ at->octavize(ns);
return ns;
}
//////////////////////////////////////////////////////////////////////
-NormalStream & operator<<(NormalStream & ns, MathInset const * p)
+NormalStream & operator<<(NormalStream & ns, MathAtom const & at)
{
- if (p)
- p->normalize(ns);
- else
- lyxerr << "operator<<(NormalStream, NULL) called\n";
+ at->normalize(ns);
return ns;
}
}
-WriteStream & operator<<(WriteStream & ws, MathInset const * p)
+WriteStream & operator<<(WriteStream & ws, MathAtom const & at)
{
- if (p)
- p->write(ws);
- else
- lyxerr << "operator<<(WriteStream, NULL) called\n";
+ at->write(ws);
return ws;
}
WriteStream & operator<<(WriteStream & ws, char c)
{
ws.os() << c;
- if (c == '\n') {
- lyxerr << "writing a newline\n";
+ if (c == '\n')
ws.addlines(1);
- }
return ws;
}
class MathArray;
class MathInset;
+class MathAtom;
//
};
///
-MathMLStream & operator<<(MathMLStream &, MathInset const *);
+MathMLStream & operator<<(MathMLStream &, MathAtom const &);
///
MathMLStream & operator<<(MathMLStream &, MathArray const &);
///
};
///
-NormalStream & operator<<(NormalStream &, MathInset const *);
+NormalStream & operator<<(NormalStream &, MathAtom const &);
///
NormalStream & operator<<(NormalStream &, MathArray const &);
///
///
-MapleStream & operator<<(MapleStream &, MathInset const *);
+MapleStream & operator<<(MapleStream &, MathAtom const &);
///
MapleStream & operator<<(MapleStream &, MathArray const &);
///
///
-MathematicaStream & operator<<(MathematicaStream &, MathInset const *);
+MathematicaStream & operator<<(MathematicaStream &, MathAtom const &);
///
MathematicaStream & operator<<(MathematicaStream &, MathArray const &);
///
};
///
-OctaveStream & operator<<(OctaveStream &, MathInset const *);
+OctaveStream & operator<<(OctaveStream &, MathAtom const &);
///
OctaveStream & operator<<(OctaveStream &, MathArray const &);
///
};
///
-WriteStream & operator<<(WriteStream &, MathInset const *);
+WriteStream & operator<<(WriteStream &, MathAtom const &);
///
WriteStream & operator<<(WriteStream &, MathArray const &);
///