Le 16/12/2015 13:30, Jean-Marc Lasgouttes a écrit :
Le 11/12/2015 23:36, Guillaume Munch a écrit :
Dear list,
Following the discussions in <http://www.lyx.org/trac/ticket/9794>, here
are a series of patches meant to address #9794 (inset-modify tabular
commands are incorrectly disabled) and #4189 (Edit->Rows&Columns not
shown when in mathed insert).
Dear Guillaume,
I do not have time right now to look at the patch, but I do not like the
'tricks' to avoid renaming icons. The easiest way out would probably be
to rename to the original tabular-features LFUN name.
Here's a version with tabular-feature instead of table-modify (and no
change to Shortcuts.lyx given that the docs are now frozen).
Guillaume
>From 4d6feb4354bff0067d82ba82cd71f3b30df11862 Mon Sep 17 00:00:00 2001
From: Guillaume Munch <g...@lyx.org>
Date: Fri, 11 Dec 2015 02:15:52 +0000
Subject: [PATCH 1/3] New LFUN tabular-features (#9794)
The tabular-features LFUN was merged with "inset-modify tabular" when
simplifying the tabular dialog at b5049e7. This choice later indirectly caused a
few regressions (#7308, #9794).
I reintroduce tabular-feature to allow more flexibility for user
commands, whereas "inset-modify tabular" is now reserved for the tabular
dialog. In particular, inset-modify tabular is no longer caught by math grid
insets. The name tabular-feature is kept to avoid renaming icons.
Known issues:
* After successfully applying a tabular command, the cursor is truncated to the
table.
* Note that the tabular dialog still has similar issues that are inherited from
the achitecture of the dialog menu. For instance the pref change can be
mis-dispatched to an inset inside a cell and cause an error, for instance:
Lexer.cpp (934): Missing 'Note'-tag in InsetNote::string2params. Got
tabular instead. Line: 0
Maybe the inset-modify LFUN should be modified to treat commands coming from
the wrong dialog (by checking the type) as unknown and undispatched so that
the parent can get it. In that case a non AtPoint variant of inset-modify
could be reintroduced in order to generalise tabular-feature.
---
src/FuncCode.h | 1 +
src/LyXAction.cpp | 25 ++++++++-----
src/frontends/qt4/GuiApplication.cpp | 11 +++---
src/frontends/qt4/GuiTabular.cpp | 7 ++--
src/insets/Inset.cpp | 2 --
src/insets/InsetTabular.cpp | 70 +++++++++++++++++++++---------------
src/insets/InsetTabular.h | 3 ++
src/mathed/InsetMathAMSArray.cpp | 9 ++---
src/mathed/InsetMathCases.cpp | 18 +++-------
src/mathed/InsetMathGrid.cpp | 27 +++++---------
src/mathed/InsetMathHull.cpp | 9 ++---
src/mathed/InsetMathSplit.cpp | 12 +++----
src/mathed/InsetMathSubstack.cpp | 16 +++------
13 files changed, 95 insertions(+), 115 deletions(-)
diff --git a/src/FuncCode.h b/src/FuncCode.h
index 66f57c0..40ec9d3 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -464,6 +464,7 @@ enum FuncCode
LFUN_BUFFER_MOVE_NEXT, // skostysh 20150408
// 340
LFUN_BUFFER_MOVE_PREVIOUS, // skostysh 20150408
+ LFUN_TABULAR_FEATURE, // gm, 20151210
LFUN_LASTACTION // end of the table
};
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 4467219..1e83905 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -2167,7 +2167,7 @@ void LyXAction::init()
/*!
* \var lyx::FuncCode lyx::LFUN_TABULAR_INSERT
* \li Action: Inserts table into the document.
- * \li Notion: See #LFUN_INSET_MODIFY for some more details
+ * \li Notion: See #LFUN_TABULAR_FEATURE for some more details
about tabular modifications.
* \li Syntax: tabular-insert [<ROWS> <COLUMNS>]
* \li Params: In case no arguments are given show insert dialog.
@@ -2462,11 +2462,17 @@ void LyXAction::init()
ref, space, tabular, vspace, wrap insets.
* \li Syntax: inset-modify <INSET> <ARGS>
* \li Syntax: inset-modify changetype <TYPE>
- * \li Syntax: inset-modify tabular <FEATURE> [<ARG>]
+ * \li Sample: inset-modify note Note Comment \n
+ inset-modify changetype Ovalbox
+ * \endvar
+ */
+ { LFUN_INSET_MODIFY, "inset-modify", AtPoint, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_TABULAR_FEATURE
+ * \li Action: Modify properties of tabulars and table-like math environments.
+ * \li Syntax: tabular-feature <FEATURE> [<ARG>]
* \li Params: Generally see #LFUN_INSET_INSERT for further details.\n
- In case that <INSET> is "tabular" various math-environment features
- are handled as well, e.g. add-vline-left/right for the Grid/Array environment.\n
- <FEATURE>: append-row|append-column|delete-row|delete-column|copy-row|\n
+ * <FEATURE>: append-row|append-column|delete-row|delete-column|copy-row|\n
copy-column|move-column-right|move-column-left|move-row-down|move-row-up|\n
toggle-line-top|toggle-line-bottom|toggle-line-left|toggle-line-right|\n
align-left|align-right|align-center|align-block|align-decimal|set-decimal-point|\n
@@ -2481,13 +2487,14 @@ void LyXAction::init()
set-special-column|set-special-multicolumn|set-special-multirow|\n
toggle-booktabs|set-booktabs|unset-booktabs|set-top-space|set-bottom-space|\n
set-interline-space|set-border-lines|tabular-valign-top|\n
- tabular-valign-middle|tabular-valign-bottom|set-tabular-width
+ tabular-valign-middle|tabular-valign-bottom|set-tabular-width\n
+ Various math-environment features are handled as well, e.g. add-vline-left/right for\n
+ the Grid/Array environment.\n
<ARG>: additional argument for some commands, use debug mode to explore its values.
- * \li Sample: inset-modify note Note Comment \n
- inset-modify changetype Ovalbox
+ * \li Origin: gm, 10 Dec 2015
* \endvar
*/
- { LFUN_INSET_MODIFY, "inset-modify", AtPoint, Edit },
+ { LFUN_TABULAR_FEATURE, "tabular-feature", Noop, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_INSET_DIALOG_UPDATE
* \li Action: Updates the values inside the dialog from the inset.
diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp
index 4b6e769..82bbd60 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -486,19 +486,18 @@ QString iconName(FuncRequest const & f, bool unknown)
docstring firstcom;
docstring dummy = split(f.argument(), firstcom, ';');
name1 = toqstr(firstcom);
- // FIXME: we should rename the icons to tabular-xxx instead of
- // "tabular-feature-xxx"
+ // FIXME: we should remove all references to "inset-modify tabular"
+ // icons and shortcuts in all manuals
name1.replace("inset-modify tabular", "tabular-feature");
name1.replace(' ', '_');
break;
}
case LFUN_INSET_MODIFY: {
- // FIXME: we should rename the icons to tabular-xxx instead of
- // "tabular-feature-xxx" and generalize this naming to all
- // insets, not to tabular using ones.
+ // FIXME: we should remove all references to "inset-modify tabular"
+ // icons and shortcuts in all manuals
string inset_name;
string const command = split(to_utf8(f.argument()), inset_name, ' ');
- if (insetCode(inset_name) == TABULAR_CODE) {
+ if (inset_name == "tabular") {
name1 = "tabular-feature "+ toqstr(command);
name1.replace(' ', '_');
break;
diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp
index 495b2c6..fde382b 100644
--- a/src/frontends/qt4/GuiTabular.cpp
+++ b/src/frontends/qt4/GuiTabular.cpp
@@ -447,8 +447,7 @@ void GuiTabular::setTableAlignment(string & param_str) const
docstring GuiTabular::dialogToParams() const
{
- // FIXME: We should use Tabular directly.
- string param_str = "tabular from-dialog";
+ string param_str = "tabular";
// table width
string tabwidth = widgetsToLength(tabularWidthED, tabularWidthUnitLC);
@@ -1070,8 +1069,8 @@ bool GuiTabular::checkWidgets(bool readonly) const
bool GuiTabular::funcEnabled(Tabular::Feature f) const
{
- string cmd = "tabular " + featureAsString(f);
- return getStatus(FuncRequest(LFUN_INSET_MODIFY, cmd)).enabled();
+ FuncRequest r(LFUN_INSET_MODIFY, "tabular for-dialog" + featureAsString(f));
+ return getStatus(r).enabled();
}
diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index 0fce648..f85b1a9 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -391,8 +391,6 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
// FIXME: Why don't we let the insets determine whether this
// should be enabled or not ? Now we need this check for
// the tabular features. (vfr)
- if (cmd.getArg(0) == "tabular")
- return false;
flag.setEnabled(true);
return true;
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 437ac7e..e2a125f 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -110,6 +110,8 @@ TabularFeature tabularFeature[] =
{
// the SET/UNSET actions are used by the table dialog,
// the TOGGLE actions by the table toolbar buttons
+ // FIXME: these values have been hardcoded in InsetMathGrid and other
+ // math insets.
{ Tabular::APPEND_ROW, "append-row", false },
{ Tabular::APPEND_COLUMN, "append-column", false },
{ Tabular::DELETE_ROW, "delete-row", false },
@@ -4299,11 +4301,16 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
case LFUN_INSET_MODIFY: {
+ // we come from the dialog
string arg;
- if (cmd.getArg(1) == "from-dialog")
- arg = cmd.getArg(0) + to_utf8(cmd.argument().substr(19));
- else
- arg = to_utf8(cmd.argument());
+ if (cmd.getArg(0) != "tabular"
+ || !tabularFeatures(cur, arg = cmd.getLongArg(1)))
+ cur.undispatched();
+ break;
+ }
+
+ case LFUN_TABULAR_FEATURE: {
+ string arg = to_utf8(cmd.argument());
if (!tabularFeatures(cur, arg))
cur.undispatched();
break;
@@ -4474,25 +4481,9 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
}
-// function sets an object as defined in func_status.h:
-// states OK, Unknown, Disabled, On, Off.
-bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
- FuncStatus & status) const
+bool InsetTabular::getActionStatus(Cursor & cur, string const & s,
+ string const & argument, FuncStatus & status) const
{
- switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- if (&cur.inset() != this || cmd.getArg(0) != "tabular")
- break;
-
- // FIXME: We only check for the very first argument...
- string const s = cmd.getArg(1);
- // We always enable the lfun if it is coming from the dialog
- // because the dialog makes sure all the settings are valid,
- // even though the first argument might not be valid now.
- if (s == "from-dialog") {
- status.setEnabled(true);
- return true;
- }
int action = Tabular::LAST_ACTION;
int i = 0;
@@ -4508,8 +4499,6 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
return true;
}
- string const argument = cmd.getLongArg(2);
-
row_type sel_row_start = 0;
row_type sel_row_end = 0;
col_type sel_col_start = 0;
@@ -4884,6 +4873,35 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
break;
}
return true;
+}
+
+
+// function sets an object as defined in func_status.h:
+// states OK, Unknown, Disabled, On, Off.
+bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const
+{
+ switch (cmd.action()) {
+ case LFUN_INSET_MODIFY:
+ if (cmd.getArg(0) == "tabular") {
+ if (cmd.getArg(1) == "for-dialog") {
+ if (&cur.inset() != this)
+ break;
+ string action = cmd.getArg(2);
+ string arg = cmd.getLongArg(3);
+ return getActionStatus(cur, action, arg, status);
+ } else {
+ status.setEnabled(true);
+ return true;
+ }
+ }
+
+ case LFUN_TABULAR_FEATURE: {
+ if (&cur.inset() != this)
+ break;
+ string action = cmd.getArg(0);
+ string arg = cmd.getLongArg(1);
+ return getActionStatus(cur, action, arg, status);
}
case LFUN_CAPTION_INSERT: {
@@ -5315,10 +5333,6 @@ bool InsetTabular::tabularFeatures(Cursor & cur, string const & argument)
{
istringstream is(argument);
string s;
- is >> s;
- if (insetCode(s) != TABULAR_CODE)
- return false;
-
// Safe guard.
size_t safe_guard = 0;
for (;;) {
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index d9b7fa4..511d929 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -996,6 +996,9 @@ private:
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
+ bool getActionStatus(Cursor & cur, std::string const & s,
+ std::string const & argument, FuncStatus & status) const;
+ ///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
///
Inset * clone() const { return new InsetTabular(*this); }
diff --git a/src/mathed/InsetMathAMSArray.cpp b/src/mathed/InsetMathAMSArray.cpp
index 12a92da..13d7a94 100644
--- a/src/mathed/InsetMathAMSArray.cpp
+++ b/src/mathed/InsetMathAMSArray.cpp
@@ -107,13 +107,8 @@ bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular")
- break;
- is >> s;
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
diff --git a/src/mathed/InsetMathCases.cpp b/src/mathed/InsetMathCases.cpp
index 17b4fb1..b7a4aa1 100644
--- a/src/mathed/InsetMathCases.cpp
+++ b/src/mathed/InsetMathCases.cpp
@@ -71,13 +71,8 @@ void InsetMathCases::doDispatch(Cursor & cur, FuncRequest & cmd)
{
//lyxerr << "*** InsetMathCases: request: " << cmd << endl;
switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular")
- break;
- is >> s;
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
// vertical lines and adding/deleting columns is not allowed for \cases
if (s == "append-column" || s == "delete-column"
|| s == "add-vline-left" || s == "add-vline-right") {
@@ -97,13 +92,8 @@ bool InsetMathCases::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular")
- break;
- is >> s;
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
if (s == "add-vline-left" || s == "add-vline-right") {
flag.setEnabled(false);
flag.message(bformat(
diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 8ea3940..b25584d 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -181,7 +181,7 @@ void InsetMathGrid::setDefaults()
bool InsetMathGrid::interpretString(Cursor & cur, docstring const & str)
{
if (str == "\\hline") {
- FuncRequest fr = FuncRequest(LFUN_INSET_MODIFY, "tabular add-hline-above");
+ FuncRequest fr = FuncRequest(LFUN_TABULAR_FEATURE, "add-hline-above");
FuncStatus status;
if (getStatus(cur, fr, status)) {
if (status.enabled()) {
@@ -1449,17 +1449,12 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
}
- case LFUN_INSET_MODIFY: {
+ case LFUN_TABULAR_FEATURE: {
cur.recordUndoInset();
- //lyxerr << "handling tabular-feature " << to_utf8(cmd.argument()) << endl;
+ //lyxerr << "handling table-modify " << to_utf8(cmd.argument()) << endl;
istringstream is(to_utf8(cmd.argument()));
string s;
is >> s;
- if (s != "tabular") {
- InsetMathNest::doDispatch(cur, cmd);
- return;
- }
- is >> s;
if (s == "valign-top")
setVerticalAlignment('t');
else if (s == "valign-middle")
@@ -1596,7 +1591,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
}
bool hline_enabled = false;
- FuncRequest fr = FuncRequest(LFUN_INSET_MODIFY, "tabular add-hline-above");
+ FuncRequest fr = FuncRequest(LFUN_TABULAR_FEATURE, "add-hline-above");
FuncStatus status;
if (getStatus(cur, fr, status))
hline_enabled = status.enabled();
@@ -1726,14 +1721,8 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular") {
- // We only now about table actions here.
- break;
- }
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
if (&cur.inset() != this) {
// Table actions requires that the cursor is _inside_ the
// table.
@@ -1741,7 +1730,6 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
status.message(from_utf8(N_("Cursor not in table")));
return true;
}
- is >> s;
if (nrows() <= 1 && (s == "delete-row" || s == "swap-row")) {
status.setEnabled(false);
status.message(from_utf8(N_("Only one row")));
@@ -1796,7 +1784,8 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
} else {
status.setEnabled(false);
status.message(bformat(
- from_utf8(N_("Unknown tabular feature '%1$s'")), lyx::from_ascii(s)));
+ from_utf8(N_("Unknown tabular feature '%1$s'")),
+ from_utf8(s)));
}
#if 0
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 097a344..5b884b4 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1816,13 +1816,8 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd,
}
return InsetMathGrid::getStatus(cur, cmd, status);
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular")
- return InsetMathGrid::getStatus(cur, cmd, status);
- is >> s;
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
if (!rowChangeOK()
&& (s == "append-row"
|| s == "delete-row"
diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp
index 5c425fb..2adb845 100644
--- a/src/mathed/InsetMathSplit.cpp
+++ b/src/mathed/InsetMathSplit.cpp
@@ -73,16 +73,12 @@ bool InsetMathSplit::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular")
- break;
- is >> s;
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bformat(
- from_utf8(N_("Can't add vertical grid lines in '%1$s'")), name_));
+ from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
+ name_));
flag.setEnabled(false);
return true;
}
diff --git a/src/mathed/InsetMathSubstack.cpp b/src/mathed/InsetMathSubstack.cpp
index 7810ff4..f88f492 100644
--- a/src/mathed/InsetMathSubstack.cpp
+++ b/src/mathed/InsetMathSubstack.cpp
@@ -63,27 +63,21 @@ bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular")
- break;
- is >> s;
- string const name = "substack";
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
- from_utf8(name)));
+ from_utf8("substack")));
flag.setEnabled(false);
return true;
}
- // in contrary to \subaray, the columns in \substack
+ // in contrary to \subarray, the columns in \substack
// are always centered and this cannot be changed
if (s == "align-left" || s == "align-right") {
flag.message(bformat(
from_utf8(N_("Can't change horizontal alignment in '%1$s'")),
- from_utf8(name)));
+ from_utf8("substack")));
flag.setEnabled(false);
return true;
}
--
2.1.4
>From 61a517183e8656bb04da444dfee186cfd34330d2 Mon Sep 17 00:00:00 2001
From: Guillaume Munch <g...@lyx.org>
Date: Fri, 11 Dec 2015 03:08:33 +0000
Subject: [PATCH 2/3] Add table-modify to prefs and docs
* Replace "inset-modify tabular" with "tabular-feature" in bind and ui files.
* Update prefs2prefs.py
* Regenerate LFUNs.lyx
TODO still: Replace "inset-modify tabular" with "tabular-features" before
release, so that the artifical mapping of icon names in GuiApplication.cpp can
be removed.
---
lib/bind/aqua.bind | 50 +++++------
lib/bind/cua.bind | 8 +-
lib/bind/emacs.bind | 8 +-
lib/bind/mac.bind | 8 +-
lib/bind/math.bind | 44 +++++-----
lib/bind/sciword.bind | 8 +-
lib/bind/xemacs.bind | 8 +-
lib/doc/LFUNs.lyx | 176 ++++++++++++++++++++++-----------------
lib/scripts/prefs2prefs_lfuns.py | 7 +-
lib/ui/stdcontext.inc | 72 ++++++++--------
lib/ui/stdmenus.inc | 80 +++++++++---------
lib/ui/stdtoolbars.inc | 60 ++++++-------
12 files changed, 279 insertions(+), 250 deletions(-)
diff --git a/lib/bind/aqua.bind b/lib/bind/aqua.bind
index 8ce7945..239ca5a 100644
--- a/lib/bind/aqua.bind
+++ b/lib/bind/aqua.bind
@@ -91,28 +91,28 @@ Format 3
\bind "M-~S-e x l" "primary-selection-paste"
\bind "M-~S-e x p" "primary-selection-paste paragraph"
-\bind "M-~S-e t m" "inset-modify tabular multicolumn"
-\bind "M-~S-e t t" "inset-modify tabular toggle-line-top"
-\bind "M-~S-e t b" "inset-modify tabular toggle-line-bottom"
-\bind "M-~S-e t l" "inset-modify tabular toggle-line-left"
-\bind "M-~S-e t r" "inset-modify tabular toggle-line-right"
-\bind "M-~S-e t e" "inset-modify tabular align-left"
-\bind "M-~S-e t c" "inset-modify tabular align-center"
-\bind "M-~S-e t i" "inset-modify tabular align-right"
-\bind "M-~S-e t o" "inset-modify tabular valign-top"
-\bind "M-~S-e t n" "inset-modify tabular valign-center"
-\bind "M-~S-e t v" "inset-modify tabular valign-bottom"
-\bind "M-~S-e t a" "inset-modify tabular append-row"
-\bind "M-~S-e t w" "inset-modify tabular delete-row"
-\bind "M-~S-e t u" "inset-modify tabular append-column"
-\bind "M-~S-e t d" "inset-modify tabular delete-column"
+\bind "M-~S-e t m" "tabular-feature multicolumn"
+\bind "M-~S-e t t" "tabular-feature toggle-line-top"
+\bind "M-~S-e t b" "tabular-feature toggle-line-bottom"
+\bind "M-~S-e t l" "tabular-feature toggle-line-left"
+\bind "M-~S-e t r" "tabular-feature toggle-line-right"
+\bind "M-~S-e t e" "tabular-feature align-left"
+\bind "M-~S-e t c" "tabular-feature align-center"
+\bind "M-~S-e t i" "tabular-feature align-right"
+\bind "M-~S-e t o" "tabular-feature valign-top"
+\bind "M-~S-e t n" "tabular-feature valign-center"
+\bind "M-~S-e t v" "tabular-feature valign-bottom"
+\bind "M-~S-e t a" "tabular-feature append-row"
+\bind "M-~S-e t w" "tabular-feature delete-row"
+\bind "M-~S-e t u" "tabular-feature append-column"
+\bind "M-~S-e t d" "tabular-feature delete-column"
\bind "M-~S-e m n" "math-number-toggle"
\bind "M-~S-e m u" "math-number-line-toggle"
-\bind "M-~S-e m r" "inset-modify tabular append-row"
-\bind "M-~S-e m d" "inset-modify tabular delete-row"
-\bind "M-~S-e m c" "inset-modify tabular append-column"
-\bind "M-~S-e m e" "inset-modify tabular delete-column"
+\bind "M-~S-e m r" "tabular-feature append-row"
+\bind "M-~S-e m d" "tabular-feature delete-row"
+\bind "M-~S-e m c" "tabular-feature append-column"
+\bind "M-~S-e m e" "tabular-feature delete-column"
\bind "M-~S-e m l t" "math-limits empty"
\bind "M-~S-e m l d" "math-limits limits"
@@ -124,12 +124,12 @@ Format 3
\bind "M-~S-e m f a" "math-mutate align"
\bind "M-~S-e m f f" "math-mutate flalign"
-\bind "M-~S-e m a l" "inset-modify tabular align-left"
-\bind "M-~S-e m a c" "inset-modify tabular align-center"
-\bind "M-~S-e m a r" "inset-modify tabular align-right"
-\bind "M-~S-e m a t" "inset-modify tabular valign-top"
-\bind "M-~S-e m a e" "inset-modify tabular valign-center"
-\bind "M-~S-e m a b" "inset-modify tabular valign-bottom"
+\bind "M-~S-e m a l" "tabular-feature align-left"
+\bind "M-~S-e m a c" "tabular-feature align-center"
+\bind "M-~S-e m a r" "tabular-feature align-right"
+\bind "M-~S-e m a t" "tabular-feature valign-top"
+\bind "M-~S-e m a e" "tabular-feature valign-center"
+\bind "M-~S-e m a b" "tabular-feature valign-bottom"
\bind "M-~S-v l" "latex-view-log"
\bind "M-~S-v t" "toc-view"
diff --git a/lib/bind/cua.bind b/lib/bind/cua.bind
index ff92336..83792b5 100644
--- a/lib/bind/cua.bind
+++ b/lib/bind/cua.bind
@@ -131,10 +131,10 @@ Format 3
# Motion group
#
-\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up"
-\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down"
-\bind "M-Right" "inset-modify tabular move-column-right"
-\bind "M-Left" "inset-modify tabular move-column-left"
+\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; tabular-feature move-row-up"
+\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; tabular-feature move-row-down"
+\bind "M-Right" "tabular-feature move-column-right"
+\bind "M-Left" "tabular-feature move-column-left"
\bind "C-Right" "word-right"
\bind "C-Left" "word-left"
\bind "C-Up" "paragraph-up"
diff --git a/lib/bind/emacs.bind b/lib/bind/emacs.bind
index 8c8421d..f4cf5ca 100644
--- a/lib/bind/emacs.bind
+++ b/lib/bind/emacs.bind
@@ -154,10 +154,10 @@ Format 3
# Motion group
#
-\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up"
-\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down"
-\bind "M-Right" "inset-modify tabular move-column-right"
-\bind "M-Left" "inset-modify tabular move-column-left"
+\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; tabular-feature move-row-up"
+\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; tabular-feature move-row-down"
+\bind "M-Right" "tabular-feature move-column-right"
+\bind "M-Left" "tabular-feature move-column-left"
\bind "C-Right" "word-right"
\bind "C-Left" "word-left"
\bind "C-Up" "paragraph-up"
diff --git a/lib/bind/mac.bind b/lib/bind/mac.bind
index 5354dd8..ff5e0b4 100644
--- a/lib/bind/mac.bind
+++ b/lib/bind/mac.bind
@@ -358,10 +358,10 @@ Format 3
\bind "C-period" "specialchar-insert end-of-sentence"
\bind "M-period" "specialchar-insert dots"
\bind "Escape" "cancel"
-\bind "C-M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up"
-\bind "C-M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down"
-\bind "C-M-Right" "inset-modify tabular move-column-right"
-\bind "C-M-Left" "inset-modify tabular move-column-left"
+\bind "C-M-Up" "command-alternatives outline-up; paragraph-move-up; tabular-feature move-row-up"
+\bind "C-M-Down" "command-alternatives outline-down; paragraph-move-down; tabular-feature move-row-down"
+\bind "C-M-Right" "tabular-feature move-column-right"
+\bind "C-M-Left" "tabular-feature move-column-left"
#\bind "F9" "meta-prefix"
\bind "C-M-F" "ui-toggle fullscreen"
diff --git a/lib/bind/math.bind b/lib/bind/math.bind
index 6d6c390..1e7b813 100644
--- a/lib/bind/math.bind
+++ b/lib/bind/math.bind
@@ -75,30 +75,30 @@ Format 3
\bind "M-m t e" "math-mutate eqnarray"
\bind "M-m t m" "math-mutate multline"
-\bind "M-m c i" "inset-modify tabular append-column"
-\bind "M-m c d" "inset-modify tabular delete-column"
-\bind "M-m c c" "inset-modify tabular copy-column"
-\bind "M-m c s" "inset-modify tabular swap-column"
-\bind "M-m c a" "inset-modify tabular add-vline-left"
-\bind "M-m c e" "inset-modify tabular delete-vline-left"
-\bind "M-m c z" "inset-modify tabular add-vline-right"
-\bind "M-m c x" "inset-modify tabular delete-vline-right"
+\bind "M-m c i" "tabular-feature append-column"
+\bind "M-m c d" "tabular-feature delete-column"
+\bind "M-m c c" "tabular-feature copy-column"
+\bind "M-m c s" "tabular-feature swap-column"
+\bind "M-m c a" "tabular-feature add-vline-left"
+\bind "M-m c e" "tabular-feature delete-vline-left"
+\bind "M-m c z" "tabular-feature add-vline-right"
+\bind "M-m c x" "tabular-feature delete-vline-right"
-\bind "M-m w i" "inset-modify tabular append-row"
-\bind "M-m w d" "inset-modify tabular delete-row"
-\bind "M-m w c" "inset-modify tabular copy-row"
-\bind "M-m w s" "inset-modify tabular swap-row"
-\bind "M-m w a" "inset-modify tabular add-hline-above"
-\bind "M-m w e" "inset-modify tabular delete-hline-above"
-\bind "M-m w z" "inset-modify tabular add-hline-below"
-\bind "M-m w x" "inset-modify tabular delete-hline-below"
+\bind "M-m w i" "tabular-feature append-row"
+\bind "M-m w d" "tabular-feature delete-row"
+\bind "M-m w c" "tabular-feature copy-row"
+\bind "M-m w s" "tabular-feature swap-row"
+\bind "M-m w a" "tabular-feature add-hline-above"
+\bind "M-m w e" "tabular-feature delete-hline-above"
+\bind "M-m w z" "tabular-feature add-hline-below"
+\bind "M-m w x" "tabular-feature delete-hline-below"
-\bind "M-m w t" "inset-modify tabular valign-top"
-\bind "M-m w m" "inset-modify tabular valign-middle"
-\bind "M-m w b" "inset-modify tabular valign-bottom"
-\bind "M-m c l" "inset-modify tabular align-left"
-\bind "M-m c m" "inset-modify tabular align-center"
-\bind "M-m c r" "inset-modify tabular align-right"
+\bind "M-m w t" "tabular-feature valign-top"
+\bind "M-m w m" "tabular-feature valign-middle"
+\bind "M-m w b" "tabular-feature valign-bottom"
+\bind "M-m c l" "tabular-feature align-left"
+\bind "M-m c m" "tabular-feature align-center"
+\bind "M-m c r" "tabular-feature align-right"
# Decoration accents
diff --git a/lib/bind/sciword.bind b/lib/bind/sciword.bind
index cf6a853..094d86f 100644
--- a/lib/bind/sciword.bind
+++ b/lib/bind/sciword.bind
@@ -232,10 +232,10 @@ Format 3
\bind_file greekkeys.bind
-\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up"
-\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down"
-\bind "M-Right" "inset-modify tabular move-column-right"
-\bind "M-Left" "inset-modify tabular move-column-left"
+\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; tabular-feature move-row-up"
+\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; tabular-feature move-row-down"
+\bind "M-Right" "tabular-feature move-column-right"
+\bind "M-Left" "tabular-feature move-column-left"
\bind "S-KP_Right" "char-right-select"
\bind "S-KP_Left" "char-left-select"
\bind "S-KP_Up" "up-select"
diff --git a/lib/bind/xemacs.bind b/lib/bind/xemacs.bind
index c8dfa98..c65132d 100644
--- a/lib/bind/xemacs.bind
+++ b/lib/bind/xemacs.bind
@@ -147,10 +147,10 @@ Format 3
# Motion group
#
-\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up"
-\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down"
-\bind "M-Right" "inset-modify tabular move-column-right"
-\bind "M-Left" "inset-modify tabular move-column-left"
+\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; tabular-feature move-row-up"
+\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; tabular-feature move-row-down"
+\bind "M-Right" "tabular-feature move-column-right"
+\bind "M-Left" "tabular-feature move-column-left"
\bind "C-Right" "word-right"
\bind "C-Left" "word-left"
\bind "C-Up" "paragraph-up"
diff --git a/lib/doc/LFUNs.lyx b/lib/doc/LFUNs.lyx
index d48f7ed..9aed4b8 100644
--- a/lib/doc/LFUNs.lyx
+++ b/lib/doc/LFUNs.lyx
@@ -37,7 +37,7 @@ End
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
-\default_output_format pdf2
+\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
@@ -101,7 +101,7 @@ The \SpecialChar LyX
\end_layout
\begin_layout Date
-2015-11-17
+2015-12-16
\end_layout
\begin_layout Section*
@@ -2512,79 +2512,7 @@ Notion Used for bibitem, bibtex, box, branch, command, ert, external, floats, gr
\end_layout
\begin_layout Description
-Syntax inset-modify <INSET> <ARGS>inset-modify changetype <TYPE>inset-modify tabular <FEATURE> [<ARG>]
-\end_layout
-
-\begin_layout Description
-Params Generally see LFUN_INSET_INSERT for further details.
-\begin_inset Newline newline
-\end_inset
-
-In case that <INSET> is "tabular" various math-environment features are handled as well, e.g. add-vline-left/right for the Grid/Array environment.
-\begin_inset Newline newline
-\end_inset
-
-<FEATURE>: append-row|append-column|delete-row|delete-column|copy-row|
-\begin_inset Newline newline
-\end_inset
-
-copy-column|move-column-right|move-column-left|move-row-down|move-row-up|
-\begin_inset Newline newline
-\end_inset
-
-toggle-line-top|toggle-line-bottom|toggle-line-left|toggle-line-right|
-\begin_inset Newline newline
-\end_inset
-
-align-left|align-right|align-center|align-block|align-decimal|set-decimal-point|
-\begin_inset Newline newline
-\end_inset
-
-valign-top|valign-bottom|valign-middle|longtabular-align-left|
-\begin_inset Newline newline
-\end_inset
-
-longtabular-align-center|longtabular-align-right|m-align-left|m-align-right|
-\begin_inset Newline newline
-\end_inset
-
-m-align-center|m-valign-top|m-valign-bottom|m-valign-middle|multicolumn|
-\begin_inset Newline newline
-\end_inset
-
-set-all-lines|unset-all-lines|toggle-longtabular|set-longtabular|unset-longtabular|set-pwidth|
-\begin_inset Newline newline
-\end_inset
-
-set-mpwidth|set-rotate-tabular|unset-rotate-tabular|toggle-rotate-tabular|
-\begin_inset Newline newline
-\end_inset
-
-set-rotate-cell|unset-rotate-cell|toggle-rotate-cell|set-usebox|set-lthead|
-\begin_inset Newline newline
-\end_inset
-
-unset-lthead|set-ltfirsthead|unset-ltfirsthead|set-ltfoot|unset-ltfoot|
-\begin_inset Newline newline
-\end_inset
-
-set-ltlastfoot|unset-ltlastfoot|set-ltnewpage|toggle-ltcaption|
-\begin_inset Newline newline
-\end_inset
-
-set-special-column|set-special-multicolumn|set-special-multirow|
-\begin_inset Newline newline
-\end_inset
-
-toggle-booktabs|set-booktabs|unset-booktabs|set-top-space|set-bottom-space|
-\begin_inset Newline newline
-\end_inset
-
-set-interline-space|set-border-lines|tabular-valign-top|
-\begin_inset Newline newline
-\end_inset
-
-tabular-valign-middle|tabular-valign-bottom|set-tabular-width <ARG>: additional argument for some commands, use debug mode to explore its values.
+Syntax inset-modify <INSET> <ARGS>inset-modify changetype <TYPE>
\end_layout
\begin_layout Description
@@ -3912,6 +3840,102 @@ Origin vfr, Sep 30 2008
\end_layout
\begin_layout Subsection*
+tabular-feature
+\end_layout
+
+\begin_layout Description
+Action Modify properties of tabulars and table-like math environments.
+\end_layout
+
+\begin_layout Description
+Syntax tabular-feature <FEATURE> [<ARG>]
+\end_layout
+
+\begin_layout Description
+Params Generally see LFUN_INSET_INSERT for further details.
+\begin_inset Newline newline
+\end_inset
+
+<FEATURE>: append-row|append-column|delete-row|delete-column|copy-row|
+\begin_inset Newline newline
+\end_inset
+
+copy-column|move-column-right|move-column-left|move-row-down|move-row-up|
+\begin_inset Newline newline
+\end_inset
+
+toggle-line-top|toggle-line-bottom|toggle-line-left|toggle-line-right|
+\begin_inset Newline newline
+\end_inset
+
+align-left|align-right|align-center|align-block|align-decimal|set-decimal-point|
+\begin_inset Newline newline
+\end_inset
+
+valign-top|valign-bottom|valign-middle|longtabular-align-left|
+\begin_inset Newline newline
+\end_inset
+
+longtabular-align-center|longtabular-align-right|m-align-left|m-align-right|
+\begin_inset Newline newline
+\end_inset
+
+m-align-center|m-valign-top|m-valign-bottom|m-valign-middle|multicolumn|
+\begin_inset Newline newline
+\end_inset
+
+set-all-lines|unset-all-lines|toggle-longtabular|set-longtabular|unset-longtabular|set-pwidth|
+\begin_inset Newline newline
+\end_inset
+
+set-mpwidth|set-rotate-tabular|unset-rotate-tabular|toggle-rotate-tabular|
+\begin_inset Newline newline
+\end_inset
+
+set-rotate-cell|unset-rotate-cell|toggle-rotate-cell|set-usebox|set-lthead|
+\begin_inset Newline newline
+\end_inset
+
+unset-lthead|set-ltfirsthead|unset-ltfirsthead|set-ltfoot|unset-ltfoot|
+\begin_inset Newline newline
+\end_inset
+
+set-ltlastfoot|unset-ltlastfoot|set-ltnewpage|toggle-ltcaption|
+\begin_inset Newline newline
+\end_inset
+
+set-special-column|set-special-multicolumn|set-special-multirow|
+\begin_inset Newline newline
+\end_inset
+
+toggle-booktabs|set-booktabs|unset-booktabs|set-top-space|set-bottom-space|
+\begin_inset Newline newline
+\end_inset
+
+set-interline-space|set-border-lines|tabular-valign-top|
+\begin_inset Newline newline
+\end_inset
+
+tabular-valign-middle|tabular-valign-bottom|set-tabular-width
+\begin_inset Newline newline
+\end_inset
+
+Various math-environment features are handled as well, e.g. add-vline-left/right for
+\begin_inset Newline newline
+\end_inset
+
+the Grid/Array environment.
+\begin_inset Newline newline
+\end_inset
+
+<ARG>: additional argument for some commands, use debug mode to explore its values.
+\end_layout
+
+\begin_layout Description
+Origin gm, 10 Dec 2015
+\end_layout
+
+\begin_layout Subsection*
tabular-insert
\end_layout
@@ -3920,7 +3944,7 @@ Action Inserts table into the document.
\end_layout
\begin_layout Description
-Notion See LFUN_INSET_MODIFY for some more details about tabular modifications.
+Notion See LFUN_TABULAR_FEATURE for some more details about tabular modifications.
\end_layout
\begin_layout Description
diff --git a/lib/scripts/prefs2prefs_lfuns.py b/lib/scripts/prefs2prefs_lfuns.py
index 99f75c3..c06917c 100644
--- a/lib/scripts/prefs2prefs_lfuns.py
+++ b/lib/scripts/prefs2prefs_lfuns.py
@@ -140,6 +140,10 @@ def tabular_feature(line):
return simple_renaming(line, "tabular-feature", "inset-modify tabular")
+def erutaef_ralubat(line):
+ return simple_renaming(line, "inset-modify tabular", "tabular-feature")
+
+
re_Bar2bar = re.compile(r'^(\\(?:bind|unbind))\s+"([^"]*)Bar"(\s+"[^"]+")')
def Bar2bar(line):
m = re_Bar2bar.search(line)
@@ -198,6 +202,7 @@ conversions = [
label_copy_as_reference
]],
[ 3, [ # list of conversions to format 3, LyX 2.2
- remove_print_support
+ remove_print_support,
+ erutaef_ralubat
]]
]
diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc
index 3d0f2fc..7317182 100644
--- a/lib/ui/stdcontext.inc
+++ b/lib/ui/stdcontext.inc
@@ -29,10 +29,10 @@ Menuset
Menu "insert_math_context"
Item "Array Environment|y" "math-matrix 2 2"
Item "Cases Environment|C" "math-insert \cases"
- Item "Aligned Environment|l" "command-sequence math-insert \aligned; inset-modify tabular append-column"
- Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; inset-modify tabular append-column"
+ Item "Aligned Environment|l" "command-sequence math-insert \aligned; tabular-feature append-column"
+ Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; tabular-feature append-column"
Item "Gathered Environment|h" "math-insert \gathered"
- Item "Split Environment|S" "command-sequence math-insert \split; inset-modify tabular append-column"
+ Item "Split Environment|S" "command-sequence math-insert \split; tabular-feature append-column"
Separator
Item "Delimiters...|r" "dialog-show mathdelimiter"
Item "Matrix...|x" "dialog-show mathmatrix"
@@ -62,15 +62,15 @@ Menuset
Separator
Submenu "Insert|s" "insert_math_context"
Separator
- OptItem "Add Line Above|o" "inset-modify tabular add-hline-above"
- OptItem "Add Line Below|B" "inset-modify tabular add-hline-below"
- OptItem "Delete Line Above|v" "inset-modify tabular delete-hline-above"
- OptItem "Delete Line Below|w" "inset-modify tabular delete-hline-below"
+ OptItem "Add Line Above|o" "tabular-feature add-hline-above"
+ OptItem "Add Line Below|B" "tabular-feature add-hline-below"
+ OptItem "Delete Line Above|v" "tabular-feature delete-hline-above"
+ OptItem "Delete Line Below|w" "tabular-feature delete-hline-below"
Separator
- OptItem "Add Line to Left" "inset-modify tabular add-vline-left"
- OptItem "Add Line to Right" "inset-modify tabular add-vline-right"
- OptItem "Delete Line to Left" "inset-modify tabular delete-vline-left"
- OptItem "Delete Line to Right" "inset-modify tabular delete-vline-right"
+ OptItem "Add Line to Left" "tabular-feature add-vline-left"
+ OptItem "Add Line to Right" "tabular-feature add-vline-right"
+ OptItem "Delete Line to Left" "tabular-feature delete-vline-left"
+ OptItem "Delete Line to Right" "tabular-feature delete-vline-right"
Separator
Item "Show Math Toolbar" "toolbar-toggle math toggle"
Item "Show Math-Panels Toolbar" "toolbar-toggle math_panels toggle"
@@ -406,43 +406,43 @@ Menuset
#
Menu "table-borders"
- Item "Top|T" "inset-modify tabular toggle-line-top"
- Item "Bottom|B" "inset-modify tabular toggle-line-bottom"
- Item "Left|L" "inset-modify tabular toggle-line-left"
- Item "Right|R" "inset-modify tabular toggle-line-right"
+ Item "Top|T" "tabular-feature toggle-line-top"
+ Item "Bottom|B" "tabular-feature toggle-line-bottom"
+ Item "Left|L" "tabular-feature toggle-line-left"
+ Item "Right|R" "tabular-feature toggle-line-right"
End
Menu "table-alignment"
- Item "Left|f" "command-alternatives inset-modify tabular m-align-left;inset-modify tabular align-left"
- Item "Center|C" "command-alternatives inset-modify tabular m-align-center;inset-modify tabular align-center"
- Item "Right|h" "command-alternatives inset-modify tabular m-align-right;inset-modify tabular align-right"
- Item "Decimal" "inset-modify tabular align-decimal"
+ Item "Left|f" "command-alternatives tabular-feature m-align-left;tabular-feature align-left"
+ Item "Center|C" "command-alternatives tabular-feature m-align-center;tabular-feature align-center"
+ Item "Right|h" "command-alternatives tabular-feature m-align-right;tabular-feature align-right"
+ Item "Decimal" "tabular-feature align-decimal"
Separator
- Item "Top" "inset-modify tabular valign-top"
- Item "Middle" "inset-modify tabular valign-middle"
- Item "Bottom" "inset-modify tabular valign-bottom"
+ Item "Top" "tabular-feature valign-top"
+ Item "Middle" "tabular-feature valign-middle"
+ Item "Bottom" "tabular-feature valign-bottom"
End
Menu "table-cols-rows"
- Item "Multicolumn|u" "inset-modify tabular multicolumn"
- Item "Multirow|w" "inset-modify tabular multirow"
+ Item "Multicolumn|u" "tabular-feature multicolumn"
+ Item "Multirow|w" "tabular-feature multirow"
Separator
- Item "Append Row|A" "inset-modify tabular append-row"
- Item "Delete Row|D" "inset-modify tabular delete-row"
- Item "Copy Row|o" "inset-modify tabular copy-row"
- Item "Move Row Up" "inset-modify tabular move-row-up"
- Item "Move Row Down" "inset-modify tabular move-row-down"
+ Item "Append Row|A" "tabular-feature append-row"
+ Item "Delete Row|D" "tabular-feature delete-row"
+ Item "Copy Row|o" "tabular-feature copy-row"
+ Item "Move Row Up" "tabular-feature move-row-up"
+ Item "Move Row Down" "tabular-feature move-row-down"
Separator
- Item "Append Column|p" "inset-modify tabular append-column"
- Item "Delete Column|e" "inset-modify tabular delete-column"
- Item "Copy Column|y" "inset-modify tabular copy-column"
- Item "Move Column Right|v" "inset-modify tabular move-column-right"
- Item "Move Column Left" "inset-modify tabular move-column-left"
+ Item "Append Column|p" "tabular-feature append-column"
+ Item "Delete Column|e" "tabular-feature delete-column"
+ Item "Copy Column|y" "tabular-feature copy-column"
+ Item "Move Column Right|v" "tabular-feature move-column-right"
+ Item "Move Column Left" "tabular-feature move-column-left"
End
Menu "context-tabular"
- Item "Multi-page Table|g" "inset-modify tabular toggle-longtabular"
- Item "Formal Style|m" "inset-modify tabular toggle-booktabs"
+ Item "Multi-page Table|g" "tabular-feature toggle-longtabular"
+ Item "Formal Style|m" "tabular-feature toggle-booktabs"
Separator
Submenu "Borders|d" "table-borders"
Submenu "Alignment|i" "table-alignment"
diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index 56e2d08..cc9f7f4 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -191,44 +191,44 @@ Menuset
# not much we can do to help here
Menu "edit_tabular"
- Item "Multi-page Table|g" "inset-modify tabular toggle-longtabular"
- Item "Formal Style|F" "inset-modify tabular toggle-booktabs"
+ Item "Multi-page Table|g" "tabular-feature toggle-longtabular"
+ Item "Formal Style|F" "tabular-feature toggle-booktabs"
Separator
- Item "Multicolumn|M" "inset-modify tabular multicolumn"
- Item "Multirow|u" "inset-modify tabular multirow"
+ Item "Multicolumn|M" "tabular-feature multicolumn"
+ Item "Multirow|u" "tabular-feature multirow"
Separator
- Item "Top Line|T" "inset-modify tabular toggle-line-top"
- Item "Bottom Line|B" "inset-modify tabular toggle-line-bottom"
- Item "Left Line|L" "inset-modify tabular toggle-line-left"
- Item "Right Line|R" "inset-modify tabular toggle-line-right"
+ Item "Top Line|T" "tabular-feature toggle-line-top"
+ Item "Bottom Line|B" "tabular-feature toggle-line-bottom"
+ Item "Left Line|L" "tabular-feature toggle-line-left"
+ Item "Right Line|R" "tabular-feature toggle-line-right"
Separator
- Item "Top|p" "inset-modify tabular tabular-valign-top"
- Item "Middle|i" "inset-modify tabular tabular-valign-middle"
- Item "Bottom|o" "inset-modify tabular tabular-valign-bottom"
+ Item "Top|p" "tabular-feature tabular-valign-top"
+ Item "Middle|i" "tabular-feature tabular-valign-middle"
+ Item "Bottom|o" "tabular-feature tabular-valign-bottom"
End
Menu "edit_tabular_features"
- Item "Left|L" "inset-modify tabular align-left"
- Item "Center|C" "inset-modify tabular align-center"
- Item "Right|R" "inset-modify tabular align-right"
+ Item "Left|L" "tabular-feature align-left"
+ Item "Center|C" "tabular-feature align-center"
+ Item "Right|R" "tabular-feature align-right"
Separator
- Item "Top|T" "inset-modify tabular valign-top"
- Item "Middle|M" "inset-modify tabular valign-middle"
- Item "Bottom|B" "inset-modify tabular valign-bottom"
+ Item "Top|T" "tabular-feature valign-top"
+ Item "Middle|M" "tabular-feature valign-middle"
+ Item "Bottom|B" "tabular-feature valign-bottom"
Separator
- Item "Add Row|A" "inset-modify tabular append-row"
- Item "Delete Row|D" "inset-modify tabular delete-row"
- Item "Copy Row|o" "inset-modify tabular copy-row"
- Item "Move Row Up" "inset-modify tabular move-row-up"
- Item "Move Row Down" "inset-modify tabular move-row-down"
- # Item "Swap Rows|S" "inset-modify tabular swap-row" # currently broken
+ Item "Add Row|A" "tabular-feature append-row"
+ Item "Delete Row|D" "tabular-feature delete-row"
+ Item "Copy Row|o" "tabular-feature copy-row"
+ Item "Move Row Up" "tabular-feature move-row-up"
+ Item "Move Row Down" "tabular-feature move-row-down"
+ # Item "Swap Rows|S" "tabular-feature swap-row" # currently broken
Separator
- Item "Add Column|u" "inset-modify tabular append-column"
- Item "Delete Column|e" "inset-modify tabular delete-column"
- Item "Copy Column|p" "inset-modify tabular copy-column"
- Item "Move Column Right|v" "inset-modify tabular move-column-right"
- Item "Move Column Left" "inset-modify tabular move-column-left"
- # Item "Swap Columns|w" "inset-modify tabular swap-column" # currently broken
+ Item "Add Column|u" "tabular-feature append-column"
+ Item "Delete Column|e" "tabular-feature delete-column"
+ Item "Copy Column|p" "tabular-feature copy-column"
+ Item "Move Column Right|v" "tabular-feature move-column-right"
+ Item "Move Column Left" "tabular-feature move-column-left"
+ # Item "Swap Columns|w" "tabular-feature swap-column" # currently broken
End
Menu "edit_math"
@@ -245,15 +245,15 @@ Menuset
Separator
Item "Split Cell|C" "cell-split"
Separator
- Item "Add Line Above|A" "inset-modify tabular add-hline-above"
- Item "Add Line Below|B" "inset-modify tabular add-hline-below"
- Item "Delete Line Above|D" "inset-modify tabular delete-hline-above"
- Item "Delete Line Below|e" "inset-modify tabular delete-hline-below"
+ Item "Add Line Above|A" "tabular-feature add-hline-above"
+ Item "Add Line Below|B" "tabular-feature add-hline-below"
+ Item "Delete Line Above|D" "tabular-feature delete-hline-above"
+ Item "Delete Line Below|e" "tabular-feature delete-hline-below"
Separator
- Item "Add Line to Left" "inset-modify tabular add-vline-left"
- Item "Add Line to Right" "inset-modify tabular add-vline-right"
- Item "Delete Line to Left" "inset-modify tabular delete-vline-left"
- Item "Delete Line to Right" "inset-modify tabular delete-vline-right"
+ Item "Add Line to Left" "tabular-feature add-vline-left"
+ Item "Add Line to Right" "tabular-feature add-vline-right"
+ Item "Delete Line to Left" "tabular-feature delete-vline-left"
+ Item "Delete Line to Right" "tabular-feature delete-vline-right"
End
Menu "edit_math_macro_definition"
@@ -449,10 +449,10 @@ Menuset
# "math-matrix" and "math-insert" create an inline formula first if called from text mode
Item "Array Environment|y" "math-matrix 2 2"
Item "Cases Environment|C" "math-insert \cases"
- Item "Aligned Environment|l" "command-sequence math-insert \aligned; inset-modify tabular append-column"
- Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; inset-modify tabular append-column"
+ Item "Aligned Environment|l" "command-sequence math-insert \aligned; tabular-feature append-column"
+ Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; tabular-feature append-column"
Item "Gathered Environment|h" "math-insert \gathered"
- Item "Split Environment|S" "command-sequence math-insert \split; inset-modify tabular append-column"
+ Item "Split Environment|S" "command-sequence math-insert \split; tabular-feature append-column"
Separator
Item "Delimiters...|r" "dialog-show mathdelimiter"
Item "Matrix...|x" "dialog-show mathmatrix"
diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc
index e343888..dc9de58 100644
--- a/lib/ui/stdtoolbars.inc
+++ b/lib/ui/stdtoolbars.inc
@@ -140,36 +140,36 @@ ToolbarSet
End
Toolbar "table" "Table"
- Item "Add row" "inset-modify tabular append-row"
- Item "Add column" "inset-modify tabular append-column"
- Item "Delete row" "inset-modify tabular delete-row"
- Item "Delete column" "inset-modify tabular delete-column"
- Item "Move row up" "inset-modify tabular move-row-up"
- Item "Move column left" "inset-modify tabular move-column-left"
- Item "Move row down" "inset-modify tabular move-row-down"
- Item "Move column right" "inset-modify tabular move-column-right"
+ Item "Add row" "tabular-feature append-row"
+ Item "Add column" "tabular-feature append-column"
+ Item "Delete row" "tabular-feature delete-row"
+ Item "Delete column" "tabular-feature delete-column"
+ Item "Move row up" "tabular-feature move-row-up"
+ Item "Move column left" "tabular-feature move-column-left"
+ Item "Move row down" "tabular-feature move-row-down"
+ Item "Move column right" "tabular-feature move-column-right"
Separator
- Item "Set top line" "inset-modify tabular toggle-line-top"
- Item "Set bottom line" "inset-modify tabular toggle-line-bottom"
- Item "Set left line" "inset-modify tabular toggle-line-left"
- Item "Set right line" "inset-modify tabular toggle-line-right"
- Item "Set border lines" "inset-modify tabular set-border-lines"
- Item "Set all lines" "inset-modify tabular set-all-lines"
- Item "Unset all lines" "inset-modify tabular unset-all-lines"
+ Item "Set top line" "tabular-feature toggle-line-top"
+ Item "Set bottom line" "tabular-feature toggle-line-bottom"
+ Item "Set left line" "tabular-feature toggle-line-left"
+ Item "Set right line" "tabular-feature toggle-line-right"
+ Item "Set border lines" "tabular-feature set-border-lines"
+ Item "Set all lines" "tabular-feature set-all-lines"
+ Item "Unset all lines" "tabular-feature unset-all-lines"
Separator
- Item "Align left" "command-alternatives inset-modify tabular m-align-left;inset-modify tabular align-left"
- Item "Align center" "command-alternatives inset-modify tabular m-align-center;inset-modify tabular align-center"
- Item "Align right" "command-alternatives inset-modify tabular m-align-right;inset-modify tabular align-right"
- Item "Align on decimal" "inset-modify tabular align-decimal"
+ Item "Align left" "command-alternatives tabular-feature m-align-left;tabular-feature align-left"
+ Item "Align center" "command-alternatives tabular-feature m-align-center;tabular-feature align-center"
+ Item "Align right" "command-alternatives tabular-feature m-align-right;tabular-feature align-right"
+ Item "Align on decimal" "tabular-feature align-decimal"
Separator
- Item "Align top" "command-alternatives inset-modify tabular m-valign-top;inset-modify tabular valign-top"
- Item "Align middle" "command-alternatives inset-modify tabular m-valign-middle;inset-modify tabular valign-middle"
- Item "Align bottom" "command-alternatives inset-modify tabular m-valign-bottom;inset-modify tabular valign-bottom"
+ Item "Align top" "command-alternatives tabular-feature m-valign-top;tabular-feature valign-top"
+ Item "Align middle" "command-alternatives tabular-feature m-valign-middle;tabular-feature valign-middle"
+ Item "Align bottom" "command-alternatives tabular-feature m-valign-bottom;tabular-feature valign-bottom"
Separator
- Item "Rotate cell by 90 degrees or unset rotation" "inset-modify tabular toggle-rotate-cell"
- Item "Rotate table by 90 degrees or unset rotation" "inset-modify tabular toggle-rotate-tabular"
- Item "Set multi-column" "inset-modify tabular multicolumn"
- Item "Set multi-row" "inset-modify tabular multirow"
+ Item "Rotate cell by 90 degrees or unset rotation" "tabular-feature toggle-rotate-cell"
+ Item "Rotate table by 90 degrees or unset rotation" "tabular-feature toggle-rotate-tabular"
+ Item "Set multi-column" "tabular-feature multicolumn"
+ Item "Set multi-row" "tabular-feature multirow"
End
Toolbar "math" "Math"
@@ -191,10 +191,10 @@ ToolbarSet
Separator
Item "Insert matrix" "dialog-show mathmatrix"
Item "Insert cases environment" "math-insert \cases"
- Item "Add row" "inset-modify tabular append-row"
- Item "Add column" "inset-modify tabular append-column"
- Item "Delete row" "inset-modify tabular delete-row"
- Item "Delete column" "inset-modify tabular delete-column"
+ Item "Add row" "tabular-feature append-row"
+ Item "Add column" "tabular-feature append-column"
+ Item "Delete row" "tabular-feature delete-row"
+ Item "Delete column" "tabular-feature delete-column"
Separator
Item "Toggle math panels" "toolbar-toggle math_panels"
End
--
2.1.4
>From 0bc10142a27b0a8f49a56bfb68a0755ed9687982 Mon Sep 17 00:00:00 2001
From: Guillaume Munch <g...@lyx.org>
Date: Fri, 11 Dec 2015 20:45:57 +0000
Subject: [PATCH 3/3] Let tabular-feature commands fall through non-table math
insets. (#4189)
---
src/mathed/InsetMathHull.cpp | 30 ++++++++++++++++++++----------
src/mathed/InsetMathHull.h | 2 ++
2 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 5b884b4..d50fba4 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1040,6 +1040,14 @@ void InsetMathHull::footer_write(WriteStream & os) const
}
+bool InsetMathHull::isTable() const
+{
+ return
+ type_ != hullNone && type_ != hullSimple &&
+ type_ != hullEquation && type_ != hullRegexp;
+}
+
+
bool InsetMathHull::rowChangeOK() const
{
return
@@ -1702,6 +1710,13 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
}
+ case LFUN_TABULAR_FEATURE:
+ if (!isTable())
+ cur.undispatched();
+ else
+ InsetMathGrid::doDispatch(cur, cmd);
+ break;
+
default:
InsetMathGrid::doDispatch(cur, cmd);
break;
@@ -1817,6 +1832,11 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd,
return InsetMathGrid::getStatus(cur, cmd, status);
case LFUN_TABULAR_FEATURE: {
+ if (!isTable()) {
+ status.clear();
+ status.setUnknown(true);
+ return true;
+ }
string s = cmd.getArg(0);
if (!rowChangeOK()
&& (s == "append-row"
@@ -1838,16 +1858,6 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd,
status.setEnabled(false);
return true;
}
- if ((type_ == hullSimple
- || type_ == hullEquation
- || type_ == hullNone) &&
- (s == "add-hline-above" || s == "add-hline-below")) {
- status.message(bformat(
- from_utf8(N_("Can't add horizontal grid lines in '%1$s'")),
- hullName(type_)));
- status.setEnabled(false);
- return true;
- }
if (s == "add-vline-left" || s == "add-vline-right") {
status.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h
index 9598ad4..aee43a0 100644
--- a/src/mathed/InsetMathHull.h
+++ b/src/mathed/InsetMathHull.h
@@ -236,6 +236,8 @@ private:
ColorCode standardColor() const;
/// consistency check
void check() const;
+ /// does it understand table-modify commands?
+ bool isTable() const;
/// can this change its number of rows?
bool rowChangeOK() const;
/// can this change its number of cols?
--
2.1.4