]> git.lyx.org Git - lyx.git/blob - src/PrinterParams.cpp
Split pdf format as discussed on the list
[lyx.git] / src / PrinterParams.cpp
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.
5  *
6  * \author Allan Rae
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "PrinterParams.h"
14
15 #include "LyXRC.h"
16
17 #include "support/lassert.h"
18 #include "support/lstrings.h"
19
20
21 namespace lyx {
22
23 PrinterParams::PrinterParams() 
24 {
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;
36
37         testInvariant();
38 }
39
40
41 void PrinterParams::testInvariant() const
42 {
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;
55         }
56 }
57
58
59 } // namespace lyx