]> git.lyx.org Git - lyx.git/blob - src/PrinterParams.C
General tidy. Not very exciting.
[lyx.git] / src / PrinterParams.C
1 /**
2  * \file PrinterParams.C
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 "support/lstrings.h"
16 #include "support/LAssert.h"
17
18
19 PrinterParams::PrinterParams(Target t,
20                              string const & pname,
21                              string const & fname,
22                              bool all,
23                              unsigned int from,
24                              unsigned int to,
25                              bool odd,
26                              bool even,
27                              unsigned int copies,
28                              bool sorted,
29                              bool reverse)
30         : target(t),
31           printer_name(pname),
32           file_name(fname),
33           all_pages(all),
34           from_page(from),
35           to_page(to),
36           odd_pages(odd),
37           even_pages(even),
38           count_copies(copies),
39           sorted_copies(sorted),
40           reverse_order(reverse)
41 {
42         testInvariant();
43 }
44
45
46 PrinterParams::PrinterParams(PrinterParams const & pp)
47         : target(pp.target),
48           printer_name(pp.printer_name),
49           file_name(pp.file_name),
50           all_pages(pp.all_pages),
51           from_page(pp.from_page),
52           to_page(pp.to_page),
53           odd_pages(pp.odd_pages),
54           even_pages(pp.even_pages),
55           count_copies(pp.count_copies),
56           sorted_copies(pp.sorted_copies),
57           reverse_order(pp.reverse_order)
58 {
59         testInvariant();
60 }
61
62
63 void PrinterParams::testInvariant() const
64 {
65 #ifdef ENABLE_ASSERTIONS
66         switch (target) {
67         case PRINTER:
68                 //lyx::support::Assert(!printer_name.empty());
69                 break;
70         case FILE:
71                 lyx::support::Assert(!file_name.empty());
72                 break;
73         default:
74                 lyx::support::Assert(false);
75                 break;
76         }
77 #endif
78 }