string const masterpath = external_in_tmpdir ?
m_buffer->temppath() :
m_buffer->filePath();
+ // FIXME UNICODE
string relToMasterPath = support::onlyPath(
- support::makeRelPath(absname, masterpath));
+ to_utf8(support::makeRelPath(from_utf8(absname),
+ from_utf8(masterpath))));
if (relToMasterPath == "./")
relToMasterPath.clear();
+ // FIXME UNICODE
string relToParentPath = support::onlyPath(
- support::makeRelPath(absname, parentpath));
+ to_utf8(support::makeRelPath(from_utf8(absname),
+ from_utf8(parentpath))));
if (relToParentPath == "./")
relToParentPath.clear();
'.' + support::getExtension(filename), use_latex_path);
result = subst_path(result, "$$Tempname", params.tempname().absFilename(), use_latex_path);
result = subst_path(result, "$$Sysdir",
- support::package().system_support(), use_latex_path);
+ support::package().system_support().absFilename(), use_latex_path);
// Handle the $$Contents(filename) syntax
if (support::contains(result, "$$Contents(\"")) {
if (to_format.empty())
return; // NOT_NEEDED
- if (!theConverters().isReachable(from_format, to_format)) {
- lyxerr[Debug::EXTERNAL]
- << "external::updateExternal. "
- << "Unable to convert from "
- << from_format << " to " << to_format << endl;
- return; // FAILURE
- }
-
// The master buffer. This is useful when there are multiple levels
// of include files
Buffer const * m_buffer = buffer.getMasterBuffer();
if (from_checksum != temp_checksum) {
Mover const & mover = getMover(from_format);
if (!mover.copy(params.filename, temp_file)) {
- lyxerr[Debug::EXTERNAL]
+ LYXERR(Debug::EXTERNAL)
<< "external::updateExternal. "
<< "Unable to copy "
<< params.filename << " to " << temp_file << endl;
// FIXME (Abdel 12/08/06): Is there a need to show these errors?
ErrorList el;
- /* bool const success = */
+ bool const success =
theConverters().convert(&buffer, temp_file, abs_to_file,
params.filename, from_format, to_format, el,
Converters::try_default | Converters::try_cache);
+
+ if (!success)
+ LYXERR(Debug::EXTERNAL)
+ << "external::updateExternal. "
+ << "Unable to convert from "
+ << from_format << " to " << to_format << endl;
+
// return success
}
Template::Formats::const_iterator cit = et.formats.find(format);
if (cit == et.formats.end()) {
- lyxerr[Debug::EXTERNAL]
+ LYXERR(Debug::EXTERNAL)
<< "External template format '" << format
<< "' not specified in template "
<< params.templatename() << endl;