#include "debug.h"
#include "exporter.h"
#include "format.h"
+#include "mover.h"
#include "support/filetools.h"
#include "support/forkedcall.h"
{
string const file_with_path = params.filename.absFilename();
formats.edit(buffer, file_with_path,
- support::getExtFromContents(file_with_path));
+ support::getFormatFromContents(file_with_path));
}
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
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 "
exportdata.addExternalFile(rit->first, file);
}
}
-
+
// Do we need to perform the conversion?
// Yes if to_file does not exist or if from_file is newer than to_file
if (support::compare_timestamps(abs_from_file, abs_to_file) < 0)