]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlPrint.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlPrint.C
index 747e55b2bc1d9116ecd28857d30488b2bbfbfed3..18718d24d9ee40f0dfaeca32e68f95960ea9d7e5 100644 (file)
 #include "gettext.h"
 #include "PrinterParams.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
+#include "support/filefilterlist.h"
 #include "support/filetools.h"
-#include "support/globbing.h"
-
-using lyx::support::ChangeExtension;
-using lyx::support::FileFilterList;
 
 using std::string;
 
+namespace lyx {
+
+using support::ChangeExtension;
+using support::FileFilterList;
+
+namespace frontend {
+
+
 ControlPrint::ControlPrint(Dialog & parent)
        : Dialog::Controller(parent),
          params_(0)
@@ -66,7 +71,7 @@ string const ControlPrint::browse(string const & in_name) const
 {
        return browseRelFile(in_name, kernel().buffer().filePath(),
                             _("Print to file"),
-                            FileFilterList("PostScript files (*.ps)"),
+                            FileFilterList(_("PostScript files (*.ps)")),
                             true);
 }
 
@@ -87,11 +92,11 @@ void ControlPrint::dispatchParams()
 
        if (!pp.all_pages && pp.from_page) {
                command += lyxrc.print_pagerange_flag + ' ';
-               command += tostr(pp.from_page);
+               command += convert<string>(pp.from_page);
                if (pp.to_page) {
                        // we have a range "from-to"
                        command += '-'
-                               + tostr(pp.to_page);
+                               + convert<string>(pp.to_page);
                }
                command += ' ';
        }
@@ -112,7 +117,7 @@ void ControlPrint::dispatchParams()
                        command += lyxrc.print_copies_flag;
                }
                command += ' '
-                       + tostr(pp.count_copies)
+                       + convert<string>(pp.count_copies)
                        + ' ';
        }
 
@@ -134,5 +139,8 @@ void ControlPrint::dispatchParams()
                pp.file_name;
 
        string const data = target + " " + target_name + " " + command;
-       kernel().dispatch(FuncRequest(LFUN_PRINT, data));
+       kernel().dispatch(FuncRequest(getLfun(), data));
 }
+
+} // namespace frontend
+} // namespace lyx