From: Georg Baum Date: Sun, 10 Sep 2006 09:28:00 +0000 (+0000) Subject: Fix return value of InsetInclude::plaintext X-Git-Tag: 1.6.10~12611 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3000b1baffb573e46ef6afc71aa542e7cff08b91;p=features.git 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 --- diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 7d7cc36f95..72fd3b0156 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -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; }