]> git.lyx.org Git - lyx.git/commitdiff
Disable LFUN_INSET_DISSOLVE in tabulars
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 10 May 2016 09:17:43 +0000 (11:17 +0200)
committerRichard Heck <rgheck@lyx.org>
Wed, 15 Jun 2016 21:32:53 +0000 (22:32 +0100)
When in a tabular cell, "this" is just a lone InsetText, while cur.inset() is the whole tabular. This makes a big difference, especially when one wants to count cells.

Fixes bug #9954.

(cherry picked from commit 4caf167dbd24722421ae8d94a2c103bf41a7667d)

src/insets/InsetText.cpp
status.22x

index 80b0bac0134b2f48435805a9dd89cbf488a37158..660826309f33931a0121a51113a65a9c8a08c009 100644 (file)
@@ -293,7 +293,8 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
                bool const main_inset = &buffer().inset() == this;
                bool const target_inset = cmd.argument().empty() 
                        || cmd.getArg(0) == insetName(lyxCode());
-               bool const one_cell = nargs() == 1;
+               // cur.inset() is the tabular when this is a single cell (bug #9954)
+               bool const one_cell = cur.inset().nargs() == 1;
 
                if (!main_inset && target_inset && one_cell) {
                        // Text::dissolveInset assumes that the cursor
@@ -325,7 +326,8 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
                bool const main_inset = &buffer().inset() == this;
                bool const target_inset = cmd.argument().empty() 
                        || cmd.getArg(0) == insetName(lyxCode());
-               bool const one_cell = nargs() == 1;
+               // cur.inset() is the tabular when this is a single cell (bug #9954)
+               bool const one_cell = cur.inset().nargs() == 1;
 
                if (target_inset)
                        status.setEnabled(!main_inset && one_cell);
index 37b296cac0de427d9c982f7c84b3a0c9b86a0cdf..7739e6e59f61165f40087db928c0d969c33502b7 100644 (file)
@@ -98,7 +98,10 @@ What's new
 
 - Raise GuiView on buffer switch to bring it topmost in multi-window mode.
 
-- Fix cursor position after Redo of a document settings change (bug 10097).
+- Fix cursor position after Redo of a document settings change (bug
+  10097).
+
+- Disable Edit>Dissolve Inset in tabulars (bug 9954).
 
 - Shortcut preferences: ask the user for removing bindings when using the
   "restore" button (#9174).