]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Liason.C
Spaces menu for math dialog
[lyx.git] / src / frontends / Liason.C
index 0c05c3554d0fabb1ec5d6f3e935111ae4e0bbbe2..1c962dec523d303d6868d2ebc30581d2758c25b4 100644 (file)
@@ -30,6 +30,8 @@
 #include "support/path.h"
 #include "support/systemcall.h"
 
+#include "debug.h" // for lyxerr
+
 using std::endl;
 
 namespace Liason {
@@ -55,45 +57,40 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp)
                        + ' ';
        }
 
-       switch (pp.which_pages) {
-       case PrinterParams::EVEN:
-               command += lyxrc.print_evenpage_flag + ' ';
-               break;
-
-       case PrinterParams::ODD:
-               command += lyxrc.print_oddpage_flag + ' ';
-               break;
-
-       default:
-               // only option left is print all of them
-               break;
-       }
-
-       if (!pp.from_page.empty()) {
+       if (!pp.all_pages && pp.from_page) {
                command += lyxrc.print_pagerange_flag + ' ';
-               command += pp.from_page;
+               command += tostr(pp.from_page);
                if (pp.to_page) {
-                               // we have a range "from-to"
+                       // we have a range "from-to"
                        command += '-';
                        command += tostr(pp.to_page);
                }
                command += ' ';
        }
 
-       if (pp.reverse_order) {
-               command += lyxrc.print_reverse_flag + ' ';
+       // If both are, or both are not selected, then skip the odd/even printing
+       if (pp.odd_pages != pp.even_pages) {
+               if (pp.odd_pages) {
+                       command += lyxrc.print_oddpage_flag + ' ';
+               } else if (pp.even_pages) {
+                       command += lyxrc.print_evenpage_flag + ' ';
+               }
        }
 
-       if (1 < pp.count_copies) {
-               if (pp.unsorted_copies) {
-                       command += lyxrc.print_copies_flag;
-               } else {
+       if (pp.count_copies > 1) {
+               if (pp.sorted_copies) {
                        command += lyxrc.print_collcopies_flag;
+               } else {
+                       command += lyxrc.print_copies_flag;
                }
                command += ' ';
                command += tostr(pp.count_copies);
                command += ' ';
        }
+       
+       if (pp.reverse_order) {
+               command += lyxrc.print_reverse_flag + ' ';
+       }
 
        if (!lyxrc.print_extra_options.empty()) {
                command += lyxrc.print_extra_options + ' ';
@@ -151,6 +148,9 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp)
                res = one.startscript(Systemcall::DontWait, command);
                break;
        }
+
+       lyxerr[Debug::LATEX] << "printBuffer: \"" << command << "\"\n";
+
        return res == 0;
 }