This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It should not change any output.
InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l,
docstring const & r)
- : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0)
+ : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(false)
{}
InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r,
MathData const & ar)
- : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0)
+ : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(false)
+{
+ cell(0) = ar;
+}
+
+
+InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r,
+ MathData const & ar, bool const is_extracted)
+ : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(is_extracted)
{
cell(0) = ar;
}
InsetMathDelim(Buffer * buf, docstring const & left, docstring const & right,
MathData const &);
///
+ InsetMathDelim(Buffer * buf, docstring const & left, docstring const & right,
+ MathData const &, bool const is_extracted);
+ ///
InsetMathDelim * asDelimInset() override { return this; }
///
InsetMathDelim const * asDelimInset() const override { return this; }
Inset * clone() const override;
///
mutable int dw_;
+ /// Is it extracted by MathExtern routines? They try to extract as much
+ /// semantics from a raw LaTeX formula in terms of LyX insets.
+ bool const is_extracted_;
};
} // namespace lyx
MathAtom replaceParenDelims(const MathData & ar)
{
return MathAtom(new InsetMathDelim(const_cast<Buffer *>(ar.buffer()),
- from_ascii("("), from_ascii(")"), ar));
+ from_ascii("("), from_ascii(")"), ar, true));
}
MathAtom replaceBracketDelims(const MathData & ar)
{
return MathAtom(new InsetMathDelim(const_cast<Buffer *>(ar.buffer()),
- from_ascii("["), from_ascii("]"), ar));
+ from_ascii("["), from_ascii("]"), ar, true));
}