From: Jean-Marc Lasgouttes Date: Wed, 18 Dec 2002 14:36:28 +0000 (+0000) Subject: fix crash with layout-paste X-Git-Tag: 1.6.10~17772 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a58209e73542069917c0c15fabb8c957d26b8a3a;p=features.git fix crash with layout-paste git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5856 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 8252c420be..b152a761e4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-12-17 Jean-Marc Lasgouttes + + * text2.C (pasteEnvironmentType): avoid crash if layout-copy has + not been invoked + 2002-12-17 Jean-Marc Lasgouttes * lyxfunc.C (getStatus): query lyx_gui::getStatus() to catter for diff --git a/src/text2.C b/src/text2.C index bc1f0d6af5..00b4dbbc4b 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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); }