Fix return value of InsetInclude::plaintext

* src/insets/insetinclude.C
	(InsetInclude::plaintext): Add line counting code


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14958 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-09-10 09:28:00 +00:00
parent 9b5a63aaaf
commit 3000b1baff

View File

@ -40,6 +40,7 @@
#include "insets/render_preview.h"
#include "support/lyxalgo.h"
#include "support/filename.h"
#include "support/filetools.h"
#include "support/lstrings.h" // contains
@ -472,8 +473,13 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
int InsetInclude::plaintext(Buffer const & buffer, ostream & os,
OutputParams const &) const
{
if (isVerbatim(params_))
os << getFileContents(includedFilename(buffer, params_));
if (isVerbatim(params_)) {
string const str =
getFileContents(includedFilename(buffer, params_));
os << str;
// Return how many newlines we issued.
return int(lyx::count(str.begin(), str.end(), '\n'));
}
return 0;
}