From ee038db36ddedc5372f4713d004a8556ddb39f57 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Sat, 13 Oct 2007 09:14:49 +0000 Subject: [PATCH] Safer code for allowMultiPar(), thx Angus git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20939 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index ebeae3f13d..1f7157a48e 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -211,7 +211,8 @@ static bool doInsertInset(Cursor & cur, Text * text, if (gotsel && pastesel) { lyx::dispatch(FuncRequest(LFUN_PASTE, "0")); - if (!static_cast(inset)->allowMultiPar() + InsetText * insetText = dynamic_cast(inset); + if (insetText && !insetText->allowMultiPar() || cur.lastpit() == 0) { // reset first par to default LayoutPtr const layout = -- 2.39.5