From: André Pönitz Date: Tue, 20 Aug 2002 17:29:37 +0000 (+0000) Subject: more stuff from Lars' diff-6 (write one par at a time) X-Git-Tag: 1.6.10~18523 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=570ac6e4f47f07753616764eea741ce8ba963536;p=lyx.git more stuff from Lars' diff-6 (write one par at a time) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5039 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 9c1501d232..1fd8ac785a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -8,6 +8,9 @@ * text.C: * buffer.[Ch]: use improved inset_iterator + * buffer.C: + * paragraph.[Ch]: write one paragraph at a time + 2002-08-20 Dekel Tsur * BufferView_pimpl.C (dispatch): Insert insetbibtex with "plain" diff --git a/src/buffer.C b/src/buffer.C index 498d21937d..e5d89733e9 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -1843,7 +1843,10 @@ bool Buffer::writeFile(string const & fname) const // this will write out all the paragraphs // using recursive descent. - paragraphs.begin()->writeFile(this, ofs, params, depth); + ParagraphList::iterator pit = paragraphs.begin(); + ParagraphList::iterator pend = paragraphs.end(); + for (; pit != pend; ++pit) + pit->write(this, ofs, params, depth); // Write marker that shows file is complete ofs << "\n\\the_end" << endl; diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 23b23b1625..cf2774093a 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -236,7 +236,11 @@ void InsetText::write(Buffer const * buf, ostream & os) const void InsetText::writeParagraphData(Buffer const * buf, ostream & os) const { - paragraphs.begin()->writeFile(buf, os, buf->params, 0); + ParagraphList::iterator it = paragraphs.begin(); + ParagraphList::iterator end = paragraphs.end(); + for (; it != end; ++it) { + it->write(buf, os, buf->params, 0); + } } diff --git a/src/paragraph.C b/src/paragraph.C index 8b4a2e1ed7..f63f2c1be0 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -163,7 +163,7 @@ Paragraph::~Paragraph() } -void Paragraph::writeFile(Buffer const * buf, ostream & os, +void Paragraph::write(Buffer const * buf, ostream & os, BufferParams const & bparams, depth_type dth) const { @@ -317,10 +317,6 @@ void Paragraph::writeFile(Buffer const * buf, ostream & os, break; } } - - // now write the next paragraph - if (next_) - next_->writeFile(buf, os, bparams, dth); } diff --git a/src/paragraph.h b/src/paragraph.h index 7aa11cbc09..d17bcdd0ea 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -110,7 +110,7 @@ public: bool label); /// - void writeFile(Buffer const *, std::ostream &, BufferParams const &, + void write(Buffer const *, std::ostream &, BufferParams const &, depth_type) const; /// void validate(LaTeXFeatures &) const;