From b9df3d88c958e85454a6d1888c4b20913a59a858 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Wed, 11 Feb 2009 03:18:16 +0000 Subject: [PATCH] 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 --- src/insets/InsetTabular.cpp | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index a966d40164..35eebc3b86 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3900,22 +3900,19 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, status.setOnOff(convert(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; -- 2.39.2