]> git.lyx.org Git - features.git/commitdiff
Fix bug #7905. We don't want to move out of the inset unless
authorRichard Heck <rgheck@comcast.net>
Tue, 22 Nov 2011 18:40:01 +0000 (18:40 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 22 Nov 2011 18:40:01 +0000 (18:40 +0000)
we've put something into it. (We also don't need to copy an
empty string into it.)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40240 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp

index f3d25d49ebcfb8c1c10f569ea43260d12a1d2137..94f68a78b559c0583844563969b9c89ddb328035 100644 (file)
@@ -247,8 +247,11 @@ static bool doInsertInset(Cursor & cur, Text * text,
                        inset->edit(cur, true);
                // Now put this into inset
                Font const f(inherit_font, cur.current_font.language());
-               cur.text()->insertStringAsLines(cur, ds, f);
-               cur.leaveInset(*inset);
+               if (!ds.empty()) {
+                       cur.text()->insertStringAsLines(cur, ds, f);
+                       cur.leaveInset(*inset);
+                       inset->asInsetCollapsable()->setStatus(InsetCollapsable::Collapsed);
+               }
                return true;
        }