]> git.lyx.org Git - lyx.git/blobdiff - src/Format.cpp
Embedding: saving inzip name to .lyx file so that embedded files can always be found...
[lyx.git] / src / Format.cpp
index ccaf5ab3c0db14d922565518efa2ac1a1cd994d0..edfdf4135ba1e03ea2d295081b6db20bedf44ba8 100644 (file)
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "LyXRC.h"
-#include "debug.h"
-#include "gettext.h"
 #include "ServerSocket.h"
 
-#include "frontends/Application.h"
 #include "frontends/alert.h" //to be removed?
 
+#include "support/debug.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Systemcall.h"
 
-using std::find_if;
-using std::string;
-using std::distance;
-
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
-using support::absolutePath;
-using support::bformat;
-using support::compare_ascii_no_case;
-using support::contains;
-using support::FileName;
-using support::libScriptSearch;
-using support::makeDisplayPath;
-using support::onlyPath;
-using support::quoteName;
-using support::subst;
-using support::Systemcall;
-using support::token;
-
 namespace Alert = frontend::Alert;
 namespace os = support::os;
 
@@ -56,7 +40,7 @@ string const token_path_format("$$p");
 string const token_socket_format("$$a");
 
 
-class FormatNamesEqual : public std::unary_function<Format, bool> {
+class FormatNamesEqual : public unary_function<Format, bool> {
 public:
        FormatNamesEqual(string const & name)
                : name_(name) {}
@@ -69,7 +53,7 @@ private:
 };
 
 
-class FormatExtensionsEqual : public std::unary_function<Format, bool> {
+class FormatExtensionsEqual : public unary_function<Format, bool> {
 public:
        FormatExtensionsEqual(string const & extension)
                : extension_(extension) {}
@@ -145,7 +129,7 @@ string Formats::getFormatFromFile(FileName const & filename) const
                return format;
 
        // try to find a format from the file extension.
-       string const ext = support::getExtension(filename.absFilename());
+       string const ext = getExtension(filename.absFilename());
        if (!ext.empty()) {
                // this is ambigous if two formats have the same extension,
                // but better than nothing
@@ -153,9 +137,8 @@ string Formats::getFormatFromFile(FileName const & filename) const
                        find_if(formatlist.begin(), formatlist.end(),
                                FormatExtensionsEqual(ext));
                if (cit != formats.end()) {
-                       LYXERR(Debug::GRAPHICS)
-                               << "\twill guess format from file extension: "
-                               << ext << " -> " << cit->name() << std::endl;
+                       LYXERR(Debug::GRAPHICS, "\twill guess format from file extension: "
+                               << ext << " -> " << cit->name());
                        return cit->name();
                }
        }
@@ -311,7 +294,7 @@ bool Formats::view(Buffer const & buffer, FileName const & filename,
        command = subst(command, token_from_format, quoteName(filename.toFilesystemEncoding()));
        command = subst(command, token_path_format, quoteName(onlyPath(filename.toFilesystemEncoding())));
        command = subst(command, token_socket_format, quoteName(theServerSocket().address()));
-       LYXERR(Debug::FILES) << "Executing command: " << command << std::endl;
+       LYXERR(Debug::FILES, "Executing command: " << command);
        // FIXME UNICODE utf8 can be wrong for files
        buffer.message(_("Executing command: ") + from_utf8(command));
 
@@ -370,7 +353,7 @@ bool Formats::edit(Buffer const & buffer, FileName const & filename,
        command = subst(command, token_from_format, quoteName(filename.toFilesystemEncoding()));
        command = subst(command, token_path_format, quoteName(onlyPath(filename.toFilesystemEncoding())));
        command = subst(command, token_socket_format, quoteName(theServerSocket().address()));
-       LYXERR(Debug::FILES) << "Executing command: " << command << std::endl;
+       LYXERR(Debug::FILES, "Executing command: " << command);
        // FIXME UNICODE utf8 can be wrong for files
        buffer.message(_("Executing command: ") + from_utf8(command));