]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalSupport.C
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / ExternalSupport.C
index b96abfd07cc31e6658081491799ee5b7e004d846..b60fee1f02106403d50503fbe43a43bf0508b377 100644 (file)
@@ -21,6 +21,7 @@
 #include "debug.h"
 #include "exporter.h"
 #include "format.h"
+#include "mover.h"
 
 #include "support/filetools.h"
 #include "support/forkedcall.h"
@@ -55,7 +56,7 @@ void editExternal(InsetExternalParams const & params, Buffer const & buffer)
 {
        string const file_with_path = params.filename.absFilename();
        formats.edit(buffer, file_with_path,
-                    support::getExtFromContents(file_with_path));
+                    support::getFormatFromContents(file_with_path));
 }
 
 
@@ -173,7 +174,7 @@ void updateExternal(InsetExternalParams const & params,
                        return; // NOT_NEEDED
 
                // Try and ascertain the file format from its contents.
-               from_format = support::getExtFromContents(abs_from_file);
+               from_format = support::getFormatFromContents(abs_from_file);
                if (from_format.empty())
                        return; // FAILURE
 
@@ -204,7 +205,8 @@ void updateExternal(InsetExternalParams const & params,
                unsigned long const temp_checksum = support::sum(temp_file);
 
                if (from_checksum != temp_checksum) {
-                       if (!support::copy(abs_from_file, temp_file)) {
+                       Mover const & mover = movers(from_format);
+                       if (!mover.copy(abs_from_file, temp_file)) {
                                lyxerr[Debug::EXTERNAL]
                                        << "external::updateExternal. "
                                        << "Unable to copy "