Also catch the endl manipulator for automatic line counting.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37657 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2011-02-14 17:09:39 +00:00
parent 5d774518c6
commit 05491c58cc
3 changed files with 15 additions and 2 deletions

View File

@ -1453,8 +1453,7 @@ void Buffer::writeLaTeXSource(otexstream & os,
d->setParent(save_parent); d->setParent(save_parent);
// add this just in case after all the paragraphs // add this just in case after all the paragraphs
os.os() << endl; os << endl;
os.texrow().newline();
if (output_preamble) { if (output_preamble) {
os << "\\end{document}\n"; os << "\\end{document}\n";

View File

@ -447,6 +447,15 @@ otexstream & operator<<(otexstream & ots, SafeBreakLine)
} }
otexstream & operator<<(otexstream & ots, odocstream_manip pf)
{
ots.os() << pf;
if (pf == static_cast<odocstream_manip>(endl))
ots.texrow().newline();
return ots;
}
otexstream & operator<<(otexstream & ots, docstring const & s) otexstream & operator<<(otexstream & ots, docstring const & s)
{ {
size_t const len = s.length(); size_t const len = s.length();

View File

@ -83,6 +83,9 @@ typedef std::basic_istringstream<char_type> idocstringstream;
/// UCS4 output stringstream /// UCS4 output stringstream
typedef std::basic_ostringstream<char_type> odocstringstream; typedef std::basic_ostringstream<char_type> odocstringstream;
/// UCS4 output manipulator
typedef odocstream & (*odocstream_manip)(odocstream &);
/** Wrapper class for odocstream. /** Wrapper class for odocstream.
This class is used to automatically count the lines of the exported latex This class is used to automatically count the lines of the exported latex
code and also to ensure that no blank lines may be inadvertently output. code and also to ensure that no blank lines may be inadvertently output.
@ -140,6 +143,8 @@ otexstream & operator<<(otexstream &, BreakLine);
/// ///
otexstream & operator<<(otexstream &, SafeBreakLine); otexstream & operator<<(otexstream &, SafeBreakLine);
/// ///
otexstream & operator<<(otexstream &, odocstream_manip);
///
otexstream & operator<<(otexstream &, docstring const &); otexstream & operator<<(otexstream &, docstring const &);
/// ///
otexstream & operator<<(otexstream &, char const *); otexstream & operator<<(otexstream &, char const *);