#include "InsetMathBrace.h"
#include "InsetMathFont.h"
+#include "InsetMathMacro.h"
#include "InsetMathScript.h"
#include "MacroTable.h"
-#include "InsetMathMacro.h"
+#include "MathRow.h"
#include "MathStream.h"
#include "MathSupport.h"
#include "MetricsInfo.h"
#include "BufferView.h"
#include "CoordCache.h"
#include "Cursor.h"
+#include "Dimension.h"
#include "mathed/InsetMathUnknown.h"
#include "support/docstream.h"
#include "support/gettext.h"
#include "support/lassert.h"
-#include "support/lyxalgo.h"
#include <cstdlib>
MathData::MathData(Buffer * buf, const_iterator from, const_iterator to)
- : base_type(from, to), minasc_(0), mindes_(0), slevel_(0),
- sshift_(0), buffer_(buf)
+ : base_type(from, to), buffer_(buf)
{}
{
bool has_contents = false;
BufferView * bv = mi.base.bv;
+ display_style_ = mi.base.font.style() == DISPLAY_STYLE;
MathData * ar = const_cast<MathData*>(this);
ar->updateMacros(&bv->cursor(), mi.macrocontext,
InternalUpdate, mi.base.macro_nesting);
{
// If we are editing a macro, we cannot update it immediately,
// otherwise wrong undo steps will be recorded (bug 6208).
- InsetMath const * inmath = cur ? cur->inset().asInsetMath() : nullptr;
- InsetMathMacro const * inmacro = inmath ? inmath->asMacro() : nullptr;
+ InsetMath const * inmath = cur ? cur->inset().asInsetMath() : 0;
+ InsetMathMacro const * inmacro = inmath ? inmath->asMacro() : 0;
docstring const edited_name = inmacro ? inmacro->name() : docstring();
// go over the array and look for macros
}
+MathClass MathData::firstMathClass() const
+{
+ for (MathAtom const & at : *this) {
+ MathClass mc = at->mathClass();
+ if (mc != MC_UNKNOWN)
+ return mc;
+ }
+ return MC_ORD;
+}
+
+
MathClass MathData::lastMathClass() const
{
MathClass res = MC_ORD;