fix static array

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1158 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-10-26 00:03:21 +00:00
parent f826e64de1
commit d597ece5e7

View File

@ -191,21 +191,18 @@ LyXFont mathed_get_font(short type, int size)
int mathed_string_width(short type, int size, byte const * s, int ls)
{
LyXFont f = WhichFont(type, size);
string st;
if (MathIsBinary(type))
for (int i = 0; i < ls; ++i) {
st += ' ';
st += s[i];
st += ' ';
}
else
st = string(reinterpret_cast<char const *>(s), ls);
byte sx[80];
if (MathIsBinary(type)) {
byte * ps = &sx[0];
for (int i = 0; i < ls && i < 75; ++i) {
*(ps++) = ' ';
*(ps++) = s[i];
*(ps++) = ' ';
}
*(ps++) = '\0';
ls *= 3;
s = &sx[0];
}
return lyxfont::width(reinterpret_cast<char const *>(s), ls, f);
LyXFont const f = WhichFont(type, size);
return lyxfont::width(st, f);
}
int mathed_string_width(short type, int size, string const & str)
@ -258,13 +255,15 @@ void MathedInset::drawStr(Painter & pain, short type, int siz,
int x, int y, byte const * s, int ls)
{
string st;
if (MathIsBinary(type)) {
if (MathIsBinary(type))
for (int i = 0; i < ls; ++i) {
st += string(" ") + char(s[i]) + ' ';
st += ' ';
st += char(s[i]);
st += ' ';
}
} else {
else
st = string(reinterpret_cast<char const *>(s), ls);
}
LyXFont const mf = mathed_get_font(type, siz);
pain.text(x, y, st, mf);
}