Fix a few enable/disable problems for longtables:

- set header, set first-header-empty, unset first-header-empty,
- set header, set first-header-empty, unset header

The same also for footers.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29716 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-05-17 18:27:39 +00:00
parent 34479058ad
commit 7ff6379445

View File

@ -448,9 +448,6 @@ void GuiTabular::ltHeaderStatus_clicked()
set(Tabular::SET_LTHEAD, "");
else
set(Tabular::UNSET_LTHEAD, "");
headerBorderAboveCB->setEnabled(enable);
headerBorderBelowCB->setEnabled(enable);
firstheaderNoContentsCB->setEnabled(enable);
changed();
}
@ -502,8 +499,6 @@ void GuiTabular::ltFirstHeaderStatus_clicked()
set(Tabular::SET_LTFIRSTHEAD, "");
else
set(Tabular::UNSET_LTFIRSTHEAD, "");
firstheaderBorderAboveCB->setEnabled(enable);
firstheaderBorderBelowCB->setEnabled(enable);
changed();
}
@ -515,9 +510,6 @@ void GuiTabular::ltFirstHeaderEmpty_clicked()
set(Tabular::SET_LTFIRSTHEAD, "empty");
else
set(Tabular::UNSET_LTFIRSTHEAD, "empty");
firstheaderStatusCB->setEnabled(!enable);
firstheaderBorderAboveCB->setEnabled(!enable);
firstheaderBorderBelowCB->setEnabled(!enable);
changed();
}
@ -529,9 +521,6 @@ void GuiTabular::ltFooterStatus_clicked()
set(Tabular::SET_LTFOOT, "");
else
set(Tabular::UNSET_LTFOOT, "");
footerBorderAboveCB->setEnabled(enable);
footerBorderBelowCB->setEnabled(enable);
lastfooterNoContentsCB->setEnabled(enable);
changed();
}
@ -563,8 +552,6 @@ void GuiTabular::ltLastFooterStatus_clicked()
set(Tabular::SET_LTLASTFOOT, "");
else
set(Tabular::UNSET_LTLASTFOOT, "");
lastfooterBorderAboveCB->setEnabled(enable);
lastfooterBorderBelowCB->setEnabled(enable);
changed();
}
@ -596,9 +583,6 @@ void GuiTabular::ltLastFooterEmpty_clicked()
set(Tabular::SET_LTLASTFOOT, "empty");
else
set(Tabular::UNSET_LTLASTFOOT, "empty");
lastfooterStatusCB->setEnabled(!enable);
lastfooterBorderAboveCB->setEnabled(!enable);
lastfooterBorderBelowCB->setEnabled(!enable);
changed();
}
@ -838,12 +822,7 @@ void GuiTabular::updateContents()
// first header can only be suppressed when there is a header
firstheaderNoContentsCB->setEnabled(tabular_.haveLTHead()
&& !tabular_.haveLTFirstHead());
// check if setting a first header is allowed
// additionally check firstheaderStatusCB because when this is the
// case a first header makes no sense
firstheaderStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTFIRSTHEAD)
&& !firstheaderNoContentsCB->isChecked());
//firstheaderStatusCB->setEnabled(
// !firstheaderNoContentsCB->isChecked());
headerBorderAboveCB->setEnabled(funcEnabled(Tabular::SET_LTHEAD));
@ -859,12 +838,7 @@ void GuiTabular::updateContents()
// last footer can only be suppressed when there is a footer
lastfooterNoContentsCB->setEnabled(tabular_.haveLTFoot()
&& !tabular_.haveLTLastFoot());
// check if setting a last footer is allowed
// additionally check lastfooterNoContentsCB because when this is
// the case a last footer makes no sense
lastfooterStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTLASTFOOT)
&& !lastfooterNoContentsCB->isChecked());
captionStatusCB->setEnabled(
funcEnabled(Tabular::TOGGLE_LTCAPTION));
// When a row is set as longtable caption, it must not be allowed
@ -890,6 +864,12 @@ void GuiTabular::updateContents()
}
row_set = tabular_.getRowOfLTFirstHead(row, ltt);
// check if setting a first header is allowed
// additionally check firstheaderStatusCB because when this is the
// case a first header makes no sense
firstheaderStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTFIRSTHEAD)
&& !firstheaderNoContentsCB->isChecked());
firstheaderStatusCB->setChecked(row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
firstheaderBorderAboveCB->setChecked(ltt.topDL);
@ -922,6 +902,12 @@ void GuiTabular::updateContents()
}
row_set = tabular_.getRowOfLTLastFoot(row, ltt);
// check if setting a last footer is allowed
// additionally check lastfooterNoContentsCB because when this is
// the case a last footer makes no sense
lastfooterStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTLASTFOOT)
&& !lastfooterNoContentsCB->isChecked());
lastfooterStatusCB->setChecked(row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
lastfooterBorderAboveCB->setChecked(ltt.topDL);