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