]> git.lyx.org Git - lyx.git/blob - src/PrinterParams.cpp
Enable OK/Apply buttons when resetting to class defaults.
[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         file_name = std::string();
27         all_pages = true;
28         from_page = 1;
29         to_page = 0;
30         odd_pages = true;
31         even_pages = true;
32         count_copies = 1;
33         sorted_copies = false;
34         reverse_order = false;
35
36         testInvariant();
37 }
38
39
40 void PrinterParams::testInvariant() const
41 {
42 #ifdef ENABLE_ASSERTIONS
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                 LATTEST(!file_name.empty());
51                 break;
52         default:
53                 LATTEST(false);
54                 break;
55         }
56 #endif
57 }
58
59
60 } // namespace lyx