mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Memorise whether delims are extracted from MathExtern.
This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It should not change any output.
This commit is contained in:
parent
1680eaf5f0
commit
93444892c5
@ -45,13 +45,21 @@ static docstring convertDelimToLatexName(docstring const & name)
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -27,6 +27,9 @@ public:
|
||||
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; }
|
||||
@ -73,6 +76,9 @@ private:
|
||||
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
|
||||
|
@ -500,7 +500,7 @@ bool testCloseParen(MathAtom const & at)
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@ -519,7 +519,7 @@ bool testCloseBracket(MathAtom const & at)
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user