mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
show the 'empty base dot' less frequently
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3522 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e369d83035
commit
2c81992188
@ -20,7 +20,6 @@
|
||||
|
||||
#include "math_macro.h"
|
||||
#include "math_support.h"
|
||||
#include "math_cursor.h"
|
||||
#include "math_extern.h"
|
||||
#include "math_macrotable.h"
|
||||
#include "math_macrotemplate.h"
|
||||
@ -64,12 +63,6 @@ bool MathMacro::defining() const
|
||||
}
|
||||
|
||||
|
||||
bool MathMacro::editing() const
|
||||
{
|
||||
return mathcursor && mathcursor->isInside(this);
|
||||
}
|
||||
|
||||
|
||||
void MathMacro::metrics(MathMetricsInfo const & mi) const
|
||||
{
|
||||
mi_ = mi;
|
||||
|
@ -83,8 +83,6 @@ private:
|
||||
///
|
||||
char const * name() const;
|
||||
///
|
||||
bool editing() const;
|
||||
///
|
||||
bool defining() const;
|
||||
///
|
||||
void updateExpansion() const;
|
||||
|
@ -3,6 +3,7 @@
|
||||
#endif
|
||||
|
||||
#include "math_nestinset.h"
|
||||
#include "math_cursor.h"
|
||||
#include "math_mathmlstream.h"
|
||||
#include "debug.h"
|
||||
|
||||
@ -182,3 +183,10 @@ bool MathNestInset::contains(MathArray const & ar)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool MathNestInset::editing() const
|
||||
{
|
||||
return mathcursor && mathcursor->isInside(this);
|
||||
}
|
||||
|
||||
|
@ -75,6 +75,8 @@ public:
|
||||
|
||||
/// debug helper
|
||||
void dump() const;
|
||||
///
|
||||
virtual bool editing() const;
|
||||
|
||||
protected:
|
||||
/// we store the cells in a vector
|
||||
|
@ -359,7 +359,7 @@ Token const & Parser::nextToken() const
|
||||
Token const & Parser::getToken()
|
||||
{
|
||||
static const Token dummy;
|
||||
//lyxerr << "looking at token " << tokens_[pos_] << '\n';
|
||||
//lyxerr << "looking at token " << tokens_[pos_] << " pos: " << pos_ << '\n';
|
||||
return good() ? tokens_[pos_++] : dummy;
|
||||
}
|
||||
|
||||
@ -494,16 +494,25 @@ void Parser::tokenize(string const & buffer)
|
||||
|
||||
case catEscape: {
|
||||
is.get(c);
|
||||
string s(1, c);
|
||||
if (catcode(c) == catLetter) {
|
||||
while (is.get(c) && catcode(c) == catLetter)
|
||||
s += c;
|
||||
if (catcode(c) == catSpace)
|
||||
while (is.get(c) && catcode(c) == catSpace)
|
||||
;
|
||||
is.putback(c);
|
||||
}
|
||||
push_back(Token(s));
|
||||
if (!is) {
|
||||
error("unexpected end of input");
|
||||
} else {
|
||||
string s(1, c);
|
||||
if (catcode(c) == catLetter) {
|
||||
while (is.get(c) && catcode(c) == catLetter)
|
||||
s += c;
|
||||
if (catcode(c) == catSpace)
|
||||
while (is.get(c) && catcode(c) == catSpace)
|
||||
;
|
||||
is.putback(c);
|
||||
}
|
||||
push_back(Token(s));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case catIgnore: {
|
||||
lyxerr << "ignoring a char: " << int(c) << "\n";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -558,17 +567,19 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
||||
// reading a row
|
||||
for (MathInset::col_type col = 0; col < p->ncols(); ++col) {
|
||||
//lyxerr << "reading cell " << row << " " << col << "\n";
|
||||
//lyxerr << "ncols: " << p->ncols() << "\n";
|
||||
|
||||
MathArray & ar = p->cell(col + row * p->ncols());
|
||||
parse_into(ar, FLAG_BLOCK);
|
||||
// remove 'unnecessary' braces:
|
||||
if (ar.size() == 1 && ar.back()->asBraceInset())
|
||||
ar = ar.back()->asBraceInset()->cell(0);
|
||||
//lyxerr << "ar: " << ar << "\n";
|
||||
|
||||
// break if cell is not followed by an ampersand
|
||||
if (nextToken().cat() != catAlign) {
|
||||
//lyxerr << "less cells read than normal in row/col: "
|
||||
// << row << " " << col << "\n";
|
||||
lyxerr << "less cells read than normal in row/col: "
|
||||
<< row << " " << col << "\n";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -845,8 +856,10 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
{
|
||||
parse_into1(array, flags, code);
|
||||
// remove 'unnecessary' braces:
|
||||
if (array.size() == 1 && array.back()->asBraceInset())
|
||||
if (array.size() == 1 && array.back()->asBraceInset()) {
|
||||
lyxerr << "extra braces removed\n";
|
||||
array = array.back()->asBraceInset()->cell(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -210,7 +210,7 @@ void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
|
||||
{
|
||||
if (nuc)
|
||||
nuc->draw(pain, x + dxx(nuc), y);
|
||||
else
|
||||
else if (editing())
|
||||
drawStr(pain, LM_TC_TEX, mi_, x + dxx(nuc), y, ".");
|
||||
|
||||
if (hasUp())
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "math_xymatrixinset.h"
|
||||
#include "math_mathmlstream.h"
|
||||
#include "math_streamstr.h"
|
||||
#include "math_cursor.h"
|
||||
#include "math_support.h"
|
||||
#include "Painter.h"
|
||||
#include "debug.h"
|
||||
@ -25,12 +24,6 @@ MathInset * MathXYArrowInset::clone() const
|
||||
}
|
||||
|
||||
|
||||
bool MathXYArrowInset::editing() const
|
||||
{
|
||||
return mathcursor && mathcursor->isInside(this);
|
||||
}
|
||||
|
||||
|
||||
MathXYMatrixInset const * MathXYArrowInset::targetMatrix() const
|
||||
{
|
||||
return mi_.inset ? mi_.inset->asXYMatrixInset() : 0;
|
||||
|
@ -24,8 +24,6 @@ public:
|
||||
void draw(Painter & pain, int x, int y) const;
|
||||
///
|
||||
MathXYArrowInset * asXYArrowInset() { return this; }
|
||||
///
|
||||
bool editing() const;
|
||||
|
||||
///
|
||||
void normalize();
|
||||
|
Loading…
Reference in New Issue
Block a user