mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 22:41:09 +00:00
merge common code
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8183 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
51fa9803d3
commit
5ea277209f
12
src/buffer.C
12
src/buffer.C
@ -839,19 +839,13 @@ bool Buffer::do_writeFile(ostream & ofs) const
|
||||
<< " 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;
|
||||
|
@ -52,7 +52,7 @@ InsetCaption::InsetCaption(BufferParams const & bp)
|
||||
void InsetCaption::write(Buffer const & buf, ostream & os) const
|
||||
{
|
||||
os << "Caption\n";
|
||||
writeParagraphData(buf, os);
|
||||
text_.write(buf, os);
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,7 +79,7 @@ bool InsetCollapsable::insertInset(BufferView * bv, InsetOld * in)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -143,18 +143,7 @@ auto_ptr<InsetBase> InsetText::clone() const
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,8 +97,6 @@ public:
|
||||
bool toggleall = false,
|
||||
bool selectall = false);
|
||||
///
|
||||
void writeParagraphData(Buffer const &, std::ostream &) const;
|
||||
///
|
||||
void setText(std::string const &, LyXFont const &);
|
||||
///
|
||||
void setAutoBreakRows(bool);
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include "insets/inset.h"
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
class Buffer;
|
||||
class BufferParams;
|
||||
class BufferView;
|
||||
@ -389,6 +391,8 @@ public:
|
||||
///
|
||||
bool checkAndActivateInset(bool front);
|
||||
|
||||
///
|
||||
void write(Buffer const & buf, std::ostream & os) const;
|
||||
|
||||
public:
|
||||
///
|
||||
|
10
src/text.C
10
src/text.C
@ -1757,3 +1757,13 @@ void LyXText::getWord(LyXCursor & from, LyXCursor & to, word_location const loc)
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user