#include "Buffer.h"
#include "Converter.h"
#include "debug.h"
+#include "gettext.h"
#include "ErrorList.h"
#include "Exporter.h"
#include "Format.h"
#include "Mover.h"
+#include "frontends/alert.h"
+
#include "support/filetools.h"
#include "support/Forkedcall.h"
#include "support/lstrings.h"
#include <boost/filesystem/operations.hpp>
+#include <algorithm>
+
using std::endl;
using std::string;
using std::vector;
namespace lyx {
using support::FileName;
+using support::isValidLaTeXFilename;
namespace external {
bool const use_latex_path = format == "LaTeX";
string str = doSubstitution(params, buffer, cit->second.product,
use_latex_path, external_in_tmpdir);
+
+ string const absname = support::makeAbsPath(
+ params.filename.outputFilename(buffer.filePath()), buffer.filePath()).absFilename();
+
+ if (!external_in_tmpdir && !isValidLaTeXFilename(absname)) {
+ lyx::frontend::Alert::warning(_("Invalid filename"),
+ _("The following filename is likely to cause trouble "
+ "when running the exported file through LaTeX: ") +
+ from_utf8(absname));
+ }
+
str = substituteCommands(params, str, format);
str = substituteOptions(params, str, format);
// FIXME UNICODE
os << from_utf8(str);
- return int(lyx::count(str.begin(), str.end(),'\n'));
+ return int(std::count(str.begin(), str.end(),'\n'));
}
namespace {