X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalSupport.C;h=d84baf75069b5a48e9ec22d0d8544259387f86d4;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=f4410fe1c9fd7ec4b8f86cb15d098eb5dcf9cca0;hpb=8e6e970d7ba017dba14bdb821f4c4489665d947c;p=lyx.git diff --git a/src/insets/ExternalSupport.C b/src/insets/ExternalSupport.C index f4410fe1c9..d84baf7506 100644 --- a/src/insets/ExternalSupport.C +++ b/src/insets/ExternalSupport.C @@ -67,9 +67,11 @@ string const subst_path(string const & input, { if (input.find(placeholder) == string::npos) return input; + // Don't use external_path here when use_latex_path is false, as the + // path will be compared with another one in internal style later + // in Converters::move. string const path2 = use_latex_path ? - support::latex_path(path, ext, dots) : - support::os::external_path(path); + support::latex_path(path, ext, dots) : path; return support::subst(input, placeholder, path2); } @@ -91,7 +93,7 @@ string const doSubstitution(InsetExternalParams const & params, params.filename.outputFilename(parentpath); string const basename = support::changeExtension( support::onlyFilename(filename), string()); - string const absname = support::makeAbsPath(filename, parentpath); + string const absname = support::makeAbsPath(filename, parentpath).absFilename(); string result = s; if (what != ALL_BUT_PATHS) { @@ -167,7 +169,7 @@ string const doSubstitution(InsetExternalParams const & params, string const file = result.substr(pos + 12, end - (pos + 12)); string contents; - FileName const absfile = FileName( + FileName const absfile( support::makeAbsPath(file, m_buffer->temppath())); if (support::isFileReadable(absfile)) contents = support::getFileContents(absfile); @@ -228,7 +230,7 @@ void updateExternal(InsetExternalParams const & params, if (to_format.empty()) return; // NOT_NEEDED - if (!converters.isReachable(from_format, to_format)) { + if (!theConverters().isReachable(from_format, to_format)) { lyxerr[Debug::EXTERNAL] << "external::updateExternal. " << "Unable to convert from " @@ -242,7 +244,7 @@ void updateExternal(InsetExternalParams const & params, // We copy the source file to the temp dir and do the conversion // there if necessary - FileName const temp_file = FileName( + FileName const temp_file( support::makeAbsPath(params.filename.mangledFilename(), m_buffer->temppath())); if (!params.filename.empty()) { @@ -250,7 +252,7 @@ void updateExternal(InsetExternalParams const & params, unsigned long const temp_checksum = support::sum(temp_file); if (from_checksum != temp_checksum) { - Mover const & mover = movers(from_format); + Mover const & mover = getMover(from_format); if (!mover.copy(params.filename, temp_file)) { lyxerr[Debug::EXTERNAL] << "external::updateExternal. " @@ -265,7 +267,7 @@ void updateExternal(InsetExternalParams const & params, string const to_file = doSubstitution(params, buffer, outputFormat.updateResult, false, true); - FileName const abs_to_file = FileName( + FileName const abs_to_file( support::makeAbsPath(to_file, m_buffer->temppath())); // Record the referenced files for the exporter. @@ -306,7 +308,7 @@ void updateExternal(InsetExternalParams const & params, // FIXME (Abdel 12/08/06): Is there a need to show these errors? ErrorList el; /* bool const success = */ - converters.convert(&buffer, temp_file, abs_to_file, + theConverters().convert(&buffer, temp_file, abs_to_file, params.filename, from_format, to_format, el, Converters::try_default | Converters::try_cache); // return success