]> git.lyx.org Git - features.git/commitdiff
fix crash with layout-paste
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 18 Dec 2002 14:36:28 +0000 (14:36 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 18 Dec 2002 14:36:28 +0000 (14:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5856 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index 8252c420be99d4a1204ee97f036a62d239befddd..b152a761e48a4c47270374cd252c8fdf3f3126b2 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-17  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * text2.C (pasteEnvironmentType): avoid crash if layout-copy has
+       not been invoked
+
 2002-12-17  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lyxfunc.C (getStatus): query lyx_gui::getStatus() to catter for
index bc1f0d6af5b524e5a6443f9afafbdbbbaaabd012..00b4dbbc4b4a78d0db7d85fbb725b2fd31531226 100644 (file)
@@ -1423,7 +1423,9 @@ void LyXText::copyEnvironmentType()
 
 void LyXText::pasteEnvironmentType(BufferView * bview)
 {
-       setLayout(bview, copylayouttype);
+       // do nothing if there has been no previous copyEnvironmentType()
+       if (!copylayouttype.empty())
+               setLayout(bview, copylayouttype);
 }