]> git.lyx.org Git - lyx.git/blobdiff - src/converter.C
Remove unused font variable which caused a warning.
[lyx.git] / src / converter.C
index ea8d9cc304aa486dd3450f526766ffb3df4fb018..aa3fbe8d6b06fff52655c32ac1a1638e456591d2 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *        
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 #include "bufferview_funcs.h"
 #include "LaTeX.h"
 #include "LyXView.h"
-#include "minibuffer.h"
 #include "lyx_gui_misc.h"
 #include "lyx_cb.h" // ShowMessage()
 #include "support/lyxfunctional.h"
+#include "gettext.h"
+#include "BufferView.h"
 
 using std::vector;
 using std::queue;
@@ -85,7 +86,7 @@ Format const * Formats::GetFormat(string const & name) const
 {
        FormatList::const_iterator cit =
                find_if(formatlist.begin(), formatlist.end(),
-                       compare_memfun(&Format::name, name));
+                       lyx::compare_memfun(&Format::name, name));
        if (cit != formatlist.end())
                return &(*cit);
        else
@@ -97,7 +98,7 @@ int Formats::GetNumber(string const & name) const
 {
        FormatList::const_iterator cit =
                find_if(formatlist.begin(), formatlist.end(),
-                       compare_memfun(&Format::name, name));
+                       lyx::compare_memfun(&Format::name, name));
        if (cit != formatlist.end())
                return cit - formatlist.begin();
        else
@@ -117,7 +118,7 @@ void Formats::Add(string const & name, string const & extension,
 {
        FormatList::iterator it = 
                find_if(formatlist.begin(), formatlist.end(),
-                       compare_memfun(&Format::name, name));
+                       lyx::compare_memfun(&Format::name, name));
        if (it == formatlist.end())
                formatlist.push_back(Format(name, extension, prettyname,
                                            shortcut, ""));
@@ -132,7 +133,7 @@ void Formats::Delete(string const & name)
 {
        FormatList::iterator it = 
                find_if(formatlist.begin(), formatlist.end(),
-                       compare_memfun(&Format::name, name));
+                       lyx::compare_memfun(&Format::name, name));
        if (it != formatlist.end())
                formatlist.erase(it);
 }
@@ -149,7 +150,7 @@ void Formats::SetViewer(string const & name, string const & command)
        Add(name);
        FormatList::iterator it =
                find_if(formatlist.begin(), formatlist.end(),
-                       compare_memfun(&Format::name, name));
+                       lyx::compare_memfun(&Format::name, name));
        if (it != formatlist.end())
                it->setViewer(command);
 }
@@ -188,7 +189,7 @@ bool Formats::View(Buffer const * buffer, string const & filename,
 
        command += " " + QuoteName(OnlyFilename((filename)));
 
-       lyxerr << "Executing command: " << command << endl;
+       lyxerr[Debug::FILES] << "Executing command: " << command << endl;
        ShowMessage(buffer, _("Executing command:"), command);
 
        Path p(OnlyPath(filename));
@@ -573,7 +574,7 @@ bool Converters::Convert(Buffer const * buffer,
                Converter const & conv = converterlist[*cit];
                bool dummy = conv.To->dummy() && conv.to != "program";
                if (!dummy)
-                       lyxerr << "Converting from  "
+                       lyxerr[Debug::FILES] << "Converting from  "
                               << conv.from << " to " << conv.to << endl;
                infile = outfile;
                outfile = conv.result_dir.empty()
@@ -586,14 +587,15 @@ bool Converters::Convert(Buffer const * buffer,
                if (conv.latex) {
                        run_latex = true;
                        string command = subst(conv.command, token_from, "");
-                       lyxerr << "Running " << command << endl;
+                       lyxerr[Debug::FILES] << "Running " << command << endl;
                        if (!runLaTeX(buffer, command))
                                return false;
                } else {
                        if (conv.need_aux && !run_latex
                            && !latex_command.empty()) {
-                               lyxerr << "Running " << latex_command 
-                                      << " to update aux file"<<  endl;
+                               lyxerr[Debug::FILES] 
+                                       << "Running " << latex_command 
+                                       << " to update aux file"<<  endl;
                                runLaTeX(buffer, latex_command);
                        }
 
@@ -617,7 +619,7 @@ bool Converters::Convert(Buffer const * buffer,
                                command = add_options(command,
                                                      dvipdfm_options(buffer));
 
-                       lyxerr << "Calling " << command << endl;
+                       lyxerr[Debug::FILES] << "Calling " << command << endl;
                        if (buffer)
                                ShowMessage(buffer, _("Executing command:"), command);
 
@@ -697,9 +699,10 @@ bool Converters::Move(string const & from, string const & to, bool copy)
             it != files.end(); ++it)
                if (prefixIs(*it, base)) {
                        string from2 = path + *it;
-                       string to2 = to_base + (*it).substr(base.length());
+                       string to2 = to_base + it->substr(base.length());
                        to2 = ChangeExtension(to2, to_extension);
-                       lyxerr << "moving " << from2 << " to " << to2 << endl;
+                       lyxerr[Debug::FILES] << "moving " << from2 
+                                            << " to " << to2 << endl;
                        bool moved = (copy)
                                ? lyx::copy(from2, to2)
                                : lyx::rename(from2, to2);
@@ -758,7 +761,7 @@ bool Converters::scanLog(Buffer const * buffer, string const & command,
        BufferView * bv = buffer->getUser();
        bool need_redraw = false;
        if (bv) {
-               ProhibitInput(bv);
+               bv->owner()->prohibitInput();
                // Remove all error insets
                need_redraw = bv->removeAutoInsets();
        }
@@ -776,7 +779,7 @@ bool Converters::scanLog(Buffer const * buffer, string const & command,
                        bv->redraw();
                        bv->fitCursor(bv->text);
                }
-               AllowInput(bv);
+               bv->owner()->allowInput();
        }
 
        if ((result & LaTeX::ERRORS)) {
@@ -816,8 +819,8 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
        bool need_redraw = false;
 
        if (bv) {
-               ProhibitInput(bv);
-               bv->owner()->getMiniBuffer()->Set(_("Running LaTeX..."));
+               bv->owner()->prohibitInput();
+               bv->owner()->message(_("Running LaTeX..."));
                // Remove all error insets
                need_redraw = bv->removeAutoInsets();
        }
@@ -827,7 +830,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
        TeXErrors terr;
        LaTeX latex(command, name, buffer->filepath);
        int result = latex.run(terr,
-                              bv ? bv->owner()->getMiniBuffer() : 0);
+                              bv ? bv->owner()->getLyXFunc() : 0);
        
 
        if (bv) {
@@ -870,7 +873,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
        }
 
        if (bv)
-               AllowInput(bv);
+               bv->owner()->allowInput();
  
        int const ERROR_MASK = 
                        LaTeX::NO_LOGFILE |