X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMath.cpp;h=8706001d61dcabde80630d6a3763c7275e3cc388;hb=a68e5b777487b495feeefa53700834ecec6ec196;hp=a8642c14ac27cb19c77fbc788064aa365dd9de66;hpb=bf56e2c8e1afa857cd5e313c19948040e41b8227;p=lyx.git diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index a8642c14ac..8706001d61 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -16,13 +16,15 @@ #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; @@ -56,11 +58,17 @@ MathClass InsetMath::mathClass() const } -bool InsetMath::addToMathRow(MathRow & mrow, MetricsInfo const &) const +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; + MathRow::Element e(mi, MathRow::INSET, mathClass()); e.inset = this; - e.mclass = mathClass(); + e.marker = mi.base.macro_nesting ? NO_MARKER : marker(mi.base.bv); mrow.push_back(e); return true; } @@ -102,7 +110,7 @@ void InsetMath::write(WriteStream & os) const } -int InsetMath::plaintext(odocstringstream &, +int InsetMath::plaintext(odocstringstream &, OutputParams const &, size_t) const { // all math plain text output shall take place in InsetMathHull