]> git.lyx.org Git - lyx.git/commitdiff
* insettext.C (read): make sure there is at least one par
authorAndré Pönitz <poenitz@gmx.net>
Thu, 2 Oct 2003 12:01:24 +0000 (12:01 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 2 Oct 2003 12:01:24 +0000 (12:01 +0000)
  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
src/insets/insettext.C

index 73e4e2bd56945d54cba6d851e840e802e99e8dc6..7f0ea9eb921a7e03bdf9f4e09fe95653a2c9469a 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-02  André Pönitz  <poenitz@gmx.net>
+
+       * insettext.C (read): make sure there is at least one par
+         in the text after reading.
+
 2003-10-01  José Matos  <jamatos@lyx.org>
 
        * insetbranch.C (linuxdoc, docbook): minor fix.
 
 2003-08-28  Angus Leeming  <leeming@lyx.org>
 
-        * 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  <larsbj@gullik.net>
 
index d2872a07b91b7d5b02d49e3c213c068552e030f0..4183f1ddbca7c2263b6f45955ddb9509f3edc43a 100644 (file)
@@ -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);
 }