InsetTabular.cpp: partly reverting r28437, because I was wrong: it is totally valid to have several rows to be the header and also several rows can have a caption, my own EmebeddedObjects manual has examples for this - stupid me!

Bug 5752 is nevertheless still fixed.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28442 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2009-02-11 03:18:16 +00:00
parent 8bbd9f254d
commit b9df3d88c9

View File

@ -3900,22 +3900,19 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
status.setOnOff(convert<int>(argument) == tabular.getUsebox(cur.idx()));
break;
// when a header/footer/caption is set, no other row can be the same
// furthermore, every row can only be one thing:
// either a footer or header or caption
// every row can only be one thing:
// either a footer or header or caption
case Tabular::SET_LTFIRSTHEAD:
status.setEnabled(sel_row_start == sel_row_end
&& !tabular.getRowOfLTHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTFoot(sel_row_start, dummyltt)
&& !tabular.getRowOfLTLastFoot(sel_row_start, dummyltt)
&& !tabular.ltCaption(sel_row_start)
&& (!tabular.haveLTFirstHead()
|| tabular.getRowOfLTFirstHead(sel_row_start, dummyltt)));
status.setOnOff(tabular.getRowOfLTHead(sel_row_start, dummyltt));
&& !tabular.ltCaption(sel_row_start));
status.setOnOff(tabular.getRowOfLTFirstHead(sel_row_start, dummyltt));
break;
case Tabular::UNSET_LTFIRSTHEAD:
status.setOnOff(!tabular.getRowOfLTHead(sel_row_start, dummyltt));
status.setOnOff(!tabular.getRowOfLTFirstHead(sel_row_start, dummyltt));
break;
case Tabular::SET_LTHEAD:
@ -3923,9 +3920,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
&& !tabular.getRowOfLTFirstHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTFoot(sel_row_start, dummyltt)
&& !tabular.getRowOfLTLastFoot(sel_row_start, dummyltt)
&& !tabular.ltCaption(sel_row_start)
&& (!tabular.haveLTHead()
|| tabular.getRowOfLTHead(sel_row_start, dummyltt)));
&& !tabular.ltCaption(sel_row_start));
status.setOnOff(tabular.getRowOfLTHead(sel_row_start, dummyltt));
break;
@ -3938,9 +3933,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
&& !tabular.getRowOfLTFirstHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTLastFoot(sel_row_start, dummyltt)
&& !tabular.ltCaption(sel_row_start)
&& (!tabular.haveLTFoot()
|| tabular.getRowOfLTFoot(sel_row_start, dummyltt)));
&& !tabular.ltCaption(sel_row_start));
status.setOnOff(tabular.getRowOfLTFoot(sel_row_start, dummyltt));
break;
@ -3953,14 +3946,12 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
&& !tabular.getRowOfLTFirstHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTFoot(sel_row_start, dummyltt)
&& !tabular.ltCaption(sel_row_start)
&& (!tabular.haveLTLastFoot()
|| tabular.getRowOfLTLastFoot(sel_row_start, dummyltt)));
status.setOnOff(tabular.getRowOfLTFoot(sel_row_start, dummyltt));
&& !tabular.ltCaption(sel_row_start));
status.setOnOff(tabular.getRowOfLTLastFoot(sel_row_start, dummyltt));
break;
case Tabular::UNSET_LTLASTFOOT:
status.setOnOff(!tabular.getRowOfLTFoot(sel_row_start, dummyltt));
status.setOnOff(!tabular.getRowOfLTLastFoot(sel_row_start, dummyltt));
break;
case Tabular::SET_LTNEWPAGE:
@ -3972,11 +3963,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
&& !tabular.getRowOfLTFirstHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTFoot(sel_row_start, dummyltt)
&& !tabular.getRowOfLTLastFoot(sel_row_start, dummyltt)
// Only the first row can be the caption.
&& sel_row_start == 0
&& (!tabular.haveLTCaption()
|| tabular.ltCaption(sel_row_start)));
&& !tabular.getRowOfLTLastFoot(sel_row_start, dummyltt));
status.setOnOff(tabular.ltCaption(sel_row_start));
break;