LyX 1.6.0 release candidate 4 (rc4)
[lyx.git] / src / PrinterParams.cpp
blobfd585903acfc965a47ad886779f6115c760a267a
1 /**
2 * \file PrinterParams.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Allan Rae
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "PrinterParams.h"
15 #include "LyXRC.h"
17 #include "support/lassert.h"
18 #include "support/lstrings.h"
21 namespace lyx {
23 PrinterParams::PrinterParams()
25 target = PRINTER;
26 printer_name = lyxrc.printer;
27 file_name = std::string();
28 all_pages = true;
29 from_page = 1;
30 to_page = 0;
31 odd_pages = true;
32 even_pages = true;
33 count_copies = 1;
34 sorted_copies = false;
35 reverse_order = false;
37 testInvariant();
41 void PrinterParams::testInvariant() const
43 switch (target) {
44 case PRINTER:
45 // We can't do this test, because no default printer
46 // may have been set.
47 // LASSERT(!printer_name.empty(), /**/);
48 break;
49 case FILE:
50 LASSERT(!file_name.empty(), /**/);
51 break;
52 default:
53 LASSERT(false, /**/);
54 break;
59 } // namespace lyx