commit fc6b7ede9c93b93398c51e34d945122c66953ed6
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Tue Oct 27 16:48:29 2015 +0100
Disable setting vertical lines when using a formal table
The code in InsetTabular disables the toolbar icons and menu entries
related to vertical lines.
The code in GuiTabular disables vertical lines in the Settings dialog.
Note that there was a bug in
GuiSetBorders::set(Left|Right|Top|Bottom)Enabled, where the borders
did not get drawn correctly.
Fixes bug #9816
diff --git a/src/frontends/qt4/GuiSetBorder.cpp
b/src/frontends/qt4/GuiSetBorder.cpp
index d3f72a6..80a7d74 100644
--- a/src/frontends/qt4/GuiSetBorder.cpp
+++ b/src/frontends/qt4/GuiSetBorder.cpp
@@ -151,31 +151,31 @@ void GuiSetBorder::drawBottom(bool draw)
}
-void GuiSetBorder::setLeftEnabled(bool border)
+void GuiSetBorder::setLeftEnabled(bool enabled)
{
- left_.enabled = border;
- drawLeft(border);
+ left_.enabled = enabled;
+ drawLeft(left_.set);
}
-void GuiSetBorder::setRightEnabled(bool border)
+void GuiSetBorder::setRightEnabled(bool enabled)
{
- right_.enabled = border;
- drawRight(border);
+ right_.enabled = enabled;
+ drawRight(right_.set);
}
-void GuiSetBorder::setTopEnabled(bool border)
+void GuiSetBorder::setTopEnabled(bool enabled)
{
- top_.enabled = border;
- drawTop(border);
+ top_.enabled = enabled;
+ drawTop(top_.set);
}
-void GuiSetBorder::setBottomEnabled(bool border)
+void GuiSetBorder::setBottomEnabled(bool enabled)
{
- bottom_.enabled = border;
- drawBottom(border);
+ bottom_.enabled = enabled;
+ drawBottom(bottom_.set);
}
diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp
index 312b14f..e88172f 100644
--- a/src/frontends/qt4/GuiTabular.cpp
+++ b/src/frontends/qt4/GuiTabular.cpp
@@ -321,6 +321,10 @@ void GuiTabular::checkEnabled()
multirowOffsetED->setEnabled(enable_mr);
multirowOffsetUnitLC->setEnabled(enable_mr);
+ // Vertical lines cannot be set in formal tables
+ borders->setLeftEnabled(!booktabsRB->isChecked());
+ borders->setRightEnabled(!booktabsRB->isChecked());
+
changed();
}
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 3013db7..1ba5eff 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -4622,9 +4622,13 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest
const & cmd,
case Tabular::SET_LINE_TOP:
case Tabular::SET_LINE_BOTTOM:
+
status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ break;
+
case Tabular::SET_LINE_LEFT:
case Tabular::SET_LINE_RIGHT:
-
status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.use_booktabs
+ &&
!tabular.ltCaption(tabular.cellRow(cur.idx())));
break;
case Tabular::TOGGLE_LINE_TOP:
@@ -4638,12 +4642,14 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest
const & cmd,
break;
case Tabular::TOGGLE_LINE_LEFT:
-
status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.use_booktabs
+ &&
!tabular.ltCaption(tabular.cellRow(cur.idx())));
status.setOnOff(tabular.leftLine(cur.idx()));
break;
case Tabular::TOGGLE_LINE_RIGHT:
-
status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.use_booktabs
+ &&
!tabular.ltCaption(tabular.cellRow(cur.idx())));
status.setOnOff(tabular.rightLine(cur.idx()));
break;
diff --git a/status.21x b/status.21x
index a8de5c8..14163e4 100644
--- a/status.21x
+++ b/status.21x
@@ -94,7 +94,9 @@ What's new
- Fix a crash with the outliner when switching documents (bug 9754).
- Repaired selection of text and search-and-replace in the presence of math
- macros. The selection is no longer cleared unvolontarily. (bugs 6078, 9364)
+ macros. The selection is no longer cleared unvolontarily (bugs 6078, 9364).
+
+- Disable setting vertical lines when using a formal table (bug 9816).
* INTERNALS