From 96885e74d7a181a8dbf7bec32b48744da7c3a24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Thu, 1 May 2003 23:05:01 +0000 Subject: [PATCH] robustify splice a bit git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6915 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/ParagraphList.C | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index ef64033159..d30ccb352b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,11 @@ +2003-05-02 Lars Gullik Bjønnes + + * ParagraphList.C (splice): just return if pl is empty. + 2003-05-02 Lars Gullik Bjønnes * ParagraphList.C (splice): new function. + * CutAndPaste.C (pasteSelection): use it 2003-05-01 Lars Gullik Bjønnes diff --git a/src/ParagraphList.C b/src/ParagraphList.C index 7ac431829b..fb63f41ef4 100644 --- a/src/ParagraphList.C +++ b/src/ParagraphList.C @@ -178,6 +178,9 @@ void ParagraphList::assign(iterator beg, iterator end) void ParagraphList::splice(iterator pos, ParagraphList & pl) { + if (pl.parlist == 0) + return; + Paragraph * first = pl.parlist; Paragraph * last = first; #ifndef NO_NEXT