mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
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:
parent
9b5a63aaaf
commit
3000b1baff
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user