Table dialog: Fix enabling/disabling of first header and last footer

check boxes.
This should fix bug #7008


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35993 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-11-02 13:35:16 +00:00
parent 90eb28d85a
commit 3142a62c7a
2 changed files with 19 additions and 14 deletions

View File

@ -197,10 +197,7 @@ void GuiTabular::checkEnabled()
headerBorderBelowCB->setEnabled(longtabular
&& headerStatusCB->isChecked());
// first header can only be suppressed when there is a header
// FIXME: old code also checked for
// tabular.haveLTHead() && !tabular.haveLTFirstHead());
firstheaderNoContentsCB->setEnabled(longtabular);
firstheaderNoContentsCB->setEnabled(longtabular && firstheader_suppressable_);
// check if setting a first header is allowed
// additionally check firstheaderNoContentsCB because when this is
// the case a first header makes no sense
@ -217,10 +214,7 @@ void GuiTabular::checkEnabled()
footerBorderBelowCB->setEnabled(longtabular
&& footerBorderAboveCB->isChecked());
// last footer can only be suppressed when there is a footer
// FIXME: old code also checked for
// tabular.haveLTFoot() && !tabular.haveLTLastFoot());
lastfooterNoContentsCB->setEnabled(longtabular);
lastfooterNoContentsCB->setEnabled(longtabular && lastfooter_suppressable_);
// check if setting a last footer is allowed
// additionally check lastfooterNoContentsCB because when this is
// the case a last footer makes no sense
@ -855,6 +849,13 @@ void GuiTabular::paramsToDialog(Inset const * inset)
}
newpageCB->setChecked(tabular.getLTNewPage(row));
// first header can only be suppressed when there is a header
firstheader_suppressable_ = tabular.haveLTHead()
&& !tabular.haveLTFirstHead();
// last footer can only be suppressed when there is a footer
lastfooter_suppressable_ = tabular.haveLTFoot()
&& !tabular.haveLTLastFoot();
// after setting the features, check if they are enabled
checkEnabled();
}

View File

@ -53,6 +53,10 @@ private:
void setWidthAndAlignment();
///
bool funcEnabled(Tabular::Feature f) const;
///
bool firstheader_suppressable_;
///
bool lastfooter_suppressable_;
};
} // namespace frontend