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