]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalSupport.C
hopefully fix tex2lyx linking.
[lyx.git] / src / insets / ExternalSupport.C
index d8fd28e7bd99d30c19c6726b188c984352593f7c..087ac5d9f3a54630fb2091fd9c4bf724a91261e4 100644 (file)
 #include "support/package.h"
 #include "support/path.h"
 
-#include "support/std_ostream.h"
-
-namespace support = lyx::support;
-
 using std::endl;
-
-using std::ostream;
 using std::string;
 using std::vector;
 
@@ -311,11 +305,13 @@ void updateExternal(InsetExternalParams const & params,
        // Yes if to_file does not exist or if from_file is newer than to_file
        if (support::compare_timestamps(temp_file, abs_to_file) < 0)
                return; // SUCCESS
-       string const to_file_base =
-               support::changeExtension(to_file, string());
+
+       // FIXME (Abdel 12/08/06): Is there a need to show these errors?
+       ErrorList el;
        /* bool const success = */
-               converters.convert(&buffer, temp_file, to_file_base,
-                                  from_format, to_format, true);
+               converters.convert(&buffer, temp_file, abs_to_file,
+                                  abs_from_file, from_format, to_format, el,
+                                  Converters::try_default | Converters::try_cache);
        // return success
 }
 
@@ -331,7 +327,7 @@ string const substituteOptions(InsetExternalParams const & params,
 
 int writeExternal(InsetExternalParams const & params,
                  string const & format,
-                 Buffer const & buffer, ostream & os,
+                 Buffer const & buffer, odocstream & os,
                  ExportData & exportdata,
                  bool external_in_tmpdir,
                  bool external_in_comment)
@@ -359,7 +355,8 @@ int writeExternal(InsetExternalParams const & params,
                                    use_latex_path, external_in_tmpdir);
        str = substituteCommands(params, str, format);
        str = substituteOptions(params, str, format);
-       os << str;
+       // FIXME UNICODE
+       os << from_utf8(str);
        return int(lyx::count(str.begin(), str.end(),'\n'));
 }
 
@@ -482,8 +479,6 @@ string const substituteOption(InsetExternalParams const & params,
                return sanitizeLatexOption(opt);
        if (format == "DocBook")
                return sanitizeDocBookOption(opt);
-       if (format == "LinuxDoc")
-               return sanitizeLinuxDocOption(opt);
        return opt;
 }
 
@@ -512,9 +507,10 @@ string const substituteOptions(InsetExternalParams const & params,
        }
 
        return output;
- }
+}
 
 } // namespace anon
 
 } // namespace external
+
 } // namespace lyx