mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
Fix fuer #209
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3468 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7c49abda63
commit
c3e5ddf89a
@ -56,6 +56,8 @@ public:
|
||||
void handleFont(MathTextCodes t);
|
||||
///
|
||||
bool match(MathInset *) const;
|
||||
/// identifies complicated things that need braces if used as arg
|
||||
bool needsBraces() const { return false; }
|
||||
|
||||
private:
|
||||
/// the character
|
||||
|
@ -212,6 +212,8 @@ public:
|
||||
virtual MathTextCodes code() const { return LM_TC_MIN; }
|
||||
/// identifies things that can get \limits or \nolimits
|
||||
virtual bool takesLimits() const { return false; }
|
||||
/// identifies complicated things that need braces if used as arg
|
||||
virtual bool needsBraces() const { return true; }
|
||||
|
||||
///
|
||||
virtual void edit(BufferView *, int, int, unsigned int) {}
|
||||
|
@ -798,7 +798,10 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
#warning this might be wrong in general!
|
||||
#endif
|
||||
// ignore braces around simple items
|
||||
if (ar.size() == 1 || (ar.size() == 2 && ar.back()->asScriptInset())) {
|
||||
if ((ar.size() == 1 && !ar.front()->needsBraces()
|
||||
|| (ar.size() == 2 && !ar.front()->needsBraces()
|
||||
&& ar.back()->asScriptInset())))
|
||||
{
|
||||
array.push_back(ar);
|
||||
} else {
|
||||
array.push_back(MathAtom(new MathBraceInset));
|
||||
|
@ -37,6 +37,8 @@ public:
|
||||
bool match(MathInset *) const;
|
||||
/// request "external features"
|
||||
void validate(LaTeXFeatures & features) const;
|
||||
/// identifies complicated things that need braces if used as arg
|
||||
bool needsBraces() const { return false; }
|
||||
|
||||
///
|
||||
void normalize(NormalStream &) const;
|
||||
|
Loading…
Reference in New Issue
Block a user