The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 3380e0de8fc8dc1487d26c9aeb041538d1df8576
Author: Richard Heck <[email protected]>
Date:   Sun Apr 15 08:59:46 2012 -0400

    Before we process the LFUN, make sure that it is actually intended
    for us.

diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index a396157..68bca75 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -190,10 +190,19 @@ void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_INSET_MODIFY: {
                //lyxerr << "InsetBox::dispatch MODIFY" << endl;
+               string const first_arg = cmd.getArg(0);
+               bool const change_type = first_arg == "changetype";
+               bool const for_box = first_arg == "box";
+               if (!change_type && !for_box) {
+                       // not for us
+                       // this will not be handled higher up
+                       cur.undispatched();
+                       return;
+               }
                cur.recordUndoInset(ATOMIC_UNDO, this);
-               if (cmd.getArg(0) == "changetype") {
+               if (change_type)
                        params_.type = cmd.getArg(1);
-               } else
+               else // if (for_box)
                        string2params(to_utf8(cmd.argument()), params_);
                setButtonLabel();
                break;

commit f84eb64ac7bdd73cc5abace2f836091b0defa21c
Author: Richard Heck <[email protected]>
Date:   Sat Apr 14 17:32:25 2012 -0400

    Try to fix bug 8124. We enable LFUN_INSET_MODIFY in InsetBox if it
    is intended for us, i.e., if the first argument is "box". Maybe we
    should also check to make sure that the rest of the arguments are
    good, but we used just to return true no matter what the argument
    was, so this is an improvement.
    
    LFUN_INSET_MODIFY is really kind of a mess.

diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index ec48bd2..a396157 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -211,14 +211,20 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const 
& cmd,
 {
        switch (cmd.action()) {
 
-       case LFUN_INSET_MODIFY:
-               if (cmd.getArg(0) == "changetype") {
+       case LFUN_INSET_MODIFY: {
+               string const first_arg = cmd.getArg(0);
+               if (first_arg == "changetype") {
                        string const type = cmd.getArg(1);
                        flag.setOnOff(type == params_.type);
                        flag.setEnabled(!params_.inner_box || type != "Framed");
                        return true;
                }
+               if (first_arg == "box") {
+                       flag.setEnabled(true);
+                       return true;
+               }
                return InsetCollapsable::getStatus(cur, cmd, flag);
+       }
 
        case LFUN_INSET_DIALOG_UPDATE:
                flag.setEnabled(true);

-----------------------------------------------------------------------

Summary of changes:
 src/insets/InsetBox.cpp |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to