<< " created this file. For more info see http://www.lyx.org/\n"
<< "\\lyxformat " << LYX_FORMAT << "\n";
- // now write out the buffer paramters.
+ // now write out the buffer parameters.
params().writeFile(ofs);
ofs << "\\end_header\n";
- Paragraph::depth_type depth = 0;
-
- // this will write out all the paragraphs
- // using recursive descent.
- ParagraphList::const_iterator pit = paragraphs().begin();
- ParagraphList::const_iterator pend = paragraphs().end();
- for (; pit != pend; ++pit)
- pit->write(*this, ofs, params(), depth);
+ // write the text
+ text().write(*this, ofs);
// Write marker that shows file is complete
ofs << "\n\\end_document" << endl;
void InsetCaption::write(Buffer const & buf, ostream & os) const
{
os << "Caption\n";
- writeParagraphData(buf, os);
+ text_.write(buf, os);
}
void InsetCollapsable::write(Buffer const & buf, ostream & os) const
{
os << "collapsed " << (status_ == Collapsed ? "true" : "false") << "\n";
- inset.writeParagraphData(buf, os);
+ inset.text_.write(buf, os);
}
void InsetText::write(Buffer const & buf, ostream & os) const
{
os << "Text\n";
- writeParagraphData(buf, os);
-}
-
-
-void InsetText::writeParagraphData(Buffer const & buf, ostream & os) const
-{
- ParagraphList::const_iterator it = paragraphs().begin();
- ParagraphList::const_iterator end = paragraphs().end();
- Paragraph::depth_type dth = 0;
- for (; it != end; ++it) {
- it->write(buf, os, buf.params(), dth);
- }
+ text_.write(buf, os);
}
bool toggleall = false,
bool selectall = false);
///
- void writeParagraphData(Buffer const &, std::ostream &) const;
- ///
void setText(std::string const &, LyXFont const &);
///
void setAutoBreakRows(bool);
#include "insets/inset.h"
+#include <iosfwd>
+
class Buffer;
class BufferParams;
class BufferView;
///
bool checkAndActivateInset(bool front);
+ ///
+ void write(Buffer const & buf, std::ostream & os) const;
public:
///
to.pos(to.pos() + 1);
}
}
+
+
+void LyXText::write(Buffer const & buf, std::ostream & os) const
+{
+ ParagraphList::const_iterator pit = paragraphs().begin();
+ ParagraphList::const_iterator end = paragraphs().end();
+ Paragraph::depth_type dth = 0;
+ for (; pit != end; ++pit)
+ pit->write(buf, os, buf.params(), dth);
+}