cleanup indent

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1658 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-03-01 20:05:38 +00:00
parent 285bdca679
commit a7bfe9d7f1

View File

@ -178,24 +178,22 @@ MathParInset::Metrics()
while (data.OK()) { while (data.OK()) {
cx = data.GetChar(); cx = data.GetChar();
if (cx >= ' ') { if (cx >= ' ') {
string s = data.GetString(); string const s = data.GetString();
mathed_string_height(data.fcode(), mathed_string_height(data.fcode(),
size(), s, asc, des); size(), s, asc, des);
if (asc > ascent) ascent = asc; if (asc > ascent) ascent = asc;
if (des > descent) descent = des; if (des > descent) descent = des;
limits = false; limits = false;
mathed_char_height(LM_TC_CONST, size(), 'y', asc, des); mathed_char_height(LM_TC_CONST, size(), 'y', asc, des);
} else } else if (MathIsInset(cx)) {
if (MathIsInset(cx)) {
MathedInset * p = data.GetInset(); MathedInset * p = data.GetInset();
p->SetStyle(size()); p->SetStyle(size());
p->Metrics(); p->Metrics();
if (cx == LM_TC_UP) { if (cx == LM_TC_UP) {
asc += (limits) ? p->Height() + 4: p->Ascent() + asc += (limits) ? p->Height() + 4: p->Ascent() +
((p->Descent()>asc) ? p->Descent() - asc + 4: 0); ((p->Descent()>asc) ? p->Descent() - asc + 4: 0);
} else } else if (cx == LM_TC_DOWN) {
if (cx == LM_TC_DOWN) { des += (limits ? p->Height() + 4 : p->Height() - p->Ascent() / 2);
des += ((limits) ? p->Height() + 4: p->Height() - p->Ascent() / 2);
} else { } else {
asc = p->Ascent(); asc = p->Ascent();
des = p->Descent(); des = p->Descent();
@ -205,35 +203,36 @@ MathParInset::Metrics()
if (cx!= LM_TC_UP && cx!= LM_TC_DOWN) if (cx!= LM_TC_UP && cx!= LM_TC_DOWN)
limits = p->GetLimits(); limits = p->GetLimits();
data.Next(); data.Next();
} else } else if (cx == LM_TC_TAB) {
if (cx == LM_TC_TAB) { int x;
int x, y; int y;
data.GetIncPos(x, y); data.GetIncPos(x, y);
if (data.IsFirst() || cxp == LM_TC_TAB || cxp == LM_TC_CR) { if (data.IsFirst() || cxp == LM_TC_TAB || cxp == LM_TC_CR) {
if (ascent<df_asc) ascent = df_asc; if (ascent < df_asc) ascent = df_asc;
tb = x; tb = x;
} }
data.setTab(x-tb, tab); data.setTab(x - tb, tab);
tb = x; tb = x;
++tab; ++tab;
limits = false; limits = false;
data.Next(); data.Next();
} else } else if (cx == LM_TC_CR) {
if (cx == LM_TC_CR) {
if (tb > 0) { if (tb > 0) {
int x, y; int x;
int y;
data.GetIncPos(x, y); data.GetIncPos(x, y);
if (data.IsFirst() || cxp == LM_TC_TAB || cxp == LM_TC_CR) { if (data.IsFirst() || cxp == LM_TC_TAB || cxp == LM_TC_CR) {
if (ascent<df_asc) ascent = df_asc; if (ascent < df_asc) ascent = df_asc;
tb = x; tb = x;
} }
data.setTab(x - tb, tab); data.setTab(x - tb, tab);
} else //if (GetColumns() == 1) } else //if (GetColumns() == 1)
{ {
int x, y; int x;
int y;
data.GetIncPos(x, y); data.GetIncPos(x, y);
data.setTab(x, tab); data.setTab(x, tab);
if (ascent<df_asc) ascent = df_asc; if (ascent < df_asc) ascent = df_asc;
} }
tb = tab = 0; tb = tab = 0;
data.subMetrics(ascent, descent); data.subMetrics(ascent, descent);