]> git.lyx.org Git - features.git/commitdiff
InsetBox.cpp: fix bug #8712
authorUwe Stöhr <uwestoehr@lyx.org>
Thu, 4 Feb 2016 23:49:17 +0000 (00:49 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Thu, 4 Feb 2016 23:49:17 +0000 (00:49 +0100)
src/insets/InsetBox.cpp

index fd926f481614d046d71bf352f419834321a3ec17..eee16fe6472912751eb5e7daf013c529bc778ddb 100644 (file)
@@ -264,9 +264,21 @@ void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
                        return;
                }
                cur.recordUndoInset(this);
-               if (change_type)
+               if (change_type) {
                        params_.type = cmd.getArg(1);
-               else // if (for_box)
+                       // set a makebox if there is no inner box but Frameless was exectued
+                       // otherwise the result would be a non existent box (no inner AND outer box)
+                       // (this was LyX bug 8712)
+                       if (params_.type == "Frameless" && !params_.inner_box) {
+                               params_.use_makebox = true;
+                               params_.inner_box = true;
+                       }
+                       // handle the opposite case
+                       if (params_.type == "Boxed" && params_.use_makebox) {
+                               params_.use_makebox = false;
+                               params_.inner_box = false;
+                       }
+               } else
                        string2params(to_utf8(cmd.argument()), params_);
                setButtonLabel();
                break;