#include "InsetMath.h"
#include "MathData.h"
+#include "MathRow.h"
#include "MathStream.h"
+#include "MetricsInfo.h"
+
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lassert.h"
#include "support/lstrings.h"
#include "support/textutils.h"
-#include "support/lassert.h"
using namespace std;
}
+MathClass InsetMath::mathClass() const
+{
+ return MC_ORD;
+}
+
+
+InsetMath::marker_type InsetMath::marker(BufferView const *) const
+{
+ return nargs() > 0 ? MARKER : NO_MARKER;
+}
+
+
+bool InsetMath::addToMathRow(MathRow & mrow, MetricsInfo & mi) const
+{
+ MathRow::Element e(mi, MathRow::INSET, mathClass());
+ e.inset = this;
+ e.marker = mi.base.macro_nesting ? NO_MARKER : marker(mi.base.bv);
+ mrow.push_back(e);
+ return true;
+}
+
+
void InsetMath::dump() const
{
lyxerr << "---------------------------------------------" << endl;
odocstringstream os;
- otexrowstream ots(os, false);
+ otexrowstream ots(os);
WriteStream wi(ots, false, true, WriteStream::wsDefault);
write(wi);
lyxerr << to_utf8(os.str());
}
-int InsetMath::plaintext(odocstringstream &,
+int InsetMath::plaintext(odocstringstream &,
OutputParams const &, size_t) const
{
// all math plain text output shall take place in InsetMathHull
ostream & operator<<(ostream & os, MathAtom const & at)
{
odocstringstream oss;
- otexrowstream ots(oss, false);
+ otexrowstream ots(oss);
WriteStream wi(ots, false, false, WriteStream::wsDefault);
at->write(wi);
return os << to_utf8(oss.str());
odocstream & operator<<(odocstream & os, MathAtom const & at)
{
- otexrowstream ots(os, false);
+ otexrowstream ots(os);
WriteStream wi(ots, false, false, WriteStream::wsDefault);
at->write(wi);
return os;