X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalSupport.cpp;h=6d009a5dd2b13814d9bd7c0c3fdc092d860e7476;hb=d044d6afa7192b2119784e1415e71dad644bc335;hp=d21c3d84abc4ac0f3832da2e10258acc45a851a5;hpb=0838992dcd5a120d2b422ec734ebd52b0fdd3c7c;p=lyx.git diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp index d21c3d84ab..6d009a5dd2 100644 --- a/src/insets/ExternalSupport.cpp +++ b/src/insets/ExternalSupport.cpp @@ -333,23 +333,23 @@ string const substituteOptions(InsetExternalParams const & params, } // namespace anon -int writeExternal(InsetExternalParams const & params, - string const & format, - Buffer const & buffer, odocstream & os, - ExportData & exportdata, - bool external_in_tmpdir, - bool dryrun) +void writeExternal(InsetExternalParams const & params, + string const & format, + Buffer const & buffer, otexstream & os, + ExportData & exportdata, + bool external_in_tmpdir, + bool dryrun) { Template const * const et_ptr = getTemplatePtr(params); if (!et_ptr) - return 0; + return; Template const & et = *et_ptr; Template::Formats::const_iterator cit = et.formats.find(format); if (cit == et.formats.end()) { LYXERR(Debug::EXTERNAL, "External template format '" << format << "' not specified in template " << params.templatename()); - return 0; + return; } if (!dryrun || contains(cit->second.product, "$$Contents")) @@ -381,20 +381,9 @@ int writeExternal(InsetExternalParams const & params, str = substituteCommands(params, str, format); str = substituteOptions(params, str, format); - // If the template is a date, we must remove the newline at the end to - // avoid LaTeX errors like the one described in bug #4398 - if (params.templatename() == "Date") { - // depending on the OS we have either \r\n or only \n - size_t pos = str.rfind('\r'); - if (pos != string::npos) - str.erase(pos); - pos = str.rfind('\n'); - if (pos != string::npos) - str.erase(pos); - } // FIXME UNICODE os << from_utf8(str); - return int(count(str.begin(), str.end(),'\n')); + return; } namespace {