X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalSupport.cpp;h=37c382a37f64cf6b8a4636c95f3b946a9024a7a7;hb=860accd01fb8115ec7c6ad80b054f1046e19c62f;hp=b5afc0c1d913294b8c24fb9dbf274bafb1e9ffe6;hpb=0f4c5df9f45e71ac52c59e9d6022a1bce5c8183b;p=lyx.git diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp index b5afc0c1d9..37c382a37f 100644 --- a/src/insets/ExternalSupport.cpp +++ b/src/insets/ExternalSupport.cpp @@ -22,6 +22,7 @@ #include "Exporter.h" #include "Format.h" #include "Mover.h" +#include "texstream.h" #include "frontends/alert.h" @@ -199,7 +200,7 @@ string const doSubstitution(InsetExternalParams const & params, size_t const pos = result.find("$$Contents(\""); size_t const end = result.find("\")", pos); - result.replace(pos, end + 2, contents); + result.replace(pos, end + 2- pos, contents); } return result; @@ -260,10 +261,11 @@ void updateExternal(InsetExternalParams const & params, // We copy the source file to the temp dir and do the conversion // there if necessary + bool const isDir = params.filename.isDirectory(); FileName const temp_file( makeAbsPath(params.filename.mangledFileName(), masterBuffer->temppath())); - if (!params.filename.empty() && !params.filename.isDirectory()) { + if (!params.filename.empty() && !isDir) { unsigned long const from_checksum = params.filename.checksum(); unsigned long const temp_checksum = temp_file.checksum(); @@ -320,7 +322,8 @@ void updateExternal(InsetExternalParams const & params, // Do we need to perform the conversion? // Yes if to_file does not exist or if from_file is newer than to_file - if (compare_timestamps(temp_file, abs_to_file) < 0) + // or if from_file is a directory (bug 9925) + if (!isDir && compare_timestamps(temp_file, abs_to_file) < 0) return; // SUCCESS // FIXME (Abdel 12/08/06): Is there a need to show these errors? @@ -432,7 +435,7 @@ string const substituteIt(string const & input, else if (id == Resize) ptr = store.getCommandTransformer(params.resizedata); - if (!ptr.get()) + if (!ptr) return input; string result = @@ -471,7 +474,7 @@ string const substituteIt(string const & input, break; } - if (!ptr.get()) + if (!ptr) return input; return subst(input, ptr->placeholder(), ptr->option());