From 497d6d13f74e3a3513cd5d075832225a93771af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Thu, 4 Mar 2010 03:27:30 +0000 Subject: [PATCH] InsetTabular.cpp: disallow the following cases: - a multirow cannot be a multicolumn the same time - a multirow cannot be the caption of a longtable git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33614 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 2b6e6c51c1..b219a9fa78 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -4063,16 +4063,20 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, case Tabular::MULTICOLUMN: // If a row is set as longtable caption, it must not be allowed // to unset that this row is a multicolumn. + // don't allow to set a multirow as multicolumn status.setEnabled(sel_row_start == sel_row_end - && !tabular.ltCaption(tabular.cellRow(cur.idx()))); + && !tabular.ltCaption(tabular.cellRow(cur.idx())) + && !tabular.isMultiRow(cur.idx()) ); status.setOnOff(tabular.isMultiColumn(cur.idx())); break; case Tabular::MULTIROW: // If a row is set as longtable caption, it must not be allowed // to unset that this row is a multirow. + // don't allow to set a multicolumn as multirow status.setEnabled(sel_col_start == sel_col_end - && !tabular.ltCaption(tabular.cellRow(cur.idx()))); + && !tabular.ltCaption(tabular.cellRow(cur.idx())) + && !tabular.isMultiColumn(cur.idx()) ); status.setOnOff(tabular.isMultiRow(cur.idx())); break; @@ -4258,6 +4262,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, break; // only one row can be the caption + // and a multirow cannot be set as caption case Tabular::TOGGLE_LTCAPTION: status.setEnabled(sel_row_start == sel_row_end && !tabular.getRowOfLTFirstHead(sel_row_start, dummyltt) @@ -4265,7 +4270,8 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, && !tabular.getRowOfLTFoot(sel_row_start, dummyltt) && !tabular.getRowOfLTLastFoot(sel_row_start, dummyltt) && (!tabular.haveLTCaption() - || tabular.ltCaption(sel_row_start))); + || tabular.ltCaption(sel_row_start)) + && !tabular.isMultiRow(sel_row_start)); status.setOnOff(tabular.ltCaption(sel_row_start)); break;