mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
Fix bug #6246: InsetMathKern is broken
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31474 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a74e1b096c
commit
eb065995b1
@ -57,12 +57,18 @@ void InsetMathKern::draw(PainterInfo &, int, int) const
|
||||
|
||||
void InsetMathKern::write(WriteStream & os) const
|
||||
{
|
||||
if (wid_.empty())
|
||||
os << "\\kern" << ' ';
|
||||
else
|
||||
os << "\\kern" << from_utf8(wid_.asLatexString()) << ' ';
|
||||
}
|
||||
|
||||
|
||||
void InsetMathKern::normalize(NormalStream & os) const
|
||||
{
|
||||
if (wid_.empty())
|
||||
os << "[kern]";
|
||||
else
|
||||
os << "[kern " << from_utf8(wid_.asLatexString()) << ']';
|
||||
}
|
||||
|
||||
|
@ -1552,9 +1552,13 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
|
||||
else if (t.cs() == "kern") {
|
||||
// FIXME: A hack...
|
||||
docstring s;
|
||||
int num_tokens = 0;
|
||||
while (true) {
|
||||
Token const & t = getToken();
|
||||
++num_tokens;
|
||||
if (!good()) {
|
||||
s.clear();
|
||||
while (num_tokens--)
|
||||
putback();
|
||||
break;
|
||||
}
|
||||
@ -1562,6 +1566,9 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
|
||||
if (isValidLength(to_utf8(s)))
|
||||
break;
|
||||
}
|
||||
if (s.empty())
|
||||
cell->push_back(MathAtom(new InsetMathKern));
|
||||
else
|
||||
cell->push_back(MathAtom(new InsetMathKern(s)));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user