]> git.lyx.org Git - lyx.git/blobdiff - src/converter.C
citation patch from Angus
[lyx.git] / src / converter.C
index cf38de44bf59bc747fd43a06f58ed5ff717e8d7d..99580fe06f65f5dc895b629cd9220b2b4f141b7d 100644 (file)
 #include "LyXView.h"
 #include "minibuffer.h"
 #include "lyx_gui_misc.h"
+#include "lyx_cb.h"
 
 using std::map;
 using std::vector;
 using std::queue;
+using std::pair;
+using std::sort;
 using std::stack;
-
-extern void ShowMessage(Buffer * buf,
-                string const & msg1,
-                string const & msg2 = string(),
-                string const & msg3 = string(), int delay = 6);
+using std::endl;
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -49,7 +48,8 @@ vector<Command> Converter::commands;
 
 //////////////////////////////////////////////////////////////////////////////
 
-Format::Format(string const & n) : name(n), in_degree(0)
+Format::Format(string const & n)
+       : name(n), in_degree(0)
 {
        struct Item {
                char const * name;
@@ -73,12 +73,14 @@ Format::Format(string const & n) : name(n), in_degree(0)
                }
 }
 
+
 void Formats::Add(string const & name)
 {
        if (formats.find(name) == formats.end())
                formats[name] = Format(name);
 }
 
+
 void Formats::SetViewer(string const & name, string const & command)
 {
        Add(name);
@@ -147,9 +149,8 @@ Format * Formats::GetFormat(string const & name)
                return 0;
 }
 
-string Formats::PrettyName(string const & name)
+string const Formats::PrettyName(string const & name)
 {
-
        string format;
        Converter::SplitFormat(name, format);
        Format * f = GetFormat(format);
@@ -159,6 +160,7 @@ string Formats::PrettyName(string const & name)
                return format;
 }
 
+
 //////////////////////////////////////////////////////////////////////////////
 void Converter::Add(string const & from, string const & to,
                    string const & command, string const & flags)
@@ -179,7 +181,8 @@ void Converter::Add(string const & from, string const & to,
        ++Formats::GetFormat(to)->in_degree;
 }
 
-vector< pair<string,string> > 
+
+vector< pair<string,string> > const
 Converter::GetReachable(string const & from, bool only_viewable)
 {
        vector< pair<string,string> > result;
@@ -233,8 +236,8 @@ bool Converter::convert(Buffer * buffer, string const & from_file,
                        string const & to_format)
 
 {
-       string using_format, format;
-       using_format = SplitFormat(to_format, format);
+       string format;
+       string using_format = SplitFormat(to_format, format);
        string from_format = GetExtension(from_file);
        if (from_format == format)
                return true;
@@ -336,7 +339,7 @@ bool Converter::convert(Buffer * buffer, string const & from_file,
 }
 
 
-string Converter::SplitFormat(string const & str, string & format)
+string const Converter::SplitFormat(string const & str, string & format)
 {
        string using_format = split(str, format, ':');
        if (format.empty())
@@ -344,6 +347,7 @@ string Converter::SplitFormat(string const & str, string & format)
        return using_format;
 }
 
+
 bool Converter::runLaTeX(Buffer * buffer, string const & command)
 {