]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalSupport.cpp
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / ExternalSupport.cpp
index 0d2615883bd745cf42fe2d99a4a66d58586040f8..0b7af3443e8a9d84de57abe6eb1585b2e58e48c5 100644 (file)
@@ -50,8 +50,8 @@ Template const * getTemplatePtr(InsetExternalParams const & params)
 
 void editExternal(InsetExternalParams const & params, Buffer const & buffer)
 {
-       formats.edit(buffer, params.filename.availableFile(),
-                    formats.getFormatFromFile(params.filename));
+       formats.edit(buffer, params.filename
+               formats.getFormatFromFile(params.filename));
 }
 
 
@@ -130,7 +130,7 @@ string const doSubstitution(InsetExternalParams const & params,
                                    relToParentPath, use_latex_path,
                                    PROTECT_EXTENSION,
                                    ESCAPE_DOTS);
-               if (FileName(filename).isAbsolute()) {
+               if (FileName::isAbsolute(filename)) {
                        result = subst_path(result, "$$AbsOrRelPathMaster",
                                            abspath, use_latex_path,
                                            PROTECT_EXTENSION,
@@ -254,7 +254,7 @@ void updateExternal(InsetExternalParams const & params,
 
                if (from_checksum != temp_checksum) {
                        Mover const & mover = getMover(from_format);
-                       if (!mover.copy(params.filename.availableFile(), temp_file)) {
+                       if (!mover.copy(params.filename, temp_file)) {
                                LYXERR(Debug::EXTERNAL, "external::updateExternal. "
                                        << "Unable to copy " << params.filename << " to " << temp_file);
                                return; // FAILURE
@@ -296,7 +296,9 @@ void updateExternal(InsetExternalParams const & params,
                                                      ALL_BUT_PATHS);
                                // if file is a relative name, it is interpreted
                                // relative to the master document.
-                               exportdata.addExternalFile(rit->first, source, file);
+                               if (makeAbsPath(file, masterBuffer->filePath()) !=
+                                       params.filename.absFilename())
+                                               exportdata.addExternalFile(rit->first, source, file);
                        }
                }
        }
@@ -310,7 +312,7 @@ void updateExternal(InsetExternalParams const & params,
        ErrorList el;
        bool const success =
                theConverters().convert(&buffer, temp_file, abs_to_file,
-                                  params.filename.availableFile(), from_format, to_format, el,
+                                  params.filename, from_format, to_format, el,
                                   Converters::try_default | Converters::try_cache);
 
        if (!success) {