X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FPrinterParams.cpp;h=fd585903acfc965a47ad886779f6115c760a267a;hb=35540efe5224c932e4b0c740cc163f591b49950c;hp=0518d27850d5eb8d7dbfef16a6352eb265f2bf30;hpb=7f461f4392a19cf488dec005d2f12cfea83655d9;p=lyx.git diff --git a/src/PrinterParams.cpp b/src/PrinterParams.cpp index 0518d27850..fd585903ac 100644 --- a/src/PrinterParams.cpp +++ b/src/PrinterParams.cpp @@ -12,66 +12,39 @@ #include "PrinterParams.h" -#include "support/lstrings.h" - -#include "support/assert.h" +#include "LyXRC.h" +#include "support/lassert.h" +#include "support/lstrings.h" -using namespace std; namespace lyx { - -PrinterParams::PrinterParams(Target t, - string const & pname, - string const & fname, - bool all, - unsigned int from, - unsigned int to, - bool odd, - bool even, - unsigned int copies, - bool sorted, - bool reverse) - : target(t), - printer_name(pname), - file_name(fname), - all_pages(all), - from_page(from), - to_page(to), - odd_pages(odd), - even_pages(even), - count_copies(copies), - sorted_copies(sorted), - reverse_order(reverse) +PrinterParams::PrinterParams() { - testInvariant(); -} + target = PRINTER; + printer_name = lyxrc.printer; + file_name = std::string(); + all_pages = true; + from_page = 1; + to_page = 0; + odd_pages = true; + even_pages = true; + count_copies = 1; + sorted_copies = false; + reverse_order = false; - -PrinterParams::PrinterParams(PrinterParams const & pp) - : target(pp.target), - printer_name(pp.printer_name), - file_name(pp.file_name), - all_pages(pp.all_pages), - from_page(pp.from_page), - to_page(pp.to_page), - odd_pages(pp.odd_pages), - even_pages(pp.even_pages), - count_copies(pp.count_copies), - sorted_copies(pp.sorted_copies), - reverse_order(pp.reverse_order) -{ testInvariant(); } void PrinterParams::testInvariant() const { -#ifdef ENABLE_ASSERTIONS switch (target) { case PRINTER: - //LASSERT(!printer_name.empty(), /**/); + // We can't do this test, because no default printer + // may have been set. + // LASSERT(!printer_name.empty(), /**/); break; case FILE: LASSERT(!file_name.empty(), /**/); @@ -80,7 +53,6 @@ void PrinterParams::testInvariant() const LASSERT(false, /**/); break; } -#endif }