qprintengine_pdf.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/printsupport/kernel/qprintengine_pdf.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14QPdfPrintEngine::QPdfPrintEngine(QPrinter::PrinterMode m)-
15 : QPdfEngine(*new QPdfPrintEnginePrivate(m))-
16{-
17 state = QPrinter::Idle;-
18}
executed 128 times by 2 tests: end of block
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
128
19-
20QPdfPrintEngine::QPdfPrintEngine(QPdfPrintEnginePrivate &p)-
21 : QPdfEngine(p)-
22{-
23 state = QPrinter::Idle;-
24}
never executed: end of block
0
25-
26QPdfPrintEngine::~QPdfPrintEngine()-
27{-
28}-
29-
30bool QPdfPrintEngine::begin(QPaintDevice *pdev)-
31{-
32 QPdfPrintEnginePrivate * const d = d_func();-
33-
34 if (!d->openPrintDevice()
!d->openPrintDevice()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPrinter
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QPrinter
) {
1-20
35 state = QPrinter::Error;-
36 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QPrinter
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QPrinter
1
37 }-
38 state = QPrinter::Active;-
39-
40 return
executed 20 times by 1 test: return QPdfEngine::begin(pdev);
Executed by:
  • tst_QPrinter
QPdfEngine::begin(pdev);
executed 20 times by 1 test: return QPdfEngine::begin(pdev);
Executed by:
  • tst_QPrinter
20
41}-
42-
43bool QPdfPrintEngine::end()-
44{-
45 QPdfPrintEnginePrivate * const d = d_func();-
46-
47 QPdfEngine::end();-
48-
49 d->closePrintDevice();-
50 state = QPrinter::Idle;-
51-
52 return
executed 20 times by 1 test: return true;
Executed by:
  • tst_QPrinter
true;
executed 20 times by 1 test: return true;
Executed by:
  • tst_QPrinter
20
53}-
54-
55bool QPdfPrintEngine::newPage()-
56{-
57 return
never executed: return QPdfEngine::newPage();
QPdfEngine::newPage();
never executed: return QPdfEngine::newPage();
0
58}-
59-
60int QPdfPrintEngine::metric(QPaintDevice::PaintDeviceMetric m) const-
61{-
62 return
executed 193 times by 1 test: return QPdfEngine::metric(m);
Executed by:
  • tst_QPrinter
QPdfEngine::metric(m);
executed 193 times by 1 test: return QPdfEngine::metric(m);
Executed by:
  • tst_QPrinter
193
63}-
64-
65void QPdfPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &value)-
66{-
67 QPdfPrintEnginePrivate * const d = d_func();-
68-
69 switch (int(key)) {-
70-
71-
72 case
never executed: case PPK_PageRect:
PPK_PageRect:
never executed: case PPK_PageRect:
0
73 break;
never executed: break;
0
74 case
never executed: case PPK_PaperRect:
PPK_PaperRect:
never executed: case PPK_PaperRect:
0
75 break;
never executed: break;
0
76 case
never executed: case PPK_PaperSources:
PPK_PaperSources:
never executed: case PPK_PaperSources:
0
77 break;
never executed: break;
0
78 case
never executed: case PPK_SupportsMultipleCopies:
PPK_SupportsMultipleCopies:
never executed: case PPK_SupportsMultipleCopies:
0
79 break;
never executed: break;
0
80 case
never executed: case PPK_SupportedResolutions:
PPK_SupportedResolutions:
never executed: case PPK_SupportedResolutions:
0
81 break;
never executed: break;
0
82-
83-
84 case
never executed: case PPK_CustomBase:
PPK_CustomBase:
never executed: case PPK_CustomBase:
0
85 break;
never executed: break;
0
86-
87-
88 case
executed 1 time by 1 test: case PPK_CollateCopies:
Executed by:
  • tst_QPrinter
PPK_CollateCopies:
executed 1 time by 1 test: case PPK_CollateCopies:
Executed by:
  • tst_QPrinter
1
89 d->collate = value.toBool();-
90 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
91 case
executed 1 time by 1 test: case PPK_ColorMode:
Executed by:
  • tst_QPrinter
PPK_ColorMode:
executed 1 time by 1 test: case PPK_ColorMode:
Executed by:
  • tst_QPrinter
1
92 d->grayscale = (QPrinter::ColorMode(value.toInt()) == QPrinter::GrayScale);-
93 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
94 case
executed 1 time by 1 test: case PPK_Creator:
Executed by:
  • tst_QPrinter
PPK_Creator:
executed 1 time by 1 test: case PPK_Creator:
Executed by:
  • tst_QPrinter
1
95 d->creator = value.toString();-
96 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
97 case
executed 2 times by 1 test: case PPK_DocumentName:
Executed by:
  • tst_QPrinter
PPK_DocumentName:
executed 2 times by 1 test: case PPK_DocumentName:
Executed by:
  • tst_QPrinter
2
98 d->title = value.toString();-
99 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
100 case
executed 19 times by 1 test: case PPK_FullPage:
Executed by:
  • tst_QPrinter
PPK_FullPage:
executed 19 times by 1 test: case PPK_FullPage:
Executed by:
  • tst_QPrinter
19
101 if (value.toBool()
value.toBool()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QPrinter
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QPrinter
)
5-14
102 d->m_pageLayout.setMode(QPageLayout::FullPageMode);
executed 14 times by 1 test: d->m_pageLayout.setMode(QPageLayout::FullPageMode);
Executed by:
  • tst_QPrinter
14
103 else-
104 d->m_pageLayout.setMode(QPageLayout::StandardMode);
executed 5 times by 1 test: d->m_pageLayout.setMode(QPageLayout::StandardMode);
Executed by:
  • tst_QPrinter
5
105 break;
executed 19 times by 1 test: break;
Executed by:
  • tst_QPrinter
19
106 case
executed 1 time by 1 test: case PPK_CopyCount:
Executed by:
  • tst_QPrinter
PPK_CopyCount:
executed 1 time by 1 test: case PPK_CopyCount:
Executed by:
  • tst_QPrinter
1
107 case
executed 1 time by 1 test: case PPK_NumberOfCopies:
Executed by:
  • tst_QPrinter
PPK_NumberOfCopies:
executed 1 time by 1 test: case PPK_NumberOfCopies:
Executed by:
  • tst_QPrinter
1
108 d->copies = value.toInt();-
109 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
110 case
executed 48 times by 1 test: case PPK_Orientation:
Executed by:
  • tst_QPrinter
PPK_Orientation:
executed 48 times by 1 test: case PPK_Orientation:
Executed by:
  • tst_QPrinter
48
111 d->m_pageLayout.setOrientation(QPageLayout::Orientation(value.toInt()));-
112 break;
executed 48 times by 1 test: break;
Executed by:
  • tst_QPrinter
48
113 case
executed 39 times by 1 test: case PPK_OutputFileName:
Executed by:
  • tst_QPrinter
PPK_OutputFileName:
executed 39 times by 1 test: case PPK_OutputFileName:
Executed by:
  • tst_QPrinter
39
114 d->outputFileName = value.toString();-
115 break;
executed 39 times by 1 test: break;
Executed by:
  • tst_QPrinter
39
116 case
executed 1 time by 1 test: case PPK_PageOrder:
Executed by:
  • tst_QPrinter
PPK_PageOrder:
executed 1 time by 1 test: case PPK_PageOrder:
Executed by:
  • tst_QPrinter
1
117 d->pageOrder = QPrinter::PageOrder(value.toInt());-
118 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
119 case
never executed: case PPK_PageSize:
PPK_PageSize:
never executed: case PPK_PageSize:
{
0
120 QPageSize pageSize = QPageSize(QPageSize::PageSizeId(value.toInt()));-
121 if (pageSize.isValid()
pageSize.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
122 d->m_pageLayout.setPageSize(pageSize);
never executed: d->m_pageLayout.setPageSize(pageSize);
0
123 break;
never executed: break;
0
124 }-
125 case
never executed: case PPK_PaperName:
PPK_PaperName:
never executed: case PPK_PaperName:
{
0
126 QString name = value.toString();-
127 for (int i = 0; i <= QPageSize::LastPageSize
i <= QPageSize::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
128 QPageSize pageSize = QPageSize(QPageSize::PageSizeId(i));-
129 if (name == pageSize.name()
name == pageSize.name()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
130 d->m_pageLayout.setPageSize(pageSize);-
131 break;
never executed: break;
0
132 }-
133 }
never executed: end of block
0
134 break;
never executed: break;
0
135 }-
136 case
executed 1 time by 1 test: case PPK_WindowsPageSize:
Executed by:
  • tst_QPrinter
PPK_WindowsPageSize:
executed 1 time by 1 test: case PPK_WindowsPageSize:
Executed by:
  • tst_QPrinter
1
137 d->m_pageLayout.setPageSize(QPageSize(QPageSize::id(value.toInt())));-
138 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
139 case
executed 1 time by 1 test: case PPK_PaperSource:
Executed by:
  • tst_QPrinter
PPK_PaperSource:
executed 1 time by 1 test: case PPK_PaperSource:
Executed by:
  • tst_QPrinter
1
140 d->paperSource = QPrinter::PaperSource(value.toInt());-
141 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
142 case
executed 128 times by 2 tests: case PPK_PrinterName:
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
PPK_PrinterName:
executed 128 times by 2 tests: case PPK_PrinterName:
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
128
143 d->printerName = value.toString();-
144 break;
executed 128 times by 2 tests: break;
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
128
145 case
executed 1 time by 1 test: case PPK_PrinterProgram:
Executed by:
  • tst_QPrinter
PPK_PrinterProgram:
executed 1 time by 1 test: case PPK_PrinterProgram:
Executed by:
  • tst_QPrinter
1
146 d->printProgram = value.toString();-
147 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
148 case
executed 27 times by 1 test: case PPK_Resolution:
Executed by:
  • tst_QPrinter
PPK_Resolution:
executed 27 times by 1 test: case PPK_Resolution:
Executed by:
  • tst_QPrinter
27
149 d->resolution = value.toInt();-
150 break;
executed 27 times by 1 test: break;
Executed by:
  • tst_QPrinter
27
151 case
executed 1 time by 1 test: case PPK_SelectionOption:
Executed by:
  • tst_QPrinter
PPK_SelectionOption:
executed 1 time by 1 test: case PPK_SelectionOption:
Executed by:
  • tst_QPrinter
1
152 d->selectionOption = value.toString();-
153 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
154 case
executed 1 time by 1 test: case PPK_FontEmbedding:
Executed by:
  • tst_QPrinter
PPK_FontEmbedding:
executed 1 time by 1 test: case PPK_FontEmbedding:
Executed by:
  • tst_QPrinter
1
155 d->embedFonts = value.toBool();-
156 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
157 case
executed 2 times by 1 test: case PPK_Duplex:
Executed by:
  • tst_QPrinter
PPK_Duplex:
executed 2 times by 1 test: case PPK_Duplex:
Executed by:
  • tst_QPrinter
2
158 d->duplex = static_cast<QPrint::DuplexMode>(value.toInt());-
159 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
160 case
never executed: case PPK_CustomPaperSize:
PPK_CustomPaperSize:
never executed: case PPK_CustomPaperSize:
0
161 d->m_pageLayout.setPageSize(QPageSize(value.toSizeF(), QPageSize::Point));-
162 break;
never executed: break;
0
163 case
never executed: case PPK_PageMargins:
PPK_PageMargins:
never executed: case PPK_PageMargins:
{
0
164 QList<QVariant> margins(value.toList());-
165 ((!(margins.size() == 4)) ? qt_assert("margins.size() == 4",__FILE__,212) : qt_noop());-
166 d->m_pageLayout.setUnits(QPageLayout::Point);-
167 d->m_pageLayout.setMargins(QMarginsF(margins.at(0).toReal(), margins.at(1).toReal(),-
168 margins.at(2).toReal(), margins.at(3).toReal()));-
169 break;
never executed: break;
0
170 }-
171 case
executed 47 times by 1 test: case PPK_QPageSize:
Executed by:
  • tst_QPrinter
PPK_QPageSize:
executed 47 times by 1 test: case PPK_QPageSize:
Executed by:
  • tst_QPrinter
{
47
172 QPageSize pageSize = value.value<QPageSize>();-
173 if (pageSize.isValid()
pageSize.isValid()Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • tst_QPrinter
FALSEnever evaluated
)
0-47
174 d->m_pageLayout.setPageSize(pageSize);
executed 47 times by 1 test: d->m_pageLayout.setPageSize(pageSize);
Executed by:
  • tst_QPrinter
47
175 break;
executed 47 times by 1 test: break;
Executed by:
  • tst_QPrinter
47
176 }-
177 case
executed 13 times by 1 test: case PPK_QPageMargins:
Executed by:
  • tst_QPrinter
PPK_QPageMargins:
executed 13 times by 1 test: case PPK_QPageMargins:
Executed by:
  • tst_QPrinter
{
13
178 QPair<QMarginsF, QPageLayout::Unit> pair = value.value<QPair<QMarginsF, QPageLayout::Unit> >();-
179 d->m_pageLayout.setUnits(pair.second);-
180 d->m_pageLayout.setMargins(pair.first);-
181 break;
executed 13 times by 1 test: break;
Executed by:
  • tst_QPrinter
13
182 }-
183 case
never executed: case PPK_QPageLayout:
PPK_QPageLayout:
never executed: case PPK_QPageLayout:
{
0
184 QPageLayout pageLayout = value.value<QPageLayout>();-
185 if (pageLayout.isValid()
pageLayout.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
186 d->m_pageLayout = pageLayout;
never executed: d->m_pageLayout = pageLayout;
0
187 break;
never executed: break;
0
188 }-
189-
190 }-
191}
executed 336 times by 2 tests: end of block
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
336
192-
193QVariant QPdfPrintEngine::property(PrintEnginePropertyKey key) const-
194{-
195 const QPdfPrintEnginePrivate * const d = d_func();-
196-
197 QVariant ret;-
198 switch (int(key)) {-
199-
200-
201-
202 case
never executed: case PPK_CustomBase:
PPK_CustomBase:
never executed: case PPK_CustomBase:
0
203-
204 break;
never executed: break;
0
205-
206-
207 case
executed 6 times by 1 test: case PPK_CollateCopies:
Executed by:
  • tst_QPrinter
PPK_CollateCopies:
executed 6 times by 1 test: case PPK_CollateCopies:
Executed by:
  • tst_QPrinter
6
208 ret = d->collate;-
209 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_QPrinter
6
210 case
executed 6 times by 1 test: case PPK_ColorMode:
Executed by:
  • tst_QPrinter
PPK_ColorMode:
executed 6 times by 1 test: case PPK_ColorMode:
Executed by:
  • tst_QPrinter
6
211 ret = d->grayscale
d->grayscaleDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPrinter
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QPrinter
? QPrinter::GrayScale : QPrinter::Color;
1-5
212 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_QPrinter
6
213 case
executed 2 times by 1 test: case PPK_Creator:
Executed by:
  • tst_QPrinter
PPK_Creator:
executed 2 times by 1 test: case PPK_Creator:
Executed by:
  • tst_QPrinter
2
214 ret = d->creator;-
215 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
216 case
executed 6 times by 1 test: case PPK_DocumentName:
Executed by:
  • tst_QPrinter
PPK_DocumentName:
executed 6 times by 1 test: case PPK_DocumentName:
Executed by:
  • tst_QPrinter
6
217 ret = d->title;-
218 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_QPrinter
6
219 case
executed 3 times by 1 test: case PPK_FullPage:
Executed by:
  • tst_QPrinter
PPK_FullPage:
executed 3 times by 1 test: case PPK_FullPage:
Executed by:
  • tst_QPrinter
3
220 ret = d->m_pageLayout.mode() == QPageLayout::FullPageMode;-
221 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_QPrinter
3
222 case
executed 10 times by 1 test: case PPK_CopyCount:
Executed by:
  • tst_QPrinter
PPK_CopyCount:
executed 10 times by 1 test: case PPK_CopyCount:
Executed by:
  • tst_QPrinter
10
223 ret = d->copies;-
224 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_QPrinter
10
225 case
executed 1 time by 1 test: case PPK_SupportsMultipleCopies:
Executed by:
  • tst_QPrinter
PPK_SupportsMultipleCopies:
executed 1 time by 1 test: case PPK_SupportsMultipleCopies:
Executed by:
  • tst_QPrinter
1
226 ret = false;-
227 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
228 case
executed 3 times by 1 test: case PPK_NumberOfCopies:
Executed by:
  • tst_QPrinter
PPK_NumberOfCopies:
executed 3 times by 1 test: case PPK_NumberOfCopies:
Executed by:
  • tst_QPrinter
3
229 ret = d->copies;-
230 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_QPrinter
3
231 case
never executed: case PPK_Orientation:
PPK_Orientation:
never executed: case PPK_Orientation:
0
232 ret = d->m_pageLayout.orientation();-
233 break;
never executed: break;
0
234 case
executed 5 times by 1 test: case PPK_OutputFileName:
Executed by:
  • tst_QPrinter
PPK_OutputFileName:
executed 5 times by 1 test: case PPK_OutputFileName:
Executed by:
  • tst_QPrinter
5
235 ret = d->outputFileName;-
236 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_QPrinter
5
237 case
executed 6 times by 1 test: case PPK_PageOrder:
Executed by:
  • tst_QPrinter
PPK_PageOrder:
executed 6 times by 1 test: case PPK_PageOrder:
Executed by:
  • tst_QPrinter
6
238 ret = d->pageOrder;-
239 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_QPrinter
6
240 case
never executed: case PPK_PageSize:
PPK_PageSize:
never executed: case PPK_PageSize:
0
241 ret = d->m_pageLayout.pageSize().id();-
242 break;
never executed: break;
0
243 case
never executed: case PPK_PaperName:
PPK_PaperName:
never executed: case PPK_PaperName:
0
244 ret = d->m_pageLayout.pageSize().name();-
245 break;
never executed: break;
0
246 case
executed 2 times by 1 test: case PPK_WindowsPageSize:
Executed by:
  • tst_QPrinter
PPK_WindowsPageSize:
executed 2 times by 1 test: case PPK_WindowsPageSize:
Executed by:
  • tst_QPrinter
2
247 ret = d->m_pageLayout.pageSize().windowsId();-
248 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
249 case
executed 2 times by 1 test: case PPK_PaperSource:
Executed by:
  • tst_QPrinter
PPK_PaperSource:
executed 2 times by 1 test: case PPK_PaperSource:
Executed by:
  • tst_QPrinter
2
250 ret = d->paperSource;-
251 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
252 case
executed 15 times by 1 test: case PPK_PrinterName:
Executed by:
  • tst_QPrinter
PPK_PrinterName:
executed 15 times by 1 test: case PPK_PrinterName:
Executed by:
  • tst_QPrinter
15
253 ret = d->printerName;-
254 break;
executed 15 times by 1 test: break;
Executed by:
  • tst_QPrinter
15
255 case
executed 2 times by 1 test: case PPK_PrinterProgram:
Executed by:
  • tst_QPrinter
PPK_PrinterProgram:
executed 2 times by 1 test: case PPK_PrinterProgram:
Executed by:
  • tst_QPrinter
2
256 ret = d->printProgram;-
257 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
258 case
executed 110 times by 1 test: case PPK_Resolution:
Executed by:
  • tst_QPrinter
PPK_Resolution:
executed 110 times by 1 test: case PPK_Resolution:
Executed by:
  • tst_QPrinter
110
259 ret = d->resolution;-
260 break;
executed 110 times by 1 test: break;
Executed by:
  • tst_QPrinter
110
261 case
executed 1 time by 1 test: case PPK_SupportedResolutions:
Executed by:
  • tst_QPrinter
PPK_SupportedResolutions:
executed 1 time by 1 test: case PPK_SupportedResolutions:
Executed by:
  • tst_QPrinter
1
262 ret = QList<QVariant>() << 72;-
263 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QPrinter
1
264 case
executed 78 times by 1 test: case PPK_PaperRect:
Executed by:
  • tst_QPrinter
PPK_PaperRect:
executed 78 times by 1 test: case PPK_PaperRect:
Executed by:
  • tst_QPrinter
78
265 ret = d->m_pageLayout.fullRectPixels(d->resolution);-
266 break;
executed 78 times by 1 test: break;
Executed by:
  • tst_QPrinter
78
267 case
executed 24 times by 1 test: case PPK_PageRect:
Executed by:
  • tst_QPrinter
PPK_PageRect:
executed 24 times by 1 test: case PPK_PageRect:
Executed by:
  • tst_QPrinter
24
268 ret = d->m_pageLayout.paintRectPixels(d->resolution);-
269 break;
executed 24 times by 1 test: break;
Executed by:
  • tst_QPrinter
24
270 case
executed 2 times by 1 test: case PPK_SelectionOption:
Executed by:
  • tst_QPrinter
PPK_SelectionOption:
executed 2 times by 1 test: case PPK_SelectionOption:
Executed by:
  • tst_QPrinter
2
271 ret = d->selectionOption;-
272 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
273 case
executed 2 times by 1 test: case PPK_FontEmbedding:
Executed by:
  • tst_QPrinter
PPK_FontEmbedding:
executed 2 times by 1 test: case PPK_FontEmbedding:
Executed by:
  • tst_QPrinter
2
274 ret = d->embedFonts;-
275 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QPrinter
2
276 case
executed 8 times by 1 test: case PPK_Duplex:
Executed by:
  • tst_QPrinter
PPK_Duplex:
executed 8 times by 1 test: case PPK_Duplex:
Executed by:
  • tst_QPrinter
8
277 ret = d->duplex;-
278 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_QPrinter
8
279 case
never executed: case PPK_CustomPaperSize:
PPK_CustomPaperSize:
never executed: case PPK_CustomPaperSize:
0
280 ret = d->m_pageLayout.fullRectPoints().size();-
281 break;
never executed: break;
0
282 case
never executed: case PPK_PageMargins:
PPK_PageMargins:
never executed: case PPK_PageMargins:
{
0
283 QList<QVariant> list;-
284 QMarginsF margins = d->m_pageLayout.margins(QPageLayout::Point);-
285 list << margins.left() << margins.top() << margins.right() << margins.bottom();-
286 ret = list;-
287 break;
never executed: break;
0
288 }-
289 case
never executed: case PPK_QPageSize:
PPK_QPageSize:
never executed: case PPK_QPageSize:
0
290 ret.setValue(d->m_pageLayout.pageSize());-
291 break;
never executed: break;
0
292 case
never executed: case PPK_QPageMargins:
PPK_QPageMargins:
never executed: case PPK_QPageMargins:
{
0
293 QPair<QMarginsF, QPageLayout::Unit> pair = qMakePair(d->m_pageLayout.margins(), d->m_pageLayout.units());-
294 ret.setValue(pair);-
295 break;
never executed: break;
0
296 }-
297 case
executed 462 times by 1 test: case PPK_QPageLayout:
Executed by:
  • tst_QPrinter
PPK_QPageLayout:
executed 462 times by 1 test: case PPK_QPageLayout:
Executed by:
  • tst_QPrinter
462
298 ret.setValue(d->m_pageLayout);-
299 break;
executed 462 times by 1 test: break;
Executed by:
  • tst_QPrinter
462
300-
301 }-
302 return
executed 756 times by 1 test: return ret;
Executed by:
  • tst_QPrinter
ret;
executed 756 times by 1 test: return ret;
Executed by:
  • tst_QPrinter
756
303}-
304-
305-
306bool QPdfPrintEnginePrivate::openPrintDevice()-
307{-
308 if (outDevice
outDeviceDescription
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_QPrinter
)
0-21
309 return
never executed: return false;
false;
never executed: return false;
0
310-
311 if (!outputFileName.isEmpty()
!outputFileName.isEmpty()Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QPrinter
FALSEnever evaluated
) {
0-21
312 QFile *file = new QFile(outputFileName);-
313 if (! file->open(QFile::WriteOnly|QFile::Truncate)
! file->open(Q...ile::Truncate)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPrinter
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QPrinter
) {
1-20
314 delete file;-
315 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QPrinter
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QPrinter
1
316 }-
317 outDevice = file;-
318 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_QPrinter
20
319-
320 return
executed 20 times by 1 test: return true;
Executed by:
  • tst_QPrinter
true;
executed 20 times by 1 test: return true;
Executed by:
  • tst_QPrinter
20
321}-
322-
323void QPdfPrintEnginePrivate::closePrintDevice()-
324{-
325 if (outDevice
outDeviceDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_QPrinter
FALSEnever evaluated
) {
0-20
326 outDevice->close();-
327 if (fd >= 0
fd >= 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QPrinter
)
0-20
328-
329-
330-
331 ::
never executed: ::close(fd);
close(fd);
never executed: ::close(fd);
0
332-
333 fd = -1;-
334 delete outDevice;-
335 outDevice = 0;-
336 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_QPrinter
20
337}
executed 20 times by 1 test: end of block
Executed by:
  • tst_QPrinter
20
338-
339-
340-
341QPdfPrintEnginePrivate::QPdfPrintEnginePrivate(QPrinter::PrinterMode m)-
342 : QPdfEnginePrivate(),-
343 duplex(QPrint::DuplexNone),-
344 collate(true),-
345 copies(1),-
346 pageOrder(QPrinter::FirstPageFirst),-
347 paperSource(QPrinter::Auto),-
348 fd(-1)-
349{-
350 resolution = 72;-
351 if (m == QPrinter::HighResolution
m == QPrinter::HighResolutionDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_QPrinter
FALSEevaluated 96 times by 2 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
)
32-96
352 resolution = 1200;
executed 32 times by 1 test: resolution = 1200;
Executed by:
  • tst_QPrinter
32
353 else if (m == QPrinter::ScreenResolution
m == QPrinter:...reenResolutionDescription
TRUEevaluated 92 times by 2 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QPrinter
)
4-92
354 resolution = qt_defaultDpi();
executed 92 times by 2 tests: resolution = qt_defaultDpi();
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
92
355}
executed 128 times by 2 tests: end of block
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
128
356-
357QPdfPrintEnginePrivate::~QPdfPrintEnginePrivate()-
358{-
359}-
360-
361-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9