From d839975cfc560faed82706597d71d4875ae66467 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 2 Oct 2003 12:01:24 +0000 Subject: [PATCH] * insettext.C (read): make sure there is at least one par in the text after reading. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7850 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 11 ++++++++--- src/insets/insettext.C | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 73e4e2bd56..7f0ea9eb92 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2003-10-02 André Pönitz + + * insettext.C (read): make sure there is at least one par + in the text after reading. + 2003-10-01 José Matos * insetbranch.C (linuxdoc, docbook): minor fix. @@ -307,9 +312,9 @@ 2003-08-28 Angus Leeming - * insetgraphics.C (prepareFile): prepend "convertDefault.sh" with - "sh ", enabling the conversion to be carried out even if the script - is not executable. + * insetgraphics.C (prepareFile): prepend "convertDefault.sh" with + "sh ", enabling the conversion to be carried out even if the script + is not executable. 2003-08-28 Lars Gullik Bjønnes diff --git a/src/insets/insettext.C b/src/insets/insettext.C index d2872a07b9..4183f1ddbc 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -172,10 +172,12 @@ void InsetText::read(Buffer const & buf, LyXLex & lex) clear(false); +#warning John, look here. Doesnt make much sense. if (buf.params().tracking_changes) paragraphs.begin()->trackChanges(); // delete the initial paragraph + Paragraph oldpar = *paragraphs.begin(); paragraphs.clear(); ParagraphList::iterator pit = paragraphs.begin(); @@ -206,6 +208,11 @@ void InsetText::read(Buffer const & buf, LyXLex & lex) lex.printError("Missing \\end_inset at this point. " "Read: `$$Token'"); } + + // sanity check + // ensure we have at least one par. + if (paragraphs.empty()) + paragraphs.push_back(oldpar); } -- 2.39.5