OpenCoverage

qtextdocumentlayout.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/text/qtextdocumentlayout.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7struct QTextLayoutStruct;-
8-
9class QTextFrameData : public QTextFrameLayoutData-
10{-
11public:-
12 QTextFrameData();-
13-
14-
15 QFixedPoint position;-
16 QFixedSize size;-
17-
18-
19 QFixed topMargin;-
20 QFixed bottomMargin;-
21 QFixed leftMargin;-
22 QFixed rightMargin;-
23 QFixed border;-
24 QFixed padding;-
25-
26 QFixed contentsWidth;-
27 QFixed contentsHeight;-
28 QFixed oldContentsWidth;-
29-
30-
31 QFixed effectiveTopMargin;-
32 QFixed effectiveBottomMargin;-
33-
34 QFixed minimumWidth;-
35 QFixed maximumWidth;-
36-
37 QTextLayoutStruct *currentLayoutStruct;-
38-
39 bool sizeDirty;-
40 bool layoutDirty;-
41-
42 QVector<QPointer<QTextFrame> > floats;-
43};-
44-
45QTextFrameData::QTextFrameData()-
46 : maximumWidth((2147483647/256)),-
47 currentLayoutStruct(0), sizeDirty(true), layoutDirty(true)-
48{-
49}
never executed: end of block
0
50-
51struct QTextLayoutStruct {-
52 QTextLayoutStruct() : maximumWidth((2147483647/256)), fullLayout(false)-
53 {}
never executed: end of block
0
54 QTextFrame *frame;-
55 QFixed x_left;-
56 QFixed x_right;-
57 QFixed frameY;-
58 QFixed y;-
59 QFixed contentsWidth;-
60 QFixed minimumWidth;-
61 QFixed maximumWidth;-
62 bool fullLayout;-
63 QList<QTextFrame *> pendingFloats;-
64 QFixed pageHeight;-
65 QFixed pageBottom;-
66 QFixed pageTopMargin;-
67 QFixed pageBottomMargin;-
68 QRectF updateRect;-
69 QRectF updateRectForFloats;-
70-
71 inline void addUpdateRectForFloat(const QRectF &rect) {-
72 if (updateRectForFloats.isValid()
updateRectForFloats.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
73 updateRectForFloats |= rect;
never executed: updateRectForFloats |= rect;
0
74 else-
75 updateRectForFloats = rect;
never executed: updateRectForFloats = rect;
0
76 }-
77-
78 inline QFixed absoluteY() const-
79 { return
never executed: return frameY + y;
frameY + y;
never executed: return frameY + y;
}
0
80-
81 inline int currentPage() const-
82 { return
never executed: return pageHeight == 0 ? 0 : (absoluteY() / pageHeight).truncate();
pageHeight == 0 ? 0 : (absoluteY() / pageHeight).truncate();
never executed: return pageHeight == 0 ? 0 : (absoluteY() / pageHeight).truncate();
}
0
83-
84 inline void newPage()-
85 { if (pageHeight == (2147483647/256)
pageHeight == (2147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
pageBottom += pageHeight; y = pageBottom - pageHeight + pageBottomMargin + pageTopMargin - frameY; }
never executed: end of block
0
86};-
87-
88class QTextTableData : public QTextFrameData-
89{-
90public:-
91 QFixed cellSpacing, cellPadding;-
92 qreal deviceScale;-
93 QVector<QFixed> minWidths;-
94 QVector<QFixed> maxWidths;-
95 QVector<QFixed> widths;-
96 QVector<QFixed> heights;-
97 QVector<QFixed> columnPositions;-
98 QVector<QFixed> rowPositions;-
99-
100 QVector<QFixed> cellVerticalOffsets;-
101-
102 QFixed headerHeight;-
103-
104-
105-
106 QMultiHash<int, QTextFrame *> childFrameMap;-
107-
108 inline QFixed cellWidth(int column, int colspan) const-
109 { return
never executed: return columnPositions.at(column + colspan - 1) + widths.at(column + colspan - 1) - columnPositions.at(column);
columnPositions.at(column + colspan - 1) + widths.at(column + colspan - 1)
never executed: return columnPositions.at(column + colspan - 1) + widths.at(column + colspan - 1) - columnPositions.at(column);
0
110 - columnPositions.at(column);
never executed: return columnPositions.at(column + colspan - 1) + widths.at(column + colspan - 1) - columnPositions.at(column);
}
0
111-
112 inline void calcRowPosition(int row)-
113 {-
114 if (row > 0
row > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
115 rowPositions[row] = rowPositions.at(row - 1) + heights.at(row - 1) + border + cellSpacing + border;
never executed: rowPositions[row] = rowPositions.at(row - 1) + heights.at(row - 1) + border + cellSpacing + border;
0
116 }
never executed: end of block
0
117-
118 QRectF cellRect(const QTextTableCell &cell) const;-
119-
120 inline QFixed paddingProperty(const QTextFormat &format, QTextFormat::Property property) const-
121 {-
122 QVariant v = format.property(property);-
123 if (v.isNull()
v.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
124 return
never executed: return cellPadding;
cellPadding;
never executed: return cellPadding;
0
125 } else {-
126 ((!(v.userType() == QVariant::Double || v.userType() == QMetaType::Float)) ? qt_assert("v.userType() == QVariant::Double || v.userType() == QMetaType::Float",__FILE__,199) : qt_noop());-
127 return
never executed: return QFixed::fromReal(v.toReal() * deviceScale);
QFixed::fromReal(v.toReal() * deviceScale);
never executed: return QFixed::fromReal(v.toReal() * deviceScale);
0
128 }-
129 }-
130-
131 inline QFixed topPadding(const QTextFormat &format) const-
132 {-
133 return
never executed: return paddingProperty(format, QTextFormat::TableCellTopPadding);
paddingProperty(format, QTextFormat::TableCellTopPadding);
never executed: return paddingProperty(format, QTextFormat::TableCellTopPadding);
0
134 }-
135-
136 inline QFixed bottomPadding(const QTextFormat &format) const-
137 {-
138 return
never executed: return paddingProperty(format, QTextFormat::TableCellBottomPadding);
paddingProperty(format, QTextFormat::TableCellBottomPadding);
never executed: return paddingProperty(format, QTextFormat::TableCellBottomPadding);
0
139 }-
140-
141 inline QFixed leftPadding(const QTextFormat &format) const-
142 {-
143 return
never executed: return paddingProperty(format, QTextFormat::TableCellLeftPadding);
paddingProperty(format, QTextFormat::TableCellLeftPadding);
never executed: return paddingProperty(format, QTextFormat::TableCellLeftPadding);
0
144 }-
145-
146 inline QFixed rightPadding(const QTextFormat &format) const-
147 {-
148 return
never executed: return paddingProperty(format, QTextFormat::TableCellRightPadding);
paddingProperty(format, QTextFormat::TableCellRightPadding);
never executed: return paddingProperty(format, QTextFormat::TableCellRightPadding);
0
149 }-
150-
151 inline QFixedPoint cellPosition(const QTextTableCell &cell) const-
152 {-
153 const QTextFormat fmt = cell.format();-
154 return
never executed: return cellPosition(cell.row(), cell.column()) + QFixedPoint(leftPadding(fmt), topPadding(fmt));
cellPosition(cell.row(), cell.column()) + QFixedPoint(leftPadding(fmt), topPadding(fmt));
never executed: return cellPosition(cell.row(), cell.column()) + QFixedPoint(leftPadding(fmt), topPadding(fmt));
0
155 }-
156-
157 void updateTableSize();-
158-
159private:-
160 inline QFixedPoint cellPosition(int row, int col) const-
161 { return
never executed: return QFixedPoint(columnPositions.at(col), rowPositions.at(row) + cellVerticalOffsets.at(col + row * widths.size()));
QFixedPoint(columnPositions.at(col), rowPositions.at(row) + cellVerticalOffsets.at(col + row * widths.size()));
never executed: return QFixedPoint(columnPositions.at(col), rowPositions.at(row) + cellVerticalOffsets.at(col + row * widths.size()));
}
0
162};-
163-
164static QTextFrameData *createData(QTextFrame *f)-
165{-
166 QTextFrameData *data;-
167 if (qobject_cast<QTextTable *>(f)
qobject_cast<QTextTable *>(f)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
168 data = new QTextTableData;
never executed: data = new QTextTableData;
0
169 else-
170 data = new QTextFrameData;
never executed: data = new QTextFrameData;
0
171 f->setLayoutData(data);-
172 return
never executed: return data;
data;
never executed: return data;
0
173}-
174-
175static inline QTextFrameData *data(QTextFrame *f)-
176{-
177 QTextFrameData *data = static_cast<QTextFrameData *>(f->layoutData());-
178 if (!data
!dataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
179 data = createData(f);
never executed: data = createData(f);
0
180 return
never executed: return data;
data;
never executed: return data;
0
181}-
182-
183static bool isFrameFromInlineObject(QTextFrame *f)-
184{-
185 return
never executed: return f->firstPosition() > f->lastPosition();
f->firstPosition() > f->lastPosition();
never executed: return f->firstPosition() > f->lastPosition();
0
186}-
187-
188void QTextTableData::updateTableSize()-
189{-
190 const QFixed effectiveTopMargin = this->topMargin + border + padding;-
191 const QFixed effectiveBottomMargin = this->bottomMargin + border + padding;-
192 const QFixed effectiveLeftMargin = this->leftMargin + border + padding;-
193 const QFixed effectiveRightMargin = this->rightMargin + border + padding;-
194 size.height = contentsHeight == -1
contentsHeight == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
195 ? rowPositions.constLast() + heights.constLast() + padding + border + cellSpacing + effectiveBottomMargin-
196 : effectiveTopMargin + contentsHeight + effectiveBottomMargin;-
197 size.width = effectiveLeftMargin + contentsWidth + effectiveRightMargin;-
198}
never executed: end of block
0
199-
200QRectF QTextTableData::cellRect(const QTextTableCell &cell) const-
201{-
202 const int row = cell.row();-
203 const int rowSpan = cell.rowSpan();-
204 const int column = cell.column();-
205 const int colSpan = cell.columnSpan();-
206-
207 return
never executed: return QRectF(columnPositions.at(column).toReal(), rowPositions.at(row).toReal(), (columnPositions.at(column + colSpan - 1) + widths.at(column + colSpan - 1) - columnPositions.at(column)).toReal(), (rowPositions.at(row + rowSpan - 1) + heights.at(row + rowSpan - 1) - rowPositions.at(row)).toReal());
QRectF(columnPositions.at(column).toReal(),
never executed: return QRectF(columnPositions.at(column).toReal(), rowPositions.at(row).toReal(), (columnPositions.at(column + colSpan - 1) + widths.at(column + colSpan - 1) - columnPositions.at(column)).toReal(), (rowPositions.at(row + rowSpan - 1) + heights.at(row + rowSpan - 1) - rowPositions.at(row)).toReal());
0
208 rowPositions.at(row).toReal(),
never executed: return QRectF(columnPositions.at(column).toReal(), rowPositions.at(row).toReal(), (columnPositions.at(column + colSpan - 1) + widths.at(column + colSpan - 1) - columnPositions.at(column)).toReal(), (rowPositions.at(row + rowSpan - 1) + heights.at(row + rowSpan - 1) - rowPositions.at(row)).toReal());
0
209 (columnPositions.at(column + colSpan - 1) + widths.at(column + colSpan - 1) - columnPositions.at(column)).toReal(),
never executed: return QRectF(columnPositions.at(column).toReal(), rowPositions.at(row).toReal(), (columnPositions.at(column + colSpan - 1) + widths.at(column + colSpan - 1) - columnPositions.at(column)).toReal(), (rowPositions.at(row + rowSpan - 1) + heights.at(row + rowSpan - 1) - rowPositions.at(row)).toReal());
0
210 (rowPositions.at(row + rowSpan - 1) + heights.at(row + rowSpan - 1) - rowPositions.at(row)).toReal());
never executed: return QRectF(columnPositions.at(column).toReal(), rowPositions.at(row).toReal(), (columnPositions.at(column + colSpan - 1) + widths.at(column + colSpan - 1) - columnPositions.at(column)).toReal(), (rowPositions.at(row + rowSpan - 1) + heights.at(row + rowSpan - 1) - rowPositions.at(row)).toReal());
0
211}-
212-
213static inline bool isEmptyBlockBeforeTable(const QTextBlock &block, const QTextBlockFormat &format, const QTextFrame::Iterator &nextIt)-
214{-
215 return
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
!nextIt.atEnd()
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
216 && qobject_cast<QTextTable *>(nextIt.currentFrame())
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
217 && block.isValid()
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
218 && block.length() == 1
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
219 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth)
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
220 && !format.hasProperty(QTextFormat::BackgroundBrush)
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
221 && nextIt.currentFrame()->firstPosition() == block.position() + 1
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
222 ;
never executed: return !nextIt.atEnd() && qobject_cast<QTextTable *>(nextIt.currentFrame()) && block.isValid() && block.length() == 1 && !format.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) && !format.hasProperty(QTextFormat::BackgroundBrush) && nextIt.currentFrame()->firstPosition() == block.position() + 1 ;
0
223}-
224-
225static inline bool isEmptyBlockBeforeTable(QTextFrame::Iterator it)-
226{-
227 QTextFrame::Iterator next = it; ++next;-
228 if (it.currentFrame()
it.currentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
229 return
never executed: return false;
false;
never executed: return false;
0
230 QTextBlock block = it.currentBlock();-
231 return
never executed: return isEmptyBlockBeforeTable(block, block.blockFormat(), next);
isEmptyBlockBeforeTable(block, block.blockFormat(), next);
never executed: return isEmptyBlockBeforeTable(block, block.blockFormat(), next);
0
232}-
233-
234static inline bool isEmptyBlockAfterTable(const QTextBlock &block, const QTextFrame *previousFrame)-
235{-
236 return
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() == 1 && previousFrame->lastPosition() == block.position() - 1 ;
qobject_cast<const QTextTable *>(previousFrame)
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() == 1 && previousFrame->lastPosition() == block.position() - 1 ;
0
237 && block.isValid()
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() == 1 && previousFrame->lastPosition() == block.position() - 1 ;
0
238 && block.length() == 1
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() == 1 && previousFrame->lastPosition() == block.position() - 1 ;
0
239 && previousFrame->lastPosition() == block.position() - 1
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() == 1 && previousFrame->lastPosition() == block.position() - 1 ;
0
240 ;
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() == 1 && previousFrame->lastPosition() == block.position() - 1 ;
0
241}-
242-
243static inline bool isLineSeparatorBlockAfterTable(const QTextBlock &block, const QTextFrame *previousFrame)-
244{-
245 return
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() > 1 && block.text().at(0) == QChar::LineSeparator && previousFrame->lastPosition() == block.position() - 1 ;
qobject_cast<const QTextTable *>(previousFrame)
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() > 1 && block.text().at(0) == QChar::LineSeparator && previousFrame->lastPosition() == block.position() - 1 ;
0
246 && block.isValid()
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() > 1 && block.text().at(0) == QChar::LineSeparator && previousFrame->lastPosition() == block.position() - 1 ;
0
247 && block.length() > 1
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() > 1 && block.text().at(0) == QChar::LineSeparator && previousFrame->lastPosition() == block.position() - 1 ;
0
248 && block.text().at(0) == QChar::LineSeparator
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() > 1 && block.text().at(0) == QChar::LineSeparator && previousFrame->lastPosition() == block.position() - 1 ;
0
249 && previousFrame->lastPosition() == block.position() - 1
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() > 1 && block.text().at(0) == QChar::LineSeparator && previousFrame->lastPosition() == block.position() - 1 ;
0
250 ;
never executed: return qobject_cast<const QTextTable *>(previousFrame) && block.isValid() && block.length() > 1 && block.text().at(0) == QChar::LineSeparator && previousFrame->lastPosition() == block.position() - 1 ;
0
251}-
252struct QCheckPoint-
253{-
254 QFixed y;-
255 QFixed frameY;-
256 int positionInFrame;-
257 QFixed minimumWidth;-
258 QFixed maximumWidth;-
259 QFixed contentsWidth;-
260};-
261template<> class QTypeInfo<QCheckPoint > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isRelocatable = !isStatic || ((Q_PRIMITIVE_TYPE) & Q_RELOCATABLE_TYPE), isLarge = (sizeof(QCheckPoint)>sizeof(void*)), isPointer = false, isIntegral = QtPrivate::is_integral< QCheckPoint >::value, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QCheckPoint) }; static inline const char *name() { return "QCheckPoint"; } };-
262-
263static bool operator<(const QCheckPoint &checkPoint, QFixed y)-
264{-
265 return
never executed: return checkPoint.y < y;
checkPoint.y < y;
never executed: return checkPoint.y < y;
0
266}-
267-
268static bool operator<(const QCheckPoint &checkPoint, int pos)-
269{-
270 return
never executed: return checkPoint.positionInFrame < pos;
checkPoint.positionInFrame < pos;
never executed: return checkPoint.positionInFrame < pos;
0
271}-
272static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, const QPointF &origin, QRectF gradientRect = QRectF())-
273{-
274 p->save();-
275 if (brush.style() >= Qt::LinearGradientPattern
brush.style() ...radientPatternDescription
TRUEnever evaluated
FALSEnever evaluated
&& brush.style() <= Qt::ConicalGradientPattern
brush.style() ...radientPatternDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
276 if (!gradientRect.isNull()
!gradientRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
277 QTransform m;-
278 m.translate(gradientRect.left(), gradientRect.top());-
279 m.scale(gradientRect.width(), gradientRect.height());-
280 brush.setTransform(m);-
281 const_cast<QGradient *>(brush.gradient())->setCoordinateMode(QGradient::LogicalMode);-
282 }
never executed: end of block
0
283 }
never executed: end of block
else {
0
284 p->setBrushOrigin(origin);-
285 }
never executed: end of block
0
286 p->fillRect(rect, brush);-
287 p->restore();-
288}
never executed: end of block
0
289-
290class QTextDocumentLayoutPrivate : public QAbstractTextDocumentLayoutPrivate-
291{-
292 inline QTextDocumentLayout* q_func() { return static_cast<QTextDocumentLayout *>(q_ptr); } inline const QTextDocumentLayout* q_func() const { return static_cast<const QTextDocumentLayout *>(q_ptr); } friend class QTextDocumentLayout;-
293public:-
294 QTextDocumentLayoutPrivate();-
295-
296 QTextOption::WrapMode wordWrapMode;-
297-
298-
299-
300-
301 int fixedColumnWidth;-
302 int cursorWidth;-
303-
304 QSizeF lastReportedSize;-
305 QRectF viewportRect;-
306 QRectF clipRect;-
307-
308 mutable int currentLazyLayoutPosition;-
309 mutable int lazyLayoutStepSize;-
310 QBasicTimer layoutTimer;-
311 mutable QBasicTimer sizeChangedTimer;-
312 uint showLayoutProgress : 1;-
313 uint insideDocumentChange : 1;-
314-
315 int lastPageCount;-
316 qreal idealWidth;-
317 bool contentHasAlignment;-
318-
319 QFixed blockIndent(const QTextBlockFormat &blockFormat) const;-
320-
321 void drawFrame(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,-
322 QTextFrame *f) const;-
323 void drawFlow(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,-
324 QTextFrame::Iterator it, const QList<QTextFrame *> &floats, QTextBlock *cursorBlockNeedingRepaint) const;-
325 void drawBlock(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,-
326 const QTextBlock &bl, bool inRootFrame) const;-
327 void drawListItem(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,-
328 const QTextBlock &bl, const QTextCharFormat *selectionFormat) const;-
329 void drawTableCell(const QRectF &cellRect, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &cell_context,-
330 QTextTable *table, QTextTableData *td, int r, int c,-
331 QTextBlock *cursorBlockNeedingRepaint, QPointF *cursorBlockOffset) const;-
332 void drawBorder(QPainter *painter, const QRectF &rect, qreal topMargin, qreal bottomMargin, qreal border,-
333 const QBrush &brush, QTextFrameFormat::BorderStyle style) const;-
334 void drawFrameDecoration(QPainter *painter, QTextFrame *frame, QTextFrameData *fd, const QRectF &clip, const QRectF &rect) const;-
335-
336 enum HitPoint {-
337 PointBefore,-
338 PointAfter,-
339 PointInside,-
340 PointExact-
341 };-
342 HitPoint hitTest(QTextFrame *frame, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;-
343 HitPoint hitTest(QTextFrame::Iterator it, HitPoint hit, const QFixedPoint &p,-
344 int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;-
345 HitPoint hitTest(QTextTable *table, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;-
346 HitPoint hitTest(const QTextBlock &bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;-
347-
348 QTextLayoutStruct layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,-
349 int layoutFrom, int layoutTo, QTextTableData *tableData, QFixed absoluteTableY,-
350 bool withPageBreaks);-
351 void setCellPosition(QTextTable *t, const QTextTableCell &cell, const QPointF &pos);-
352 QRectF layoutTable(QTextTable *t, int layoutFrom, int layoutTo, QFixed parentY);-
353-
354 void positionFloat(QTextFrame *frame, QTextLine *currentLine = 0);-
355-
356-
357 QRectF layoutFrame(QTextFrame *f, int layoutFrom, int layoutTo, QFixed parentY = 0);-
358 QRectF layoutFrame(QTextFrame *f, int layoutFrom, int layoutTo, QFixed frameWidth, QFixed frameHeight, QFixed parentY = 0);-
359-
360 void layoutBlock(const QTextBlock &bl, int blockPosition, const QTextBlockFormat &blockFormat,-
361 QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat);-
362 void layoutFlow(QTextFrame::Iterator it, QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, QFixed width = 0);-
363-
364 void floatMargins(const QFixed &y, const QTextLayoutStruct *layoutStruct, QFixed *left, QFixed *right) const;-
365 QFixed findY(QFixed yFrom, const QTextLayoutStruct *layoutStruct, QFixed requiredWidth) const;-
366-
367 QVector<QCheckPoint> checkPoints;-
368-
369 QTextFrame::Iterator frameIteratorForYPosition(QFixed y) const;-
370 QTextFrame::Iterator frameIteratorForTextPosition(int position) const;-
371-
372 void ensureLayouted(QFixed y) const;-
373 void ensureLayoutedByPosition(int position) const;-
374 inline void ensureLayoutFinished() const-
375 { ensureLayoutedByPosition(2147483647); }
never executed: end of block
0
376 void layoutStep() const;-
377-
378 QRectF frameBoundingRectInternal(QTextFrame *frame) const;-
379-
380 qreal scaleToDevice(qreal value) const;-
381 QFixed scaleToDevice(QFixed value) const;-
382};-
383-
384QTextDocumentLayoutPrivate::QTextDocumentLayoutPrivate()-
385 : fixedColumnWidth(-1),-
386 cursorWidth(1),-
387 currentLazyLayoutPosition(-1),-
388 lazyLayoutStepSize(1000),-
389 lastPageCount(-1)-
390{-
391 showLayoutProgress = true;-
392 insideDocumentChange = false;-
393 idealWidth = 0;-
394 contentHasAlignment = false;-
395}
never executed: end of block
0
396-
397QTextFrame::Iterator QTextDocumentLayoutPrivate::frameIteratorForYPosition(QFixed y) const-
398{-
399 QTextFrame *rootFrame = document->rootFrame();-
400-
401 if (checkPoints.isEmpty()
checkPoints.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
402 || y < 0
y < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| y > data(rootFrame)->size.height
y > data(rootF...)->size.heightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
403 return
never executed: return rootFrame->begin();
rootFrame->begin();
never executed: return rootFrame->begin();
0
404-
405 QVector<QCheckPoint>::ConstIterator checkPoint = std::lower_bound(checkPoints.begin(), checkPoints.end(), y);-
406 if (checkPoint == checkPoints.end()
checkPoint == ...ckPoints.end()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
407 return
never executed: return rootFrame->begin();
rootFrame->begin();
never executed: return rootFrame->begin();
0
408-
409 if (checkPoint != checkPoints.begin()
checkPoint != ...Points.begin()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
410 --
never executed: --checkPoint;
checkPoint;
never executed: --checkPoint;
0
411-
412 const int position = rootFrame->firstPosition() + checkPoint->positionInFrame;-
413 return
never executed: return frameIteratorForTextPosition(position);
frameIteratorForTextPosition(position);
never executed: return frameIteratorForTextPosition(position);
0
414}-
415-
416QTextFrame::Iterator QTextDocumentLayoutPrivate::frameIteratorForTextPosition(int position) const-
417{-
418 QTextFrame *rootFrame = docPrivate->rootFrame();-
419-
420 const QTextDocumentPrivate::BlockMap &map = docPrivate->blockMap();-
421 const int begin = map.findNode(rootFrame->firstPosition());-
422 const int end = map.findNode(rootFrame->lastPosition()+1);-
423-
424 const int block = map.findNode(position);-
425 const int blockPos = map.position(block);-
426-
427 QTextFrame::iterator it(rootFrame, block, begin, end);-
428-
429 QTextFrame *containingFrame = docPrivate->frameAt(blockPos);-
430 if (containingFrame != rootFrame
containingFrame != rootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
431 while (containingFrame->parentFrame() != rootFrame
containingFram...) != rootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
432 containingFrame = containingFrame->parentFrame();-
433 ((!(containingFrame)) ? qt_assert("containingFrame",__FILE__,583) : qt_noop());-
434 }
never executed: end of block
0
435-
436 it.cf = containingFrame;-
437 it.cb = 0;-
438 }
never executed: end of block
0
439-
440 return
never executed: return it;
it;
never executed: return it;
0
441}-
442-
443QTextDocumentLayoutPrivate::HitPoint-
444QTextDocumentLayoutPrivate::hitTest(QTextFrame *frame, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const-
445{-
446 QTextFrameData *fd = data(frame);-
447-
448 if (fd->layoutDirty
fd->layoutDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
449 return
never executed: return PointAfter;
PointAfter;
never executed: return PointAfter;
0
450 ((!(!fd->layoutDirty)) ? qt_assert("!fd->layoutDirty",__FILE__,600) : qt_noop());-
451 ((!(!fd->sizeDirty)) ? qt_assert("!fd->sizeDirty",__FILE__,601) : qt_noop());-
452 const QFixedPoint relativePoint(point.x - fd->position.x, point.y - fd->position.y);-
453-
454 QTextFrame *rootFrame = docPrivate->rootFrame();-
455-
456-
457-
458 if (frame != rootFrame
frame != rootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
459 if (relativePoint.y < 0
relativePoint.y < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| relativePoint.x < 0
relativePoint.x < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
460 *position = frame->firstPosition() - 1;-
461-
462 return
never executed: return PointBefore;
PointBefore;
never executed: return PointBefore;
0
463 } else if (relativePoint.y > fd->size.height
relativePoint....d->size.heightDescription
TRUEnever evaluated
FALSEnever evaluated
|| relativePoint.x > fd->size.width
relativePoint....fd->size.widthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
464 *position = frame->lastPosition() + 1;-
465-
466 return
never executed: return PointAfter;
PointAfter;
never executed: return PointAfter;
0
467 }-
468 }
never executed: end of block
0
469-
470 if (isFrameFromInlineObject(frame)
isFrameFromInlineObject(frame)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
471 *position = frame->firstPosition() - 1;-
472 return
never executed: return PointExact;
PointExact;
never executed: return PointExact;
0
473 }-
474-
475 if (QTextTable *table = qobject_cast<QTextTable *>(frame)
QTextTable *ta...able *>(frame)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
476 const int rows = table->rows();-
477 const int columns = table->columns();-
478 QTextTableData *td = static_cast<QTextTableData *>(data(table));-
479-
480 if (!td->childFrameMap.isEmpty()
!td->childFrameMap.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
481 for (int r = 0; r < rows
r < rowsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++r) {
0
482 for (int c = 0; c < columns
c < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
483 QTextTableCell cell = table->cellAt(r, c);-
484 if (cell.row() != r
cell.row() != rDescription
TRUEnever evaluated
FALSEnever evaluated
|| cell.column() != c
cell.column() != cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
485 continue;
never executed: continue;
0
486-
487 QRectF cellRect = td->cellRect(cell);-
488 const QFixedPoint cellPos = QFixedPoint::fromPointF(cellRect.topLeft());-
489 const QFixedPoint pointInCell = relativePoint - cellPos;-
490-
491 const QList<QTextFrame *> childFrames = td->childFrameMap.values(r + c * rows);-
492 for (int i = 0; i < childFrames.size()
i < childFrames.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
493 QTextFrame *child = childFrames.at(i);-
494 if (isFrameFromInlineObject(child)
isFrameFromInlineObject(child)Description
TRUEnever evaluated
FALSEnever evaluated
0
495 && child->frameFormat().position() != QTextFrameFormat::InFlow
child->frameFo...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
0
496 && hitTest(child, pointInCell, position, l, accuracy) == PointExact
hitTest(child,... == PointExactDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
497 {-
498 return
never executed: return PointExact;
PointExact;
never executed: return PointExact;
0
499 }-
500 }
never executed: end of block
0
501 }
never executed: end of block
0
502 }
never executed: end of block
0
503 }
never executed: end of block
0
504-
505 return
never executed: return hitTest(table, relativePoint, position, l, accuracy);
hitTest(table, relativePoint, position, l, accuracy);
never executed: return hitTest(table, relativePoint, position, l, accuracy);
0
506 }-
507-
508 const QList<QTextFrame *> childFrames = frame->childFrames();-
509 for (int i = 0; i < childFrames.size()
i < childFrames.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
510 QTextFrame *child = childFrames.at(i);-
511 if (isFrameFromInlineObject(child)
isFrameFromInlineObject(child)Description
TRUEnever evaluated
FALSEnever evaluated
0
512 && child->frameFormat().position() != QTextFrameFormat::InFlow
child->frameFo...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
0
513 && hitTest(child, relativePoint, position, l, accuracy) == PointExact
hitTest(child,... == PointExactDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
514 {-
515 return
never executed: return PointExact;
PointExact;
never executed: return PointExact;
0
516 }-
517 }
never executed: end of block
0
518-
519 QTextFrame::Iterator it = frame->begin();-
520-
521 if (frame == rootFrame
frame == rootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
522 it = frameIteratorForYPosition(relativePoint.y);-
523-
524 ((!(it.parentFrame() == frame)) ? qt_assert("it.parentFrame() == frame",__FILE__,674) : qt_noop());-
525 }
never executed: end of block
0
526-
527 if (it.currentFrame()
it.currentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
528 *
never executed: *position = it.currentFrame()->firstPosition();
position = it.currentFrame()->firstPosition();
never executed: *position = it.currentFrame()->firstPosition();
0
529 else-
530 *
never executed: *position = it.currentBlock().position();
position = it.currentBlock().position();
never executed: *position = it.currentBlock().position();
0
531-
532 return
never executed: return hitTest(it, PointBefore, relativePoint, position, l, accuracy);
hitTest(it, PointBefore, relativePoint, position, l, accuracy);
never executed: return hitTest(it, PointBefore, relativePoint, position, l, accuracy);
0
533}-
534-
535QTextDocumentLayoutPrivate::HitPoint-
536QTextDocumentLayoutPrivate::hitTest(QTextFrame::Iterator it, HitPoint hit, const QFixedPoint &p,-
537 int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const-
538{-
539 do {} while(0);-
540-
541 for (; !it.atEnd()
!it.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
542 QTextFrame *c = it.currentFrame();-
543 HitPoint hp;-
544 int pos = -1;-
545 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
546 hp = hitTest(c, p, &pos, l, accuracy);-
547 }
never executed: end of block
else {
0
548 hp = hitTest(it.currentBlock(), p, &pos, l, accuracy);-
549 }
never executed: end of block
0
550 if (hp >= PointInside
hp >= PointInsideDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
551 if (isEmptyBlockBeforeTable(it)
isEmptyBlockBeforeTable(it)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
552 continue;
never executed: continue;
0
553 hit = hp;-
554 *position = pos;-
555 break;
never executed: break;
0
556 }-
557 if (hp == PointBefore
hp == PointBeforeDescription
TRUEnever evaluated
FALSEnever evaluated
&& pos < *position
pos < *positionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
558 *position = pos;-
559 hit = hp;-
560 }
never executed: end of block
else if (hp == PointAfter
hp == PointAfterDescription
TRUEnever evaluated
FALSEnever evaluated
&& pos > *position
pos > *positionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
561 *position = pos;-
562 hit = hp;-
563 }
never executed: end of block
0
564 }
never executed: end of block
0
565-
566 do {} while(0);-
567-
568 return
never executed: return hit;
hit;
never executed: return hit;
0
569}-
570-
571QTextDocumentLayoutPrivate::HitPoint-
572QTextDocumentLayoutPrivate::hitTest(QTextTable *table, const QFixedPoint &point,-
573 int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const-
574{-
575 QTextTableData *td = static_cast<QTextTableData *>(data(table));-
576-
577 QVector<QFixed>::ConstIterator rowIt = std::lower_bound(td->rowPositions.constBegin(), td->rowPositions.constEnd(), point.y);-
578 if (rowIt == td->rowPositions.constEnd()
rowIt == td->r...ons.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
579 rowIt = td->rowPositions.constEnd() - 1;-
580 }
never executed: end of block
else if (rowIt != td->rowPositions.constBegin()
rowIt != td->r...s.constBegin()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
581 --rowIt;-
582 }
never executed: end of block
0
583-
584 QVector<QFixed>::ConstIterator colIt = std::lower_bound(td->columnPositions.constBegin(), td->columnPositions.constEnd(), point.x);-
585 if (colIt == td->columnPositions.constEnd()
colIt == td->c...ons.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
586 colIt = td->columnPositions.constEnd() - 1;-
587 }
never executed: end of block
else if (colIt != td->columnPositions.constBegin()
colIt != td->c...s.constBegin()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
588 --colIt;-
589 }
never executed: end of block
0
590-
591 QTextTableCell cell = table->cellAt(rowIt - td->rowPositions.constBegin(),-
592 colIt - td->columnPositions.constBegin());-
593 if (!cell.isValid()
!cell.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
594 return
never executed: return PointBefore;
PointBefore;
never executed: return PointBefore;
0
595-
596 *position = cell.firstPosition();-
597-
598 HitPoint hp = hitTest(cell.begin(), PointInside, point - td->cellPosition(cell), position, l, accuracy);-
599-
600 if (hp == PointExact
hp == PointExactDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
601 return
never executed: return hp;
hp;
never executed: return hp;
0
602 if (hp == PointAfter
hp == PointAfterDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
603 *
never executed: *position = cell.lastPosition();
position = cell.lastPosition();
never executed: *position = cell.lastPosition();
0
604 return
never executed: return PointInside;
PointInside;
never executed: return PointInside;
0
605}-
606-
607QTextDocumentLayoutPrivate::HitPoint-
608QTextDocumentLayoutPrivate::hitTest(const QTextBlock &bl, const QFixedPoint &point, int *position, QTextLayout **l,-
609 Qt::HitTestAccuracy accuracy) const-
610{-
611 QTextLayout *tl = bl.layout();-
612 QRectF textrect = tl->boundingRect();-
613 textrect.translate(tl->position());-
614-
615-
616 *position = bl.position();-
617 if (point.y.toReal() < textrect.top()
point.y.toReal...textrect.top()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
618-
619 return
never executed: return PointBefore;
PointBefore;
never executed: return PointBefore;
0
620 } else if (point.y.toReal() > textrect.bottom()
point.y.toReal...trect.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
621 *position += bl.length();-
622-
623 return
never executed: return PointAfter;
PointAfter;
never executed: return PointAfter;
0
624 }-
625-
626 QPointF pos = point.toPointF() - tl->position();-
627-
628-
629-
630 HitPoint hit = PointInside;-
631 *l = tl;-
632 int off = 0;-
633 for (int i = 0; i < tl->lineCount()
i < tl->lineCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
634 QTextLine line = tl->lineAt(i);-
635 const QRectF lr = line.naturalTextRect();-
636 if (lr.top() > pos.y()
lr.top() > pos.y()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
637 off = qMin(off, line.textStart());-
638 }
never executed: end of block
else if (lr.bottom() <= pos.y()
lr.bottom() <= pos.y()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
639 off = qMax(off, line.textStart() + line.textLength());-
640 }
never executed: end of block
else {
0
641 if (lr.left() <= pos.x()
lr.left() <= pos.x()Description
TRUEnever evaluated
FALSEnever evaluated
&& lr.right() >= pos.x()
lr.right() >= pos.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
642 hit = PointExact;
never executed: hit = PointExact;
0
643-
644-
645 if (accuracy == Qt::ExactHit
accuracy == Qt::ExactHitDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
646 off = line.xToCursor(pos.x(), QTextLine::CursorOnCharacter);
never executed: off = line.xToCursor(pos.x(), QTextLine::CursorOnCharacter);
0
647 else-
648 off = line.xToCursor(pos.x(), QTextLine::CursorBetweenCharacters);
never executed: off = line.xToCursor(pos.x(), QTextLine::CursorBetweenCharacters);
0
649 break;
never executed: break;
0
650 }-
651 }-
652 *position += off;-
653-
654-
655 return
never executed: return hit;
hit;
never executed: return hit;
0
656}-
657-
658-
659QFixed QTextDocumentLayoutPrivate::blockIndent(const QTextBlockFormat &blockFormat) const-
660{-
661 qreal indent = blockFormat.indent();-
662-
663 QTextObject *object = document->objectForFormat(blockFormat);-
664 if (object
objectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
665 indent += object->format().toListFormat().indent();
never executed: indent += object->format().toListFormat().indent();
0
666-
667 if (qIsNull(indent)
qIsNull(indent)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
668 return
never executed: return 0;
0;
never executed: return 0;
0
669-
670 qreal scale = 1;-
671 if (paintDevice
paintDeviceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
672 scale = qreal(paintDevice->logicalDpiY()) / qreal(qt_defaultDpi());-
673 }
never executed: end of block
0
674-
675 return
never executed: return QFixed::fromReal(indent * scale * document->indentWidth());
QFixed::fromReal(indent * scale * document->indentWidth());
never executed: return QFixed::fromReal(indent * scale * document->indentWidth());
0
676}-
677-
678void QTextDocumentLayoutPrivate::drawBorder(QPainter *painter, const QRectF &rect, qreal topMargin, qreal bottomMargin,-
679 qreal border, const QBrush &brush, QTextFrameFormat::BorderStyle style) const-
680{-
681 const qreal pageHeight = document->pageSize().height();-
682 const int topPage = pageHeight > 0
pageHeight > 0Description
TRUEnever evaluated
FALSEnever evaluated
? static_cast<int>(rect.top() / pageHeight) : 0;
0
683 const int bottomPage = pageHeight > 0
pageHeight > 0Description
TRUEnever evaluated
FALSEnever evaluated
? static_cast<int>((rect.bottom() + border) / pageHeight) : 0;
0
684-
685-
686 QCss::BorderStyle cssStyle = static_cast<QCss::BorderStyle>(style + 1);-
687-
688-
689 bool turn_off_antialiasing = !(painter->renderHints() & QPainter::Antialiasing);-
690 painter->setRenderHint(QPainter::Antialiasing);-
691-
692 for (int i = topPage; i <= bottomPage
i <= bottomPageDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
693 QRectF clipped = rect.toRect();-
694-
695 if (topPage != bottomPage
topPage != bottomPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
696 clipped.setTop(qMax(clipped.top(), i * pageHeight + topMargin - border));-
697 clipped.setBottom(qMin(clipped.bottom(), (i + 1) * pageHeight - bottomMargin));-
698-
699 if (clipped.bottom() <= clipped.top()
clipped.bottom... clipped.top()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
700 continue;
never executed: continue;
0
701 }
never executed: end of block
0
702-
703 qDrawEdge(painter, clipped.left(), clipped.top(), clipped.left() + border, clipped.bottom() + border, 0, 0, QCss::LeftEdge, cssStyle, brush);-
704 qDrawEdge(painter, clipped.left() + border, clipped.top(), clipped.right() + border, clipped.top() + border, 0, 0, QCss::TopEdge, cssStyle, brush);-
705 qDrawEdge(painter, clipped.right(), clipped.top() + border, clipped.right() + border, clipped.bottom(), 0, 0, QCss::RightEdge, cssStyle, brush);-
706 qDrawEdge(painter, clipped.left() + border, clipped.bottom(), clipped.right() + border, clipped.bottom() + border, 0, 0, QCss::BottomEdge, cssStyle, brush);-
707 }
never executed: end of block
0
708 if (turn_off_antialiasing
turn_off_antialiasingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
709 painter->setRenderHint(QPainter::Antialiasing, false);
never executed: painter->setRenderHint(QPainter::Antialiasing, false);
0
710}
never executed: end of block
0
711-
712void QTextDocumentLayoutPrivate::drawFrameDecoration(QPainter *painter, QTextFrame *frame, QTextFrameData *fd, const QRectF &clip, const QRectF &rect) const-
713{-
714-
715 const QBrush bg = frame->frameFormat().background();-
716 if (bg != Qt::NoBrush
bg != Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
717 QRectF bgRect = rect;-
718 bgRect.adjust((fd->leftMargin + fd->border).toReal(),-
719 (fd->topMargin + fd->border).toReal(),-
720 - (fd->rightMargin + fd->border).toReal(),-
721 - (fd->bottomMargin + fd->border).toReal());-
722-
723 QRectF gradientRect;-
724 QPointF origin = bgRect.topLeft();-
725 if (!frame->parentFrame()
!frame->parentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
726 bgRect = clip;-
727 gradientRect.setWidth(painter->device()->width());-
728 gradientRect.setHeight(painter->device()->height());-
729 }
never executed: end of block
0
730 fillBackground(painter, bgRect, bg, origin, gradientRect);-
731 }
never executed: end of block
0
732 if (fd->border != 0
fd->border != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
733 painter->save();-
734 painter->setBrush(Qt::lightGray);-
735 painter->setPen(Qt::NoPen);-
736-
737 const qreal leftEdge = rect.left() + fd->leftMargin.toReal();-
738 const qreal border = fd->border.toReal();-
739 const qreal topMargin = fd->topMargin.toReal();-
740 const qreal leftMargin = fd->leftMargin.toReal();-
741 const qreal bottomMargin = fd->bottomMargin.toReal();-
742 const qreal rightMargin = fd->rightMargin.toReal();-
743 const qreal w = rect.width() - 2 * border - leftMargin - rightMargin;-
744 const qreal h = rect.height() - 2 * border - topMargin - bottomMargin;-
745-
746 drawBorder(painter, QRectF(leftEdge, rect.top() + topMargin, w + border, h + border),-
747 fd->effectiveTopMargin.toReal(), fd->effectiveBottomMargin.toReal(),-
748 border, frame->frameFormat().borderBrush(), frame->frameFormat().borderStyle());-
749-
750 painter->restore();-
751 }
never executed: end of block
0
752}
never executed: end of block
0
753-
754static void adjustContextSelectionsForCell(QAbstractTextDocumentLayout::PaintContext &cell_context,-
755 const QTextTableCell &cell,-
756 int r, int c,-
757 const int *selectedTableCells)-
758{-
759 for (int i = 0; i < cell_context.selections.size()
i < cell_conte...ections.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
760 int row_start = selectedTableCells[i * 4];-
761 int col_start = selectedTableCells[i * 4 + 1];-
762 int num_rows = selectedTableCells[i * 4 + 2];-
763 int num_cols = selectedTableCells[i * 4 + 3];-
764-
765 if (row_start != -1
row_start != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
766 if (r >= row_start
r >= row_startDescription
TRUEnever evaluated
FALSEnever evaluated
&& r < row_start + num_rows
r < row_start + num_rowsDescription
TRUEnever evaluated
FALSEnever evaluated
0
767 && c >= col_start
c >= col_startDescription
TRUEnever evaluated
FALSEnever evaluated
&& c < col_start + num_cols
c < col_start + num_colsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
768 {-
769 int firstPosition = cell.firstPosition();-
770 int lastPosition = cell.lastPosition();-
771-
772-
773 if (firstPosition == lastPosition
firstPosition == lastPositionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
774 ++
never executed: ++lastPosition;
lastPosition;
never executed: ++lastPosition;
0
775-
776 cell_context.selections[i].cursor.setPosition(firstPosition);-
777 cell_context.selections[i].cursor.setPosition(lastPosition, QTextCursor::KeepAnchor);-
778 }
never executed: end of block
else {
0
779 cell_context.selections[i].cursor.clearSelection();-
780 }
never executed: end of block
0
781 }-
782-
783-
784 cell_context.selections[i].format.clearProperty(QTextFormat::FullWidthSelection);-
785 }
never executed: end of block
0
786}
never executed: end of block
0
787-
788void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *painter,-
789 const QAbstractTextDocumentLayout::PaintContext &context,-
790 QTextFrame *frame) const-
791{-
792 QTextFrameData *fd = data(frame);-
793-
794 if (fd->layoutDirty
fd->layoutDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
795 return;
never executed: return;
0
796 ((!(!fd->sizeDirty)) ? qt_assert("!fd->sizeDirty",__FILE__,956) : qt_noop());-
797 ((!(!fd->layoutDirty)) ? qt_assert("!fd->layoutDirty",__FILE__,957) : qt_noop());-
798-
799 const QPointF off = offset + fd->position.toPointF();-
800 if (context.clip.isValid()
context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
801 && (off.y() > context.clip.bottom()
off.y() > cont....clip.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
|| off.y() + fd->size.height.toReal() < context.clip.top()
off.y() + fd->...ext.clip.top()Description
TRUEnever evaluated
FALSEnever evaluated
0
802 || off.x() > context.clip.right()
off.x() > context.clip.right()Description
TRUEnever evaluated
FALSEnever evaluated
|| off.x() + fd->size.width.toReal() < context.clip.left()
off.x() + fd->...xt.clip.left()Description
TRUEnever evaluated
FALSEnever evaluated
))
0
803 return;
never executed: return;
0
804-
805-
806-
807-
808-
809-
810 QTextBlock cursorBlockNeedingRepaint;-
811 QPointF offsetOfRepaintedCursorBlock = off;-
812-
813 QTextTable *table = qobject_cast<QTextTable *>(frame);-
814 const QRectF frameRect(off, fd->size.toSizeF());-
815-
816 if (table
tableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
817 const int rows = table->rows();-
818 const int columns = table->columns();-
819 QTextTableData *td = static_cast<QTextTableData *>(data(table));-
820-
821 QVarLengthArray<int> selectedTableCells(context.selections.size() * 4);-
822 for (int i = 0; i < context.selections.size()
i < context.selections.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
823 const QAbstractTextDocumentLayout::Selection &s = context.selections.at(i);-
824 int row_start = -1, col_start = -1, num_rows = -1, num_cols = -1;-
825-
826 if (s.cursor.currentTable() == table
s.cursor.curre...ble() == tableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
827 s.cursor.selectedTableCells(&row_start, &num_rows, &col_start, &num_cols);
never executed: s.cursor.selectedTableCells(&row_start, &num_rows, &col_start, &num_cols);
0
828-
829 selectedTableCells[i * 4] = row_start;-
830 selectedTableCells[i * 4 + 1] = col_start;-
831 selectedTableCells[i * 4 + 2] = num_rows;-
832 selectedTableCells[i * 4 + 3] = num_cols;-
833 }
never executed: end of block
0
834-
835 QFixed pageHeight = QFixed::fromReal(document->pageSize().height());-
836 if (pageHeight <= 0
pageHeight <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
837 pageHeight = (2147483647/256);
never executed: pageHeight = (2147483647/256);
0
838-
839 const int tableStartPage = (td->position.y / pageHeight).truncate();-
840 const int tableEndPage = ((td->position.y + td->size.height) / pageHeight).truncate();-
841-
842 qreal border = td->border.toReal();-
843 drawFrameDecoration(painter, frame, fd, context.clip, frameRect);-
844-
845-
846 const int headerRowCount = qMin(table->format().headerRowCount(), rows - 1);-
847 int page = tableStartPage + 1;-
848 while (page <= tableEndPage
page <= tableEndPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
849 const QFixed pageTop = page * pageHeight + td->effectiveTopMargin + td->cellSpacing + td->border;-
850 const qreal headerOffset = (pageTop - td->rowPositions.at(0)).toReal();-
851 for (int r = 0; r < headerRowCount
r < headerRowCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++r) {
0
852 for (int c = 0; c < columns
c < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
853 QTextTableCell cell = table->cellAt(r, c);-
854 QAbstractTextDocumentLayout::PaintContext cell_context = context;-
855 adjustContextSelectionsForCell(cell_context, cell, r, c, selectedTableCells.data());-
856 QRectF cellRect = td->cellRect(cell);-
857-
858 cellRect.translate(off.x(), headerOffset);-
859-
860 int leftAdjust = qMin(qreal(0), 1 - border);-
861 if (cell_context.clip.isValid()
cell_context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& !cellRect.adjusted(leftAdjust, leftAdjust, border, border).intersects(cell_context.clip)
!cellRect.adju..._context.clip)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
862 continue;
never executed: continue;
0
863-
864 drawTableCell(cellRect, painter, cell_context, table, td, r, c, &cursorBlockNeedingRepaint,-
865 &offsetOfRepaintedCursorBlock);-
866 }
never executed: end of block
0
867 }
never executed: end of block
0
868 ++page;-
869 }
never executed: end of block
0
870-
871 int firstRow = 0;-
872 int lastRow = rows;-
873-
874 if (context.clip.isValid()
context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
875 QVector<QFixed>::ConstIterator rowIt = std::lower_bound(td->rowPositions.constBegin(), td->rowPositions.constEnd(), QFixed::fromReal(context.clip.top() - off.y()));-
876 if (rowIt != td->rowPositions.constEnd()
rowIt != td->r...ons.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
&& rowIt != td->rowPositions.constBegin()
rowIt != td->r...s.constBegin()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
877 --rowIt;-
878 firstRow = rowIt - td->rowPositions.constBegin();-
879 }
never executed: end of block
0
880-
881 rowIt = std::upper_bound(td->rowPositions.constBegin(), td->rowPositions.constEnd(), QFixed::fromReal(context.clip.bottom() - off.y()));-
882 if (rowIt != td->rowPositions.constEnd()
rowIt != td->r...ons.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
883 ++rowIt;-
884 lastRow = rowIt - td->rowPositions.constBegin();-
885 }
never executed: end of block
0
886 }
never executed: end of block
0
887-
888 for (int c = 0; c < columns
c < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
889 QTextTableCell cell = table->cellAt(firstRow, c);-
890 firstRow = qMin(firstRow, cell.row());-
891 }
never executed: end of block
0
892-
893 for (int r = firstRow; r < lastRow
r < lastRowDescription
TRUEnever evaluated
FALSEnever evaluated
; ++r) {
0
894 for (int c = 0; c < columns
c < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
895 QTextTableCell cell = table->cellAt(r, c);-
896 QAbstractTextDocumentLayout::PaintContext cell_context = context;-
897 adjustContextSelectionsForCell(cell_context, cell, r, c, selectedTableCells.data());-
898 QRectF cellRect = td->cellRect(cell);-
899-
900 cellRect.translate(off);-
901-
902 int leftAdjust = qMin(qreal(0), 1 - border);-
903 if (cell_context.clip.isValid()
cell_context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& !cellRect.adjusted(leftAdjust, leftAdjust, border, border).intersects(cell_context.clip)
!cellRect.adju..._context.clip)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
904 continue;
never executed: continue;
0
905-
906 drawTableCell(cellRect, painter, cell_context, table, td, r, c, &cursorBlockNeedingRepaint,-
907 &offsetOfRepaintedCursorBlock);-
908 }
never executed: end of block
0
909 }
never executed: end of block
0
910-
911 }
never executed: end of block
else {
0
912 drawFrameDecoration(painter, frame, fd, context.clip, frameRect);-
913-
914 QTextFrame::Iterator it = frame->begin();-
915-
916 if (frame == docPrivate->rootFrame()
frame == docPr...e->rootFrame()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
917 it = frameIteratorForYPosition(QFixed::fromReal(context.clip.top()));
never executed: it = frameIteratorForYPosition(QFixed::fromReal(context.clip.top()));
0
918-
919 QList<QTextFrame *> floats;-
920 const int numFloats = fd->floats.count();-
921 floats.reserve(numFloats);-
922 for (int i = 0; i < numFloats
i < numFloatsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
923 floats.append(fd->floats.at(i));
never executed: floats.append(fd->floats.at(i));
0
924-
925 drawFlow(off, painter, context, it, floats, &cursorBlockNeedingRepaint);-
926 }
never executed: end of block
0
927-
928 if (cursorBlockNeedingRepaint.isValid()
cursorBlockNee...aint.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
929 const QPen oldPen = painter->pen();-
930 painter->setPen(context.palette.color(QPalette::Text));-
931 const int cursorPos = context.cursorPosition - cursorBlockNeedingRepaint.position();-
932 cursorBlockNeedingRepaint.layout()->drawCursor(painter, offsetOfRepaintedCursorBlock,-
933 cursorPos, cursorWidth);-
934 painter->setPen(oldPen);-
935 }
never executed: end of block
0
936-
937-
938-
939 return;
never executed: return;
0
940}-
941-
942void QTextDocumentLayoutPrivate::drawTableCell(const QRectF &cellRect, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &cell_context,-
943 QTextTable *table, QTextTableData *td, int r, int c,-
944 QTextBlock *cursorBlockNeedingRepaint, QPointF *cursorBlockOffset) const-
945{-
946 QTextTableCell cell = table->cellAt(r, c);-
947 int rspan = cell.rowSpan();-
948 int cspan = cell.columnSpan();-
949 if (rspan != 1
rspan != 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
950 int cr = cell.row();-
951 if (cr != r
cr != rDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
952 return;
never executed: return;
0
953 }
never executed: end of block
0
954 if (cspan != 1
cspan != 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
955 int cc = cell.column();-
956 if (cc != c
cc != cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
957 return;
never executed: return;
0
958 }
never executed: end of block
0
959-
960 QTextFormat fmt = cell.format();-
961 const QFixed leftPadding = td->leftPadding(fmt);-
962 const QFixed topPadding = td->topPadding(fmt);-
963-
964 qreal topMargin = (td->effectiveTopMargin + td->cellSpacing + td->border).toReal();-
965 qreal bottomMargin = (td->effectiveBottomMargin + td->cellSpacing + td->border).toReal();-
966-
967 const int headerRowCount = qMin(table->format().headerRowCount(), table->rows() - 1);-
968 if (r >= headerRowCount
r >= headerRowCountDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
969 topMargin += td->headerHeight.toReal();
never executed: topMargin += td->headerHeight.toReal();
0
970-
971 if (td->border != 0
td->border != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
972 const QBrush oldBrush = painter->brush();-
973 const QPen oldPen = painter->pen();-
974-
975 const qreal border = td->border.toReal();-
976-
977 QRectF borderRect(cellRect.left() - border, cellRect.top() - border, cellRect.width() + border, cellRect.height() + border);-
978-
979-
980 QTextFrameFormat::BorderStyle cellBorder = table->format().borderStyle();-
981 switch (cellBorder) {-
982 case
never executed: case QTextFrameFormat::BorderStyle_Inset:
QTextFrameFormat::BorderStyle_Inset:
never executed: case QTextFrameFormat::BorderStyle_Inset:
0
983 cellBorder = QTextFrameFormat::BorderStyle_Outset;-
984 break;
never executed: break;
0
985 case
never executed: case QTextFrameFormat::BorderStyle_Outset:
QTextFrameFormat::BorderStyle_Outset:
never executed: case QTextFrameFormat::BorderStyle_Outset:
0
986 cellBorder = QTextFrameFormat::BorderStyle_Inset;-
987 break;
never executed: break;
0
988 case
never executed: case QTextFrameFormat::BorderStyle_Groove:
QTextFrameFormat::BorderStyle_Groove:
never executed: case QTextFrameFormat::BorderStyle_Groove:
0
989 cellBorder = QTextFrameFormat::BorderStyle_Ridge;-
990 break;
never executed: break;
0
991 case
never executed: case QTextFrameFormat::BorderStyle_Ridge:
QTextFrameFormat::BorderStyle_Ridge:
never executed: case QTextFrameFormat::BorderStyle_Ridge:
0
992 cellBorder = QTextFrameFormat::BorderStyle_Groove;-
993 break;
never executed: break;
0
994 default
never executed: default:
:
never executed: default:
0
995 break;
never executed: break;
0
996 }-
997-
998 drawBorder(painter, borderRect, topMargin, bottomMargin,-
999 border, table->format().borderBrush(), cellBorder);-
1000-
1001 painter->setBrush(oldBrush);-
1002 painter->setPen(oldPen);-
1003 }
never executed: end of block
0
1004-
1005 const QBrush bg = cell.format().background();-
1006 const QPointF brushOrigin = painter->brushOrigin();-
1007 if (bg.style() != Qt::NoBrush
bg.style() != Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1008 const qreal pageHeight = document->pageSize().height();-
1009 const int topPage = pageHeight > 0
pageHeight > 0Description
TRUEnever evaluated
FALSEnever evaluated
? static_cast<int>(cellRect.top() / pageHeight) : 0;
0
1010 const int bottomPage = pageHeight > 0
pageHeight > 0Description
TRUEnever evaluated
FALSEnever evaluated
? static_cast<int>((cellRect.bottom()) / pageHeight) : 0;
0
1011-
1012 if (topPage == bottomPage
topPage == bottomPageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1013 fillBackground(painter, cellRect, bg, cellRect.topLeft());
never executed: fillBackground(painter, cellRect, bg, cellRect.topLeft());
0
1014 else {-
1015 for (int i = topPage; i <= bottomPage
i <= bottomPageDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1016 QRectF clipped = cellRect.toRect();-
1017-
1018 if (topPage != bottomPage
topPage != bottomPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1019 const qreal top = qMax(i * pageHeight + topMargin, cell_context.clip.top());-
1020 const qreal bottom = qMin((i + 1) * pageHeight - bottomMargin, cell_context.clip.bottom());-
1021-
1022 clipped.setTop(qMax(clipped.top(), top));-
1023 clipped.setBottom(qMin(clipped.bottom(), bottom));-
1024-
1025 if (clipped.bottom() <= clipped.top()
clipped.bottom... clipped.top()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1026 continue;
never executed: continue;
0
1027-
1028 fillBackground(painter, clipped, bg, cellRect.topLeft());-
1029 }
never executed: end of block
0
1030 }
never executed: end of block
0
1031 }
never executed: end of block
0
1032-
1033 if (bg.style() > Qt::SolidPattern
bg.style() > Qt::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1034 painter->setBrushOrigin(cellRect.topLeft());
never executed: painter->setBrushOrigin(cellRect.topLeft());
0
1035 }
never executed: end of block
0
1036-
1037 const QFixed verticalOffset = td->cellVerticalOffsets.at(c + r * table->columns());-
1038-
1039 const QPointF cellPos = QPointF(cellRect.left() + leftPadding.toReal(),-
1040 cellRect.top() + (topPadding + verticalOffset).toReal());-
1041-
1042 QTextBlock repaintBlock;-
1043 drawFlow(cellPos, painter, cell_context, cell.begin(),-
1044 td->childFrameMap.values(r + c * table->rows()),-
1045 &repaintBlock);-
1046 if (repaintBlock.isValid()
repaintBlock.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1047 *cursorBlockNeedingRepaint = repaintBlock;-
1048 *cursorBlockOffset = cellPos;-
1049 }
never executed: end of block
0
1050-
1051 if (bg.style() > Qt::SolidPattern
bg.style() > Qt::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1052 painter->setBrushOrigin(brushOrigin);
never executed: painter->setBrushOrigin(brushOrigin);
0
1053}
never executed: end of block
0
1054-
1055void QTextDocumentLayoutPrivate::drawFlow(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,-
1056 QTextFrame::Iterator it, const QList<QTextFrame *> &floats, QTextBlock *cursorBlockNeedingRepaint) const-
1057{-
1058 const QTextDocumentLayout * const q = q_func();-
1059 const bool inRootFrame = (!it.atEnd()
!it.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
&& it.parentFrame()
it.parentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
&& it.parentFrame()->parentFrame() == 0
it.parentFrame...ntFrame() == 0Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1060-
1061 QVector<QCheckPoint>::ConstIterator lastVisibleCheckPoint = checkPoints.end();-
1062 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
&& context.clip.isValid()
context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1063 lastVisibleCheckPoint = std::lower_bound(checkPoints.begin(), checkPoints.end(), QFixed::fromReal(context.clip.bottom()));-
1064 }
never executed: end of block
0
1065-
1066 QTextBlock previousBlock;-
1067 QTextFrame *previousFrame = 0;-
1068-
1069 for (; !it.atEnd()
!it.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
1070 QTextFrame *c = it.currentFrame();-
1071-
1072 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
&& !checkPoints.isEmpty()
!checkPoints.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1073 int currentPosInDoc;-
1074 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1075 currentPosInDoc = c->firstPosition();
never executed: currentPosInDoc = c->firstPosition();
0
1076 else-
1077 currentPosInDoc = it.currentBlock().position();
never executed: currentPosInDoc = it.currentBlock().position();
0
1078-
1079-
1080-
1081 if (currentPosInDoc >= checkPoints.constLast().positionInFrame
currentPosInDo...ositionInFrameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1082 break;
never executed: break;
0
1083-
1084 if (lastVisibleCheckPoint != checkPoints.end()
lastVisibleChe...ckPoints.end()Description
TRUEnever evaluated
FALSEnever evaluated
0
1085 && context.clip.isValid()
context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1086 && currentPosInDoc >= lastVisibleCheckPoint->positionInFrame
currentPosInDo...ositionInFrameDescription
TRUEnever evaluated
FALSEnever evaluated
0
1087 )-
1088 break;
never executed: break;
0
1089 }
never executed: end of block
0
1090-
1091 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1092 drawFrame(offset, painter, context, c);
never executed: drawFrame(offset, painter, context, c);
0
1093 else {-
1094 QAbstractTextDocumentLayout::PaintContext pc = context;-
1095 if (isEmptyBlockAfterTable(it.currentBlock(), previousFrame)
isEmptyBlockAf...previousFrame)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1096 pc.selections.clear();
never executed: pc.selections.clear();
0
1097 drawBlock(offset, painter, pc, it.currentBlock(), inRootFrame);-
1098 }
never executed: end of block
0
1099-
1100-
1101-
1102-
1103-
1104-
1105-
1106 if (isEmptyBlockBeforeTable(previousBlock, previousBlock.blockFormat(), it)
isEmptyBlockBe...kFormat(), it)Description
TRUEnever evaluated
FALSEnever evaluated
0
1107 && previousBlock.contains(context.cursorPosition)
previousBlock....ursorPosition)Description
TRUEnever evaluated
FALSEnever evaluated
0
1108 ) {-
1109 *cursorBlockNeedingRepaint = previousBlock;-
1110 }
never executed: end of block
0
1111-
1112 previousBlock = it.currentBlock();-
1113 previousFrame = c;-
1114 }
never executed: end of block
0
1115-
1116 for (int i = 0; i < floats.count()
i < floats.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1117 QTextFrame *frame = floats.at(i);-
1118 if (!isFrameFromInlineObject(frame)
!isFrameFromIn...eObject(frame)Description
TRUEnever evaluated
FALSEnever evaluated
0
1119 || frame->frameFormat().position() == QTextFrameFormat::InFlow
frame->frameFo...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1120 continue;
never executed: continue;
0
1121-
1122 const int pos = frame->firstPosition() - 1;-
1123 QTextCharFormat format = const_cast<QTextDocumentLayout *>(q)->format(pos);-
1124 QTextObjectInterface *handler = q->handlerForObject(format.objectType());-
1125 if (handler
handlerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1126 QRectF rect = frameBoundingRectInternal(frame);-
1127 handler->drawObject(painter, rect, document, pos, format);-
1128 }
never executed: end of block
0
1129 }
never executed: end of block
0
1130}
never executed: end of block
0
1131-
1132void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *painter,-
1133 const QAbstractTextDocumentLayout::PaintContext &context,-
1134 const QTextBlock &bl, bool inRootFrame) const-
1135{-
1136 const QTextLayout *tl = bl.layout();-
1137 QRectF r = tl->boundingRect();-
1138 r.translate(offset + tl->position());-
1139 if (!bl.isVisible()
!bl.isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
|| (context.clip.isValid()
context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& (r.bottom() < context.clip.y()
r.bottom() < context.clip.y()Description
TRUEnever evaluated
FALSEnever evaluated
|| r.top() > context.clip.bottom()
r.top() > cont....clip.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
)))
0
1140 return;
never executed: return;
0
1141-
1142-
1143 QTextBlockFormat blockFormat = bl.blockFormat();-
1144-
1145 QBrush bg = blockFormat.background();-
1146 if (bg != Qt::NoBrush
bg != Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1147 QRectF rect = r;-
1148-
1149-
1150-
1151-
1152 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
&& document->pageSize().width() <= 0
document->page...).width() <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1153 const QTextFrameData *fd = data(document->rootFrame());-
1154 rect.setRight((fd->size.width - fd->rightMargin).toReal());-
1155 }
never executed: end of block
0
1156-
1157 fillBackground(painter, rect, bg, r.topLeft());-
1158 }
never executed: end of block
0
1159-
1160 QVector<QTextLayout::FormatRange> selections;-
1161 int blpos = bl.position();-
1162 int bllen = bl.length();-
1163 const QTextCharFormat *selFormat = 0;-
1164 for (int i = 0; i < context.selections.size()
i < context.selections.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1165 const QAbstractTextDocumentLayout::Selection &range = context.selections.at(i);-
1166 const int selStart = range.cursor.selectionStart() - blpos;-
1167 const int selEnd = range.cursor.selectionEnd() - blpos;-
1168 if (selStart < bllen
selStart < bllenDescription
TRUEnever evaluated
FALSEnever evaluated
&& selEnd > 0
selEnd > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1169 && selEnd > selStart
selEnd > selStartDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1170 QTextLayout::FormatRange o;-
1171 o.start = selStart;-
1172 o.length = selEnd - selStart;-
1173 o.format = range.format;-
1174 selections.append(o);-
1175 }
never executed: end of block
else if (! range.cursor.hasSelection()
! range.cursor.hasSelection()Description
TRUEnever evaluated
FALSEnever evaluated
&& range.format.hasProperty(QTextFormat::FullWidthSelection)
range.format.h...idthSelection)Description
TRUEnever evaluated
FALSEnever evaluated
0
1176 && bl.contains(range.cursor.position())
bl.contains(ra...or.position())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1177-
1178-
1179 QTextLayout::FormatRange o;-
1180 QTextLine l = tl->lineForTextPosition(range.cursor.position() - blpos);-
1181 o.start = l.textStart();-
1182 o.length = l.textLength();-
1183 if (o.start + o.length == bllen - 1
o.start + o.le...h == bllen - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1184 ++
never executed: ++o.length;
o.length;
never executed: ++o.length;
0
1185 o.format = range.format;-
1186 selections.append(o);-
1187 }
never executed: end of block
0
1188 if (selStart < 0
selStart < 0Description
TRUEnever evaluated
FALSEnever evaluated
&& selEnd >= 1
selEnd >= 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1189 selFormat = &range.format;
never executed: selFormat = &range.format;
0
1190 }
never executed: end of block
0
1191-
1192 QTextObject *object = document->objectForFormat(bl.blockFormat());-
1193 if (object
objectDescription
TRUEnever evaluated
FALSEnever evaluated
&& object->format().toListFormat().style() != QTextListFormat::ListStyleUndefined
object->format...StyleUndefinedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1194 drawListItem(offset, painter, context, bl, selFormat);
never executed: drawListItem(offset, painter, context, bl, selFormat);
0
1195-
1196 QPen oldPen = painter->pen();-
1197 painter->setPen(context.palette.color(QPalette::Text));-
1198-
1199 tl->draw(painter, offset, selections, context.clip.isValid() ? (context.clip & clipRect) : clipRect);-
1200-
1201 if ((context.cursorPosition >= blpos
context.cursor...ition >= blposDescription
TRUEnever evaluated
FALSEnever evaluated
&& context.cursorPosition < blpos + bllen
context.cursor... blpos + bllenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1202 || (context.cursorPosition < -1
context.cursorPosition < -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !tl->preeditAreaText().isEmpty()
!tl->preeditAr...xt().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1203 int cpos = context.cursorPosition;-
1204 if (cpos < -1
cpos < -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1205 cpos = tl->preeditAreaPosition() - (cpos + 2);
never executed: cpos = tl->preeditAreaPosition() - (cpos + 2);
0
1206 else-
1207 cpos -= blpos;
never executed: cpos -= blpos;
0
1208 tl->drawCursor(painter, offset, cpos, cursorWidth);-
1209 }
never executed: end of block
0
1210-
1211 if (blockFormat.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth)
blockFormat.ha...talRulerWidth)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1212 const qreal width = blockFormat.lengthProperty(QTextFormat::BlockTrailingHorizontalRulerWidth).value(r.width());-
1213 painter->setPen(context.palette.color(QPalette::Dark));-
1214 qreal y = r.bottom();-
1215 if (bl.length() == 1
bl.length() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1216 y = r.top() + r.height() / 2;
never executed: y = r.top() + r.height() / 2;
0
1217-
1218 const qreal middleX = r.left() + r.width() / 2;-
1219 painter->drawLine(QLineF(middleX - width / 2, y, middleX + width / 2, y));-
1220 }
never executed: end of block
0
1221-
1222 painter->setPen(oldPen);-
1223}
never executed: end of block
0
1224-
1225-
1226void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *painter,-
1227 const QAbstractTextDocumentLayout::PaintContext &context,-
1228 const QTextBlock &bl, const QTextCharFormat *selectionFormat) const-
1229{-
1230 const QTextDocumentLayout * const q = q_func();-
1231 const QTextBlockFormat blockFormat = bl.blockFormat();-
1232 const QTextCharFormat charFormat = QTextCursor(bl).charFormat();-
1233 QFont font(charFormat.font());-
1234 if (q->paintDevice()
q->paintDevice()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1235 font = QFont(font, q->paintDevice());
never executed: font = QFont(font, q->paintDevice());
0
1236-
1237 const QFontMetrics fontMetrics(font);-
1238 QTextObject * const object = document->objectForFormat(blockFormat);-
1239 const QTextListFormat lf = object->format().toListFormat();-
1240 int style = lf.style();-
1241 QString itemText;-
1242 QSizeF size;-
1243-
1244 if (blockFormat.hasProperty(QTextFormat::ListStyle)
blockFormat.ha...at::ListStyle)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1245 style = QTextListFormat::Style(blockFormat.intProperty(QTextFormat::ListStyle));
never executed: style = QTextListFormat::Style(blockFormat.intProperty(QTextFormat::ListStyle));
0
1246-
1247 QTextLayout *layout = bl.layout();-
1248 if (layout->lineCount() == 0
layout->lineCount() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1249 return;
never executed: return;
0
1250 QTextLine firstLine = layout->lineAt(0);-
1251 ((!(firstLine.isValid())) ? qt_assert("firstLine.isValid()",__FILE__,1411) : qt_noop());-
1252 QPointF pos = (offset + layout->position()).toPoint();-
1253 Qt::LayoutDirection dir = bl.textDirection();-
1254 {-
1255 QRectF textRect = firstLine.naturalTextRect();-
1256 pos += textRect.topLeft().toPoint();-
1257 if (dir == Qt::RightToLeft
dir == Qt::RightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1258 pos.rx() += textRect.width();
never executed: pos.rx() += textRect.width();
0
1259 }-
1260-
1261 switch (style) {-
1262 case
never executed: case QTextListFormat::ListDecimal:
QTextListFormat::ListDecimal:
never executed: case QTextListFormat::ListDecimal:
0
1263 case
never executed: case QTextListFormat::ListLowerAlpha:
QTextListFormat::ListLowerAlpha:
never executed: case QTextListFormat::ListLowerAlpha:
0
1264 case
never executed: case QTextListFormat::ListUpperAlpha:
QTextListFormat::ListUpperAlpha:
never executed: case QTextListFormat::ListUpperAlpha:
0
1265 case
never executed: case QTextListFormat::ListLowerRoman:
QTextListFormat::ListLowerRoman:
never executed: case QTextListFormat::ListLowerRoman:
0
1266 case
never executed: case QTextListFormat::ListUpperRoman:
QTextListFormat::ListUpperRoman:
never executed: case QTextListFormat::ListUpperRoman:
0
1267 itemText = static_cast<QTextList *>(object)->itemText(bl);-
1268 size.setWidth(fontMetrics.width(itemText));-
1269 size.setHeight(fontMetrics.height());-
1270 break;
never executed: break;
0
1271-
1272 case
never executed: case QTextListFormat::ListSquare:
QTextListFormat::ListSquare:
never executed: case QTextListFormat::ListSquare:
0
1273 case
never executed: case QTextListFormat::ListCircle:
QTextListFormat::ListCircle:
never executed: case QTextListFormat::ListCircle:
0
1274 case
never executed: case QTextListFormat::ListDisc:
QTextListFormat::ListDisc:
never executed: case QTextListFormat::ListDisc:
0
1275 size.setWidth(fontMetrics.lineSpacing() / 3);-
1276 size.setHeight(size.width());-
1277 break;
never executed: break;
0
1278-
1279 case
never executed: case QTextListFormat::ListStyleUndefined:
QTextListFormat::ListStyleUndefined:
never executed: case QTextListFormat::ListStyleUndefined:
0
1280 return;
never executed: return;
0
1281 default
never executed: default:
:
never executed: default:
return;
never executed: return;
0
1282 }-
1283-
1284 QRectF r(pos, size);-
1285-
1286 qreal xoff = fontMetrics.width(QLatin1Char(' '));-
1287 if (dir == Qt::LeftToRight
dir == Qt::LeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1288 xoff = -xoff - size.width();
never executed: xoff = -xoff - size.width();
0
1289 r.translate( xoff, (fontMetrics.height() / 2) - (size.height() / 2));-
1290-
1291 painter->save();-
1292-
1293 painter->setRenderHint(QPainter::Antialiasing);-
1294-
1295 if (selectionFormat
selectionFormatDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1296 painter->setPen(QPen(selectionFormat->foreground(), 0));-
1297 painter->fillRect(r, selectionFormat->background());-
1298 }
never executed: end of block
else {
0
1299 QBrush fg = charFormat.foreground();-
1300 if (fg == Qt::NoBrush
fg == Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1301 fg = context.palette.text();
never executed: fg = context.palette.text();
0
1302 painter->setPen(QPen(fg, 0));-
1303 }
never executed: end of block
0
1304-
1305 QBrush brush = context.palette.brush(QPalette::Text);-
1306-
1307 switch (style) {-
1308 case
never executed: case QTextListFormat::ListDecimal:
QTextListFormat::ListDecimal:
never executed: case QTextListFormat::ListDecimal:
0
1309 case
never executed: case QTextListFormat::ListLowerAlpha:
QTextListFormat::ListLowerAlpha:
never executed: case QTextListFormat::ListLowerAlpha:
0
1310 case
never executed: case QTextListFormat::ListUpperAlpha:
QTextListFormat::ListUpperAlpha:
never executed: case QTextListFormat::ListUpperAlpha:
0
1311 case
never executed: case QTextListFormat::ListLowerRoman:
QTextListFormat::ListLowerRoman:
never executed: case QTextListFormat::ListLowerRoman:
0
1312 case
never executed: case QTextListFormat::ListUpperRoman:
QTextListFormat::ListUpperRoman:
never executed: case QTextListFormat::ListUpperRoman:
{
0
1313 QTextLayout layout(itemText, font, q->paintDevice());-
1314 layout.setCacheEnabled(true);-
1315 QTextOption option(Qt::AlignLeft | Qt::AlignAbsolute);-
1316 option.setTextDirection(dir);-
1317 layout.setTextOption(option);-
1318 layout.beginLayout();-
1319 QTextLine line = layout.createLine();-
1320 if (line.isValid()
line.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1321 line.setLeadingIncluded(true);
never executed: line.setLeadingIncluded(true);
0
1322 layout.endLayout();-
1323 layout.draw(painter, QPointF(r.left(), pos.y()));-
1324 break;
never executed: break;
0
1325 }-
1326 case
never executed: case QTextListFormat::ListSquare:
QTextListFormat::ListSquare:
never executed: case QTextListFormat::ListSquare:
0
1327 painter->fillRect(r, brush);-
1328 break;
never executed: break;
0
1329 case
never executed: case QTextListFormat::ListCircle:
QTextListFormat::ListCircle:
never executed: case QTextListFormat::ListCircle:
0
1330 painter->setPen(QPen(brush, 0));-
1331 painter->drawEllipse(r.translated(0.5, 0.5));-
1332 break;
never executed: break;
0
1333 case
never executed: case QTextListFormat::ListDisc:
QTextListFormat::ListDisc:
never executed: case QTextListFormat::ListDisc:
0
1334 painter->setBrush(brush);-
1335 painter->setPen(Qt::NoPen);-
1336 painter->drawEllipse(r);-
1337 break;
never executed: break;
0
1338 case
never executed: case QTextListFormat::ListStyleUndefined:
QTextListFormat::ListStyleUndefined:
never executed: case QTextListFormat::ListStyleUndefined:
0
1339 break;
never executed: break;
0
1340 default
never executed: default:
:
never executed: default:
0
1341 break;
never executed: break;
0
1342 }-
1343-
1344 painter->restore();-
1345}
never executed: end of block
0
1346-
1347static QFixed flowPosition(const QTextFrame::iterator it)-
1348{-
1349 if (it.atEnd()
it.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1350 return
never executed: return 0;
0;
never executed: return 0;
0
1351-
1352 if (it.currentFrame()
it.currentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1353 return
never executed: return data(it.currentFrame())->position.y;
data(it.currentFrame())->position.y;
never executed: return data(it.currentFrame())->position.y;
0
1354 } else {-
1355 QTextBlock block = it.currentBlock();-
1356 QTextLayout *layout = block.layout();-
1357 if (layout->lineCount() == 0
layout->lineCount() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1358 return
never executed: return QFixed::fromReal(layout->position().y());
QFixed::fromReal(layout->position().y());
never executed: return QFixed::fromReal(layout->position().y());
0
1359 else-
1360 return
never executed: return QFixed::fromReal(layout->position().y() + layout->lineAt(0).y());
QFixed::fromReal(layout->position().y() + layout->lineAt(0).y());
never executed: return QFixed::fromReal(layout->position().y() + layout->lineAt(0).y());
0
1361 }-
1362}-
1363-
1364static QFixed firstChildPos(const QTextFrame *f)-
1365{-
1366 return
never executed: return flowPosition(f->begin());
flowPosition(f->begin());
never executed: return flowPosition(f->begin());
0
1367}-
1368-
1369QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,-
1370 int layoutFrom, int layoutTo, QTextTableData *td,-
1371 QFixed absoluteTableY, bool withPageBreaks)-
1372{-
1373 if(0) QMessageLogger(__FILE__, 1533, __PRETTY_FUNCTION__).debug() << "layoutCell";
dead code: QMessageLogger(__FILE__, 1533, __PRETTY_FUNCTION__).debug() << "layoutCell";
-
1374 QTextLayoutStruct layoutStruct;-
1375 layoutStruct.frame = t;-
1376 layoutStruct.minimumWidth = 0;-
1377 layoutStruct.maximumWidth = (2147483647/256);-
1378 layoutStruct.y = 0;-
1379-
1380 const QTextFormat fmt = cell.format();-
1381 const QFixed topPadding = td->topPadding(fmt);-
1382 if (withPageBreaks
withPageBreaksDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1383 layoutStruct.frameY = absoluteTableY + td->rowPositions.at(cell.row()) + topPadding;-
1384 }
never executed: end of block
0
1385 layoutStruct.x_left = 0;-
1386 layoutStruct.x_right = width;-
1387 layoutStruct.pageHeight = QFixed::fromReal(document->pageSize().height());-
1388 if (layoutStruct.pageHeight < 0
layoutStruct.pageHeight < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| !withPageBreaks
!withPageBreaksDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1389 layoutStruct.pageHeight = (2147483647/256);
never executed: layoutStruct.pageHeight = (2147483647/256);
0
1390 const int currentPage = layoutStruct.currentPage();-
1391 layoutStruct.pageTopMargin = td->effectiveTopMargin + td->cellSpacing + td->border + topPadding;-
1392 layoutStruct.pageBottomMargin = td->effectiveBottomMargin + td->cellSpacing + td->border + td->bottomPadding(fmt);-
1393 layoutStruct.pageBottom = (currentPage + 1) * layoutStruct.pageHeight - layoutStruct.pageBottomMargin;-
1394-
1395 layoutStruct.fullLayout = true;-
1396-
1397 QFixed pageTop = currentPage * layoutStruct.pageHeight + layoutStruct.pageTopMargin - layoutStruct.frameY;-
1398 layoutStruct.y = qMax(layoutStruct.y, pageTop);-
1399-
1400 const QList<QTextFrame *> childFrames = td->childFrameMap.values(cell.row() + cell.column() * t->rows());-
1401 for (int i = 0; i < childFrames.size()
i < childFrames.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1402 QTextFrame *frame = childFrames.at(i);-
1403 QTextFrameData *cd = data(frame);-
1404 cd->sizeDirty = true;-
1405 }
never executed: end of block
0
1406-
1407 layoutFlow(cell.begin(), &layoutStruct, layoutFrom, layoutTo, width);-
1408-
1409 QFixed floatMinWidth;-
1410-
1411-
1412-
1413-
1414-
1415 for (int i = 0; i < childFrames.size()
i < childFrames.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1416 QTextFrame *frame = childFrames.at(i);-
1417 QTextFrameData *cd = data(frame);-
1418-
1419 if (frame->frameFormat().position() != QTextFrameFormat::InFlow
frame->frameFo...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1420 layoutStruct.y = qMax(layoutStruct.y, cd->position.y + cd->size.height);
never executed: layoutStruct.y = qMax(layoutStruct.y, cd->position.y + cd->size.height);
0
1421-
1422 floatMinWidth = qMax(floatMinWidth, cd->minimumWidth);-
1423 }
never executed: end of block
0
1424-
1425-
1426-
1427 layoutStruct.maximumWidth = qMax(layoutStruct.maximumWidth, floatMinWidth);-
1428-
1429-
1430-
1431 data(t)->floats.clear();-
1432-
1433-
1434-
1435 return
never executed: return layoutStruct;
layoutStruct;
never executed: return layoutStruct;
0
1436}-
1437-
1438QRectF QTextDocumentLayoutPrivate::layoutTable(QTextTable *table, int layoutFrom, int layoutTo, QFixed parentY)-
1439{-
1440 if(0) QMessageLogger(__FILE__, 1608, __PRETTY_FUNCTION__).debug() << "layoutTable";
dead code: QMessageLogger(__FILE__, 1608, __PRETTY_FUNCTION__).debug() << "layoutTable";
-
1441 QTextTableData *td = static_cast<QTextTableData *>(data(table));-
1442 ((!(td->sizeDirty)) ? qt_assert("td->sizeDirty",__FILE__,1610) : qt_noop());-
1443 const int rows = table->rows();-
1444 const int columns = table->columns();-
1445-
1446 const QTextTableFormat fmt = table->format();-
1447-
1448 td->childFrameMap.clear();-
1449 {-
1450 const QList<QTextFrame *> children = table->childFrames();-
1451 for (int i = 0; i < children.count()
i < children.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1452 QTextFrame *frame = children.at(i);-
1453 QTextTableCell cell = table->cellAt(frame->firstPosition());-
1454 td->childFrameMap.insertMulti(cell.row() + cell.column() * rows, frame);-
1455 }
never executed: end of block
0
1456 }-
1457-
1458 QVector<QTextLength> columnWidthConstraints = fmt.columnWidthConstraints();-
1459 if (columnWidthConstraints.size() != columns
columnWidthCon...e() != columnsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1460 columnWidthConstraints.resize(columns);
never executed: columnWidthConstraints.resize(columns);
0
1461 ((!(columnWidthConstraints.count() == columns)) ? qt_assert("columnWidthConstraints.count() == columns",__FILE__,1629) : qt_noop());-
1462-
1463 const QFixed cellSpacing = td->cellSpacing = QFixed::fromReal(scaleToDevice(fmt.cellSpacing()));-
1464 td->deviceScale = scaleToDevice(qreal(1));-
1465 td->cellPadding = QFixed::fromReal(scaleToDevice(fmt.cellPadding()));-
1466 const QFixed leftMargin = td->leftMargin + td->border + td->padding;-
1467 const QFixed rightMargin = td->rightMargin + td->border + td->padding;-
1468 const QFixed topMargin = td->topMargin + td->border + td->padding;-
1469-
1470 const QFixed absoluteTableY = parentY + td->position.y;-
1471-
1472 const QTextOption::WrapMode oldDefaultWrapMode = docPrivate->defaultTextOption.wrapMode();-
1473-
1474recalc_minmax_widths:
code before this statement never executed: recalc_minmax_widths:
0
1475-
1476 QFixed remainingWidth = td->contentsWidth;-
1477-
1478 remainingWidth -= columns * 2 * td->border;-
1479-
1480 remainingWidth -= (columns - 1) * cellSpacing;-
1481-
1482 remainingWidth -= 2 * cellSpacing;-
1483-
1484 const QFixed initialTotalWidth = remainingWidth;-
1485-
1486 td->widths.resize(columns);-
1487 td->widths.fill(0);-
1488-
1489 td->minWidths.resize(columns);-
1490-
1491-
1492-
1493 td->minWidths.fill(1);-
1494-
1495 td->maxWidths.resize(columns);-
1496 td->maxWidths.fill((2147483647/256));-
1497-
1498-
1499 for (int i = 0; i < columns
i < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1500 for (int row = 0; row < rows
row < rowsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++row) {
0
1501 const QTextTableCell cell = table->cellAt(row, i);-
1502 const int cspan = cell.columnSpan();-
1503-
1504 if (cspan > 1
cspan > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& i != cell.column()
i != cell.column()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1505 continue;
never executed: continue;
0
1506-
1507 const QTextFormat fmt = cell.format();-
1508 const QFixed leftPadding = td->leftPadding(fmt);-
1509 const QFixed rightPadding = td->rightPadding(fmt);-
1510 const QFixed widthPadding = leftPadding + rightPadding;-
1511-
1512-
1513-
1514-
1515 QTextLayoutStruct layoutStruct = layoutCell(table, cell, (2147483647/256), layoutFrom,-
1516 layoutTo, td, absoluteTableY,-
1517 false);-
1518-
1519-
1520 QFixed widthToDistribute = layoutStruct.minimumWidth + widthPadding;-
1521 for (int n = 0; n < cspan
n < cspanDescription
TRUEnever evaluated
FALSEnever evaluated
; ++n) {
0
1522 const int col = i + n;-
1523 QFixed w = widthToDistribute / (cspan - n);-
1524 td->minWidths[col] = qMax(td->minWidths.at(col), w);-
1525 widthToDistribute -= td->minWidths.at(col);-
1526 if (widthToDistribute <= 0
widthToDistribute <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1527 break;
never executed: break;
0
1528 }
never executed: end of block
0
1529-
1530 QFixed maxW = td->maxWidths.at(i);-
1531 if (layoutStruct.maximumWidth != (2147483647/256)
layoutStruct.m...147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1532 if (maxW == (2147483647/256)
maxW == (2147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1533 maxW = layoutStruct.maximumWidth + widthPadding;
never executed: maxW = layoutStruct.maximumWidth + widthPadding;
0
1534 else-
1535 maxW = qMax(maxW, layoutStruct.maximumWidth + widthPadding);
never executed: maxW = qMax(maxW, layoutStruct.maximumWidth + widthPadding);
0
1536 }-
1537 if (maxW == (2147483647/256)
maxW == (2147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1538 continue;
never executed: continue;
0
1539-
1540 widthToDistribute = maxW;-
1541 for (int n = 0; n < cspan
n < cspanDescription
TRUEnever evaluated
FALSEnever evaluated
; ++n) {
0
1542 const int col = i + n;-
1543 QFixed w = widthToDistribute / (cspan - n);-
1544 td->maxWidths[col] = qMax(td->minWidths.at(col), w);-
1545 widthToDistribute -= td->maxWidths.at(col);-
1546 if (widthToDistribute <= 0
widthToDistribute <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1547 break;
never executed: break;
0
1548 }
never executed: end of block
0
1549 }
never executed: end of block
0
1550 }
never executed: end of block
0
1551-
1552-
1553-
1554 QFixed totalPercentage;-
1555 int variableCols = 0;-
1556 QFixed totalMinWidth = 0;-
1557 for (int i = 0; i < columns
i < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1558 const QTextLength &length = columnWidthConstraints.at(i);-
1559 if (length.type() == QTextLength::FixedLength
length.type() ...h::FixedLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1560 td->minWidths[i] = td->widths[i] = qMax(scaleToDevice(QFixed::fromReal(length.rawValue())), td->minWidths.at(i));-
1561 remainingWidth -= td->widths.at(i);-
1562 }
never executed: end of block
else if (length.type() == QTextLength::PercentageLength
length.type() ...rcentageLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1563 totalPercentage += QFixed::fromReal(length.rawValue());-
1564 }
never executed: end of block
else if (length.type() == QTextLength::VariableLength
length.type() ...VariableLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1565 variableCols++;-
1566-
1567 td->widths[i] = td->minWidths.at(i);-
1568 remainingWidth -= td->minWidths.at(i);-
1569 }
never executed: end of block
0
1570 totalMinWidth += td->minWidths.at(i);-
1571 }
never executed: end of block
0
1572-
1573-
1574 {-
1575 const QFixed totalPercentagedWidth = initialTotalWidth * totalPercentage / 100;-
1576 QFixed remainingMinWidths = totalMinWidth;-
1577 for (int i = 0; i < columns
i < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1578 remainingMinWidths -= td->minWidths.at(i);-
1579 if (columnWidthConstraints.at(i).type() == QTextLength::PercentageLength
columnWidthCon...rcentageLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1580 const QFixed allottedPercentage = QFixed::fromReal(columnWidthConstraints.at(i).rawValue());-
1581-
1582 const QFixed percentWidth = totalPercentagedWidth * allottedPercentage / totalPercentage;-
1583 if (percentWidth >= td->minWidths.at(i)
percentWidth >...inWidths.at(i)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1584 td->widths[i] = qBound(td->minWidths.at(i), percentWidth, remainingWidth - remainingMinWidths);-
1585 }
never executed: end of block
else {
0
1586 td->widths[i] = td->minWidths.at(i);-
1587 }
never executed: end of block
0
1588 remainingWidth -= td->widths.at(i);-
1589 }
never executed: end of block
0
1590 }
never executed: end of block
0
1591 }-
1592-
1593-
1594 if (variableCols > 0
variableCols > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& remainingWidth > 0
remainingWidth > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1595 QVarLengthArray<int> columnsWithProperMaxSize;-
1596 for (int i = 0; i < columns
i < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1597 if (columnWidthConstraints.at(i).type() == QTextLength::VariableLength
columnWidthCon...VariableLengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1598 && td->maxWidths.at(i) != (2147483647/256)
td->maxWidths....147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1599 columnsWithProperMaxSize.append(i);
never executed: columnsWithProperMaxSize.append(i);
0
1600-
1601 QFixed lastRemainingWidth = remainingWidth;-
1602 while (remainingWidth > 0
remainingWidth > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1603 for (int k = 0; k < columnsWithProperMaxSize.count()
k < columnsWit...axSize.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++k) {
0
1604 const int col = columnsWithProperMaxSize[k];-
1605 const int colsLeft = columnsWithProperMaxSize.count() - k;-
1606 const QFixed w = qMin(td->maxWidths.at(col) - td->widths.at(col), remainingWidth / colsLeft);-
1607 td->widths[col] += w;-
1608 remainingWidth -= w;-
1609 }
never executed: end of block
0
1610 if (remainingWidth == lastRemainingWidth
remainingWidth...RemainingWidthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1611 break;
never executed: break;
0
1612 lastRemainingWidth = remainingWidth;-
1613 }
never executed: end of block
0
1614-
1615 if (remainingWidth > 0
remainingWidth > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1616-
1617 && fmt.width().type() != QTextLength::VariableLength
fmt.width().ty...VariableLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1618 const QFixed widthPerAnySizedCol = remainingWidth / variableCols;-
1619 for (int col = 0; col < columns
col < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++col) {
0
1620 if (columnWidthConstraints.at(col).type() == QTextLength::VariableLength
columnWidthCon...VariableLengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1621 td->widths[col] += widthPerAnySizedCol;
never executed: td->widths[col] += widthPerAnySizedCol;
0
1622 }
never executed: end of block
0
1623 }
never executed: end of block
0
1624 }
never executed: end of block
0
1625-
1626 td->columnPositions.resize(columns);-
1627 td->columnPositions[0] = leftMargin + cellSpacing + td->border;-
1628-
1629 for (int i = 1; i < columns
i < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1630 td->columnPositions[i] = td->columnPositions.at(i-1) + td->widths.at(i-1) + 2 * td->border + cellSpacing;
never executed: td->columnPositions[i] = td->columnPositions.at(i-1) + td->widths.at(i-1) + 2 * td->border + cellSpacing;
0
1631-
1632-
1633 const QFixed contentsWidth = td->columnPositions.constLast() + td->widths.constLast() + td->padding + td->border + cellSpacing - leftMargin;-
1634-
1635-
1636-
1637 if (docPrivate->defaultTextOption.wrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere
docPrivate->de...daryOrAnywhereDescription
TRUEnever evaluated
FALSEnever evaluated
0
1638 && contentsWidth > td->contentsWidth
contentsWidth ...>contentsWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1639 docPrivate->defaultTextOption.setWrapMode(QTextOption::WrapAnywhere);-
1640-
1641 goto
never executed: goto recalc_minmax_widths;
recalc_minmax_widths;
never executed: goto recalc_minmax_widths;
0
1642 }-
1643-
1644 td->contentsWidth = contentsWidth;-
1645-
1646 docPrivate->defaultTextOption.setWrapMode(oldDefaultWrapMode);-
1647-
1648 td->heights.resize(rows);-
1649 td->heights.fill(0);-
1650-
1651 td->rowPositions.resize(rows);-
1652 td->rowPositions[0] = topMargin + cellSpacing + td->border;-
1653-
1654 bool haveRowSpannedCells = false;-
1655-
1656-
1657 QVector<QFixed> cellHeights;-
1658 cellHeights.reserve(rows * columns);-
1659-
1660 QFixed pageHeight = QFixed::fromReal(document->pageSize().height());-
1661 if (pageHeight <= 0
pageHeight <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1662 pageHeight = (2147483647/256);
never executed: pageHeight = (2147483647/256);
0
1663-
1664 QVector<QFixed> heightToDistribute;-
1665 heightToDistribute.resize(columns);-
1666-
1667 td->headerHeight = 0;-
1668 const int headerRowCount = qMin(table->format().headerRowCount(), rows - 1);-
1669 const QFixed originalTopMargin = td->effectiveTopMargin;-
1670 bool hasDroppedTable = false;-
1671-
1672-
1673-
1674-
1675-
1676 for (int r = 0; r < rows
r < rowsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++r) {
0
1677 td->calcRowPosition(r);-
1678-
1679 const int tableStartPage = (absoluteTableY / pageHeight).truncate();-
1680 const int currentPage = ((td->rowPositions.at(r) + absoluteTableY) / pageHeight).truncate();-
1681 const QFixed pageBottom = (currentPage + 1) * pageHeight - td->effectiveBottomMargin - absoluteTableY - cellSpacing - td->border;-
1682 const QFixed pageTop = currentPage * pageHeight + td->effectiveTopMargin - absoluteTableY + cellSpacing + td->border;-
1683 const QFixed nextPageTop = pageTop + pageHeight;-
1684-
1685 if (td->rowPositions.at(r) > pageBottom
td->rowPositio...) > pageBottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1686 td->rowPositions[r] = nextPageTop;
never executed: td->rowPositions[r] = nextPageTop;
0
1687 else if (td->rowPositions.at(r) < pageTop
td->rowPositio...t(r) < pageTopDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1688 td->rowPositions[r] = pageTop;
never executed: td->rowPositions[r] = pageTop;
0
1689-
1690 bool dropRowToNextPage = true;-
1691 int cellCountBeforeRow = cellHeights.size();-
1692-
1693-
1694-
1695 QFixed dropDistance = 0;-
1696-
1697relayout:
code before this statement never executed: relayout:
0
1698 const int rowStartPage = ((td->rowPositions.at(r) + absoluteTableY) / pageHeight).truncate();-
1699-
1700-
1701 if (r <= headerRowCount
r <= headerRowCountDescription
TRUEnever evaluated
FALSEnever evaluated
&& rowStartPage > tableStartPage
rowStartPage > tableStartPageDescription
TRUEnever evaluated
FALSEnever evaluated
&& !hasDroppedTable
!hasDroppedTableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1702 td->rowPositions[0] = nextPageTop;-
1703 cellHeights.clear();-
1704 td->effectiveTopMargin = originalTopMargin;-
1705 hasDroppedTable = true;-
1706 r = -1;-
1707 continue;
never executed: continue;
0
1708 }-
1709-
1710 int rowCellCount = 0;-
1711 for (int c = 0; c < columns
c < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
1712 QTextTableCell cell = table->cellAt(r, c);-
1713 const int rspan = cell.rowSpan();-
1714 const int cspan = cell.columnSpan();-
1715-
1716 if (cspan > 1
cspan > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& cell.column() != c
cell.column() != cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1717 continue;
never executed: continue;
0
1718-
1719 if (rspan > 1
rspan > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1720 haveRowSpannedCells = true;-
1721-
1722 const int cellRow = cell.row();-
1723 if (cellRow != r
cellRow != rDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1724-
1725 if (cellRow + rspan - 1 == r
cellRow + rspan - 1 == rDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1726 td->heights[r] = qMax(td->heights.at(r), heightToDistribute.at(c) - dropDistance);
never executed: td->heights[r] = qMax(td->heights.at(r), heightToDistribute.at(c) - dropDistance);
0
1727 continue;
never executed: continue;
0
1728 }-
1729 }
never executed: end of block
0
1730-
1731 const QTextFormat fmt = cell.format();-
1732-
1733 const QFixed topPadding = td->topPadding(fmt);-
1734 const QFixed bottomPadding = td->bottomPadding(fmt);-
1735 const QFixed leftPadding = td->leftPadding(fmt);-
1736 const QFixed rightPadding = td->rightPadding(fmt);-
1737 const QFixed widthPadding = leftPadding + rightPadding;-
1738-
1739 ++rowCellCount;-
1740-
1741 const QFixed width = td->cellWidth(c, cspan) - widthPadding;-
1742 QTextLayoutStruct layoutStruct = layoutCell(table, cell, width,-
1743 layoutFrom, layoutTo,-
1744 td, absoluteTableY,-
1745 true);-
1746-
1747 const QFixed height = layoutStruct.y + bottomPadding + topPadding;-
1748-
1749 if (rspan > 1
rspan > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1750 heightToDistribute[c] = height + dropDistance;
never executed: heightToDistribute[c] = height + dropDistance;
0
1751 else-
1752 td->heights[r] = qMax(td->heights.at(r), height);
never executed: td->heights[r] = qMax(td->heights.at(r), height);
0
1753-
1754 cellHeights.append(layoutStruct.y);-
1755-
1756 QFixed childPos = td->rowPositions.at(r) + topPadding + flowPosition(cell.begin());-
1757 if (childPos < pageBottom
childPos < pageBottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1758 dropRowToNextPage = false;
never executed: dropRowToNextPage = false;
0
1759 }
never executed: end of block
0
1760-
1761 if (rowCellCount > 0
rowCellCount > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& dropRowToNextPage
dropRowToNextPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1762 dropDistance = nextPageTop - td->rowPositions.at(r);-
1763 td->rowPositions[r] = nextPageTop;-
1764 td->heights[r] = 0;-
1765 dropRowToNextPage = false;-
1766 cellHeights.resize(cellCountBeforeRow);-
1767 if (r > headerRowCount
r > headerRowCountDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1768 td->heights[r - 1] = pageBottom - td->rowPositions.at(r - 1);
never executed: td->heights[r - 1] = pageBottom - td->rowPositions.at(r - 1);
0
1769 goto
never executed: goto relayout;
relayout;
never executed: goto relayout;
0
1770 }-
1771-
1772 if (haveRowSpannedCells
haveRowSpannedCellsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1773 const QFixed effectiveHeight = td->heights.at(r) + td->border + cellSpacing + td->border;-
1774 for (int c = 0; c < columns
c < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++c)
0
1775 heightToDistribute[c] = qMax(heightToDistribute.at(c) - effectiveHeight - dropDistance, QFixed(0));
never executed: heightToDistribute[c] = qMax(heightToDistribute.at(c) - effectiveHeight - dropDistance, QFixed(0));
0
1776 }
never executed: end of block
0
1777-
1778 if (r == headerRowCount - 1
r == headerRowCount - 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1779 td->headerHeight = td->rowPositions.at(r) + td->heights.at(r) - td->rowPositions.at(0) + td->cellSpacing + 2 * td->border;-
1780 td->headerHeight -= td->headerHeight * (td->headerHeight / pageHeight).truncate();-
1781 td->effectiveTopMargin += td->headerHeight;-
1782 }
never executed: end of block
0
1783 }
never executed: end of block
0
1784-
1785 td->effectiveTopMargin = originalTopMargin;-
1786-
1787-
1788-
1789 td->cellVerticalOffsets.resize(rows * columns);-
1790 int cellIndex = 0;-
1791 for (int r = 0; r < rows
r < rowsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++r) {
0
1792 for (int c = 0; c < columns
c < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
1793 QTextTableCell cell = table->cellAt(r, c);-
1794 if (cell.row() != r
cell.row() != rDescription
TRUEnever evaluated
FALSEnever evaluated
|| cell.column() != c
cell.column() != cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1795 continue;
never executed: continue;
0
1796-
1797 const int rowSpan = cell.rowSpan();-
1798 const QFixed availableHeight = td->rowPositions.at(r + rowSpan - 1) + td->heights.at(r + rowSpan - 1) - td->rowPositions.at(r);-
1799-
1800 const QTextCharFormat cellFormat = cell.format();-
1801 const QFixed cellHeight = cellHeights.at(cellIndex++) + td->topPadding(cellFormat) + td->bottomPadding(cellFormat);-
1802-
1803 QFixed offset = 0;-
1804 switch (cellFormat.verticalAlignment()) {-
1805 case
never executed: case QTextCharFormat::AlignMiddle:
QTextCharFormat::AlignMiddle:
never executed: case QTextCharFormat::AlignMiddle:
0
1806 offset = (availableHeight - cellHeight) / 2;-
1807 break;
never executed: break;
0
1808 case
never executed: case QTextCharFormat::AlignBottom:
QTextCharFormat::AlignBottom:
never executed: case QTextCharFormat::AlignBottom:
0
1809 offset = availableHeight - cellHeight;-
1810 break;
never executed: break;
0
1811 default
never executed: default:
:
never executed: default:
0
1812 break;
never executed: break;
0
1813 };-
1814-
1815 for (int rd = 0; rd < cell.rowSpan()
rd < cell.rowSpan()Description
TRUEnever evaluated
FALSEnever evaluated
; ++rd) {
0
1816 for (int cd = 0; cd < cell.columnSpan()
cd < cell.columnSpan()Description
TRUEnever evaluated
FALSEnever evaluated
; ++cd) {
0
1817 const int index = (c + cd) + (r + rd) * columns;-
1818 td->cellVerticalOffsets[index] = offset;-
1819 }
never executed: end of block
0
1820 }
never executed: end of block
0
1821 }
never executed: end of block
0
1822 }
never executed: end of block
0
1823-
1824 td->minimumWidth = td->columnPositions.at(0);-
1825 for (int i = 0; i < columns
i < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1826 td->minimumWidth += td->minWidths.at(i) + 2 * td->border + cellSpacing;-
1827 }
never executed: end of block
0
1828 td->minimumWidth += rightMargin - td->border;-
1829-
1830 td->maximumWidth = td->columnPositions.at(0);-
1831 for (int i = 0; i < columns
i < columnsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1832 if (td->maxWidths.at(i) != (2147483647/256)
td->maxWidths....147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1833 td->maximumWidth += td->maxWidths.at(i) + 2 * td->border + cellSpacing;
never executed: td->maximumWidth += td->maxWidths.at(i) + 2 * td->border + cellSpacing;
0
1834 td->maximumWidth += rightMargin - td->border;-
1835-
1836 td->updateTableSize();-
1837 td->sizeDirty = false;-
1838 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
1839}-
1840-
1841void QTextDocumentLayoutPrivate::positionFloat(QTextFrame *frame, QTextLine *currentLine)-
1842{-
1843 QTextFrameData *fd = data(frame);-
1844-
1845 QTextFrame *parent = frame->parentFrame();-
1846 ((!(parent)) ? qt_assert("parent",__FILE__,2014) : qt_noop());-
1847 QTextFrameData *pd = data(parent);-
1848 ((!(pd && pd->currentLayoutStruct)) ? qt_assert("pd && pd->currentLayoutStruct",__FILE__,2016) : qt_noop());-
1849-
1850 QTextLayoutStruct *layoutStruct = pd->currentLayoutStruct;-
1851-
1852 if (!pd->floats.contains(frame)
!pd->floats.contains(frame)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1853 pd->floats.append(frame);
never executed: pd->floats.append(frame);
0
1854 fd->layoutDirty = true;-
1855 ((!(!fd->sizeDirty)) ? qt_assert("!fd->sizeDirty",__FILE__,2023) : qt_noop());-
1856-
1857-
1858 QFixed y = layoutStruct->y;-
1859 if (currentLine
currentLineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1860 QFixed left, right;-
1861 floatMargins(y, layoutStruct, &left, &right);-
1862-
1863 if (right - left < QFixed::fromReal(currentLine->naturalTextWidth()) + fd->size.width
right - left <...fd->size.widthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1864 layoutStruct->pendingFloats.append(frame);-
1865-
1866 return;
never executed: return;
0
1867 }-
1868 }
never executed: end of block
0
1869-
1870 bool frameSpansIntoNextPage = (y + layoutStruct->frameY + fd->size.height > layoutStruct->pageBottom);-
1871 if (frameSpansIntoNextPage
frameSpansIntoNextPageDescription
TRUEnever evaluated
FALSEnever evaluated
&& fd->size.height <= layoutStruct->pageHeight
fd->size.heigh...ct->pageHeightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1872 layoutStruct->newPage();-
1873 y = layoutStruct->y;-
1874-
1875 frameSpansIntoNextPage = false;-
1876 }
never executed: end of block
0
1877-
1878 y = findY(y, layoutStruct, fd->size.width);-
1879-
1880 QFixed left, right;-
1881 floatMargins(y, layoutStruct, &left, &right);-
1882-
1883 if (frame->frameFormat().position() == QTextFrameFormat::FloatLeft
frame->frameFo...mat::FloatLeftDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1884 fd->position.x = left;-
1885 fd->position.y = y;-
1886 }
never executed: end of block
else {
0
1887 fd->position.x = right - fd->size.width;-
1888 fd->position.y = y;-
1889 }
never executed: end of block
0
1890-
1891 layoutStruct->minimumWidth = qMax(layoutStruct->minimumWidth, fd->minimumWidth);-
1892 layoutStruct->maximumWidth = qMin(layoutStruct->maximumWidth, fd->maximumWidth);-
1893-
1894-
1895 fd->layoutDirty = false;-
1896-
1897-
1898-
1899 if (qobject_cast<QTextTable *>(frame) != 0
qobject_cast<Q...*>(frame) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1900 fd->sizeDirty = frameSpansIntoNextPage;
never executed: fd->sizeDirty = frameSpansIntoNextPage;
0
1901}
never executed: end of block
0
1902-
1903QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, int layoutTo, QFixed parentY)-
1904{-
1905 if(0) QMessageLogger(__FILE__, 2073, __PRETTY_FUNCTION__).debug() << "layoutFrame (pre)";
dead code: QMessageLogger(__FILE__, 2073, __PRETTY_FUNCTION__).debug() << "layoutFrame (pre)";
-
1906 ((!(data(f)->sizeDirty)) ? qt_assert("data(f)->sizeDirty",__FILE__,2074) : qt_noop());-
1907-
1908-
1909 QTextFrameFormat fformat = f->frameFormat();-
1910-
1911 QTextFrame *parent = f->parentFrame();-
1912 const QTextFrameData *pd = parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
? data(parent) : 0;
0
1913-
1914 const qreal maximumWidth = qMax(qreal(0), pd ? pd->contentsWidth.toReal() : document->pageSize().width());-
1915 QFixed width = QFixed::fromReal(fformat.width().value(maximumWidth));-
1916 if (fformat.width().type() == QTextLength::FixedLength
fformat.width(...h::FixedLengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1917 width = scaleToDevice(width);
never executed: width = scaleToDevice(width);
0
1918-
1919 const QFixed maximumHeight = pd
pdDescription
TRUEnever evaluated
FALSEnever evaluated
? pd->contentsHeight : -1;
0
1920 const QFixed height = (maximumHeight != -1
maximumHeight != -1Description
TRUEnever evaluated
FALSEnever evaluated
|| fformat.height().type() != QTextLength::PercentageLength
fformat.height...rcentageLengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1921 ? QFixed::fromReal(fformat.height().value(maximumHeight.toReal()))-
1922 : -1;-
1923-
1924 return
never executed: return layoutFrame(f, layoutFrom, layoutTo, width, height, parentY);
layoutFrame(f, layoutFrom, layoutTo, width, height, parentY);
never executed: return layoutFrame(f, layoutFrom, layoutTo, width, height, parentY);
0
1925}-
1926-
1927QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, int layoutTo, QFixed frameWidth, QFixed frameHeight, QFixed parentY)-
1928{-
1929 if(0) QMessageLogger(__FILE__, 2097, __PRETTY_FUNCTION__).debug() << "layoutFrame from=" << layoutFrom << "to=" << layoutTo;
dead code: QMessageLogger(__FILE__, 2097, __PRETTY_FUNCTION__).debug() << "layoutFrame from=" << layoutFrom << "to=" << layoutTo;
-
1930 ((!(data(f)->sizeDirty)) ? qt_assert("data(f)->sizeDirty",__FILE__,2098) : qt_noop());-
1931-
1932-
1933 QTextFrameData *fd = data(f);-
1934 QFixed newContentsWidth;-
1935-
1936 bool fullLayout = false;-
1937 {-
1938 QTextFrameFormat fformat = f->frameFormat();-
1939-
1940 QFixed tm = QFixed::fromReal(fformat.topMargin());-
1941 if (tm != fd->topMargin
tm != fd->topMarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1942 fd->topMargin = tm;-
1943 fullLayout = true;-
1944 }
never executed: end of block
0
1945 QFixed bm = QFixed::fromReal(fformat.bottomMargin());-
1946 if (bm != fd->bottomMargin
bm != fd->bottomMarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1947 fd->bottomMargin = bm;-
1948 fullLayout = true;-
1949 }
never executed: end of block
0
1950 fd->leftMargin = QFixed::fromReal(fformat.leftMargin());-
1951 fd->rightMargin = QFixed::fromReal(fformat.rightMargin());-
1952 QFixed b = QFixed::fromReal(fformat.border());-
1953 if (b != fd->border
b != fd->borderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1954 fd->border = b;-
1955 fullLayout = true;-
1956 }
never executed: end of block
0
1957 QFixed p = QFixed::fromReal(fformat.padding());-
1958 if (p != fd->padding
p != fd->paddingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1959 fd->padding = p;-
1960 fullLayout = true;-
1961 }
never executed: end of block
0
1962-
1963 QTextFrame *parent = f->parentFrame();-
1964 const QTextFrameData *pd = parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
? data(parent) : 0;
0
1965-
1966-
1967 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1968 fd->effectiveTopMargin = pd->effectiveTopMargin + fd->topMargin + fd->border + fd->padding;-
1969 fd->effectiveBottomMargin = pd->effectiveBottomMargin + fd->topMargin + fd->border + fd->padding;-
1970-
1971 if (qobject_cast<QTextTable *>(parent)
qobject_cast<Q...ble *>(parent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1972 const QTextTableData *td = static_cast<const QTextTableData *>(pd);-
1973 fd->effectiveTopMargin += td->cellSpacing + td->border + td->cellPadding;-
1974 fd->effectiveBottomMargin += td->cellSpacing + td->border + td->cellPadding;-
1975 }
never executed: end of block
0
1976 }
never executed: end of block
else {
0
1977 fd->effectiveTopMargin = fd->topMargin + fd->border + fd->padding;-
1978 fd->effectiveBottomMargin = fd->bottomMargin + fd->border + fd->padding;-
1979 }
never executed: end of block
0
1980-
1981 newContentsWidth = frameWidth - 2*(fd->border + fd->padding)-
1982 - fd->leftMargin - fd->rightMargin;-
1983-
1984 if (frameHeight != -1
frameHeight != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1985 fd->contentsHeight = frameHeight - 2*(fd->border + fd->padding)-
1986 - fd->topMargin - fd->bottomMargin;-
1987 }
never executed: end of block
else {
0
1988 fd->contentsHeight = frameHeight;-
1989 }
never executed: end of block
0
1990 }-
1991-
1992 if (isFrameFromInlineObject(f)
isFrameFromInlineObject(f)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1993-
1994 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
1995 }-
1996-
1997 if (QTextTable *table = qobject_cast<QTextTable *>(f)
QTextTable *ta...extTable *>(f)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1998 fd->contentsWidth = newContentsWidth;-
1999 return
never executed: return layoutTable(table, layoutFrom, layoutTo, parentY);
layoutTable(table, layoutFrom, layoutTo, parentY);
never executed: return layoutTable(table, layoutFrom, layoutTo, parentY);
0
2000 }-
2001-
2002-
2003-
2004-
2005 fd->contentsWidth = newContentsWidth;-
2006-
2007 QTextLayoutStruct layoutStruct;-
2008 layoutStruct.frame = f;-
2009 layoutStruct.x_left = fd->leftMargin + fd->border + fd->padding;-
2010 layoutStruct.x_right = layoutStruct.x_left + newContentsWidth;-
2011 layoutStruct.y = fd->topMargin + fd->border + fd->padding;-
2012 layoutStruct.frameY = parentY + fd->position.y;-
2013 layoutStruct.contentsWidth = 0;-
2014 layoutStruct.minimumWidth = 0;-
2015 layoutStruct.maximumWidth = (2147483647/256);-
2016 layoutStruct.fullLayout = fullLayout
fullLayoutDescription
TRUEnever evaluated
FALSEnever evaluated
|| (
(fd->oldConten...ContentsWidth)Description
TRUEnever evaluated
FALSEnever evaluated
fd->oldContentsWidth != newContentsWidth)
(fd->oldConten...ContentsWidth)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2017 layoutStruct.updateRect = QRectF(QPointF(0, 0), QSizeF(qreal(2147483647), qreal(2147483647)));-
2018 if(0) QMessageLogger(__FILE__, 2186, __PRETTY_FUNCTION__).debug() << "layoutStruct: x_left" << layoutStruct.x_left << "x_right" << layoutStruct.x_right
dead code: QMessageLogger(__FILE__, 2186, __PRETTY_FUNCTION__).debug() << "layoutStruct: x_left" << layoutStruct.x_left << "x_right" << layoutStruct.x_right << "fullLayout" << layoutStruct.fullLayout;
-
2019 << "fullLayout" << layoutStruct.fullLayout;
dead code: QMessageLogger(__FILE__, 2186, __PRETTY_FUNCTION__).debug() << "layoutStruct: x_left" << layoutStruct.x_left << "x_right" << layoutStruct.x_right << "fullLayout" << layoutStruct.fullLayout;
-
2020 fd->oldContentsWidth = newContentsWidth;-
2021-
2022 layoutStruct.pageHeight = QFixed::fromReal(document->pageSize().height());-
2023 if (layoutStruct.pageHeight < 0
layoutStruct.pageHeight < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2024 layoutStruct.pageHeight = (2147483647/256);
never executed: layoutStruct.pageHeight = (2147483647/256);
0
2025-
2026 const int currentPage = layoutStruct.pageHeight == 0
layoutStruct.pageHeight == 0Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : (layoutStruct.frameY / layoutStruct.pageHeight).truncate();
0
2027 layoutStruct.pageTopMargin = fd->effectiveTopMargin;-
2028 layoutStruct.pageBottomMargin = fd->effectiveBottomMargin;-
2029 layoutStruct.pageBottom = (currentPage + 1) * layoutStruct.pageHeight - layoutStruct.pageBottomMargin;-
2030-
2031 if (!f->parentFrame()
!f->parentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2032 idealWidth = 0;
never executed: idealWidth = 0;
0
2033-
2034 QTextFrame::Iterator it = f->begin();-
2035 layoutFlow(it, &layoutStruct, layoutFrom, layoutTo);-
2036-
2037 QFixed maxChildFrameWidth = 0;-
2038 QList<QTextFrame *> children = f->childFrames();-
2039 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2040 QTextFrame *c = children.at(i);-
2041 QTextFrameData *cd = data(c);-
2042 maxChildFrameWidth = qMax(maxChildFrameWidth, cd->size.width);-
2043 }
never executed: end of block
0
2044-
2045 const QFixed marginWidth = 2*(fd->border + fd->padding) + fd->leftMargin + fd->rightMargin;-
2046 if (!f->parentFrame()
!f->parentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2047 idealWidth = qMax(maxChildFrameWidth, layoutStruct.contentsWidth).toReal();-
2048 idealWidth += marginWidth.toReal();-
2049 }
never executed: end of block
0
2050-
2051 QFixed actualWidth = qMax(newContentsWidth, qMax(maxChildFrameWidth, layoutStruct.contentsWidth));-
2052 fd->contentsWidth = actualWidth;-
2053 if (newContentsWidth <= 0
newContentsWidth <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2054 fd->contentsWidth = newContentsWidth;-
2055 }
never executed: end of block
0
2056-
2057 fd->minimumWidth = layoutStruct.minimumWidth;-
2058 fd->maximumWidth = layoutStruct.maximumWidth;-
2059-
2060 fd->size.height = fd->contentsHeight == -1
fd->contentsHeight == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2061 ? layoutStruct.y + fd->border + fd->padding + fd->bottomMargin-
2062 : fd->contentsHeight + 2*(fd->border + fd->padding) + fd->topMargin + fd->bottomMargin;-
2063 fd->size.width = actualWidth + marginWidth;-
2064 fd->sizeDirty = false;-
2065 if (layoutStruct.updateRectForFloats.isValid()
layoutStruct.u...oats.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2066 layoutStruct.updateRect |= layoutStruct.updateRectForFloats;
never executed: layoutStruct.updateRect |= layoutStruct.updateRectForFloats;
0
2067 return
never executed: return layoutStruct.updateRect;
layoutStruct.updateRect;
never executed: return layoutStruct.updateRect;
0
2068}-
2069-
2070void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayoutStruct *layoutStruct,-
2071 int layoutFrom, int layoutTo, QFixed width)-
2072{-
2073 if(0) QMessageLogger(__FILE__, 2241, __PRETTY_FUNCTION__).debug() << "layoutFlow from=" << layoutFrom << "to=" << layoutTo;
dead code: QMessageLogger(__FILE__, 2241, __PRETTY_FUNCTION__).debug() << "layoutFlow from=" << layoutFrom << "to=" << layoutTo;
-
2074 QTextFrameData *fd = data(layoutStruct->frame);-
2075-
2076 fd->currentLayoutStruct = layoutStruct;-
2077-
2078 QTextFrame::Iterator previousIt;-
2079-
2080 const bool inRootFrame = (it.parentFrame() == document->rootFrame());-
2081 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2082 bool redoCheckPoints = layoutStruct->fullLayout
layoutStruct->fullLayoutDescription
TRUEnever evaluated
FALSEnever evaluated
|| checkPoints.isEmpty()
checkPoints.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2083-
2084 if (!redoCheckPoints
!redoCheckPointsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2085 QVector<QCheckPoint>::Iterator checkPoint = std::lower_bound(checkPoints.begin(), checkPoints.end(), layoutFrom);-
2086 if (checkPoint != checkPoints.end()
checkPoint != ...ckPoints.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2087 if (checkPoint != checkPoints.begin()
checkPoint != ...Points.begin()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2088 --
never executed: --checkPoint;
checkPoint;
never executed: --checkPoint;
0
2089-
2090 layoutStruct->y = checkPoint->y;-
2091 layoutStruct->frameY = checkPoint->frameY;-
2092 layoutStruct->minimumWidth = checkPoint->minimumWidth;-
2093 layoutStruct->maximumWidth = checkPoint->maximumWidth;-
2094 layoutStruct->contentsWidth = checkPoint->contentsWidth;-
2095-
2096 if (layoutStruct->pageHeight > 0
layoutStruct->pageHeight > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2097 int page = layoutStruct->currentPage();-
2098 layoutStruct->pageBottom = (page + 1) * layoutStruct->pageHeight - layoutStruct->pageBottomMargin;-
2099 }
never executed: end of block
0
2100-
2101 it = frameIteratorForTextPosition(checkPoint->positionInFrame);-
2102 checkPoints.resize(checkPoint - checkPoints.begin() + 1);-
2103-
2104 if (checkPoint != checkPoints.begin()
checkPoint != ...Points.begin()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2105 previousIt = it;-
2106 --previousIt;-
2107 }
never executed: end of block
0
2108 }
never executed: end of block
else {
0
2109 redoCheckPoints = true;-
2110 }
never executed: end of block
0
2111 }-
2112-
2113 if (redoCheckPoints
redoCheckPointsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2114 checkPoints.clear();-
2115 QCheckPoint cp;-
2116 cp.y = layoutStruct->y;-
2117 cp.frameY = layoutStruct->frameY;-
2118 cp.positionInFrame = 0;-
2119 cp.minimumWidth = layoutStruct->minimumWidth;-
2120 cp.maximumWidth = layoutStruct->maximumWidth;-
2121 cp.contentsWidth = layoutStruct->contentsWidth;-
2122 checkPoints.append(cp);-
2123 }
never executed: end of block
0
2124 }
never executed: end of block
0
2125-
2126 QTextBlockFormat previousBlockFormat = previousIt.currentBlock().blockFormat();-
2127-
2128 QFixed maximumBlockWidth = 0;-
2129 while (!it.atEnd()
!it.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2130 QTextFrame *c = it.currentFrame();-
2131-
2132 int docPos;-
2133 if (it.currentFrame()
it.currentFrame()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2134 docPos = it.currentFrame()->firstPosition();
never executed: docPos = it.currentFrame()->firstPosition();
0
2135 else-
2136 docPos = it.currentBlock().position();
never executed: docPos = it.currentBlock().position();
0
2137-
2138 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2139 if (qAbs(layoutStruct->y - checkPoints.constLast().y) > 2000
qAbs(layoutStr...st().y) > 2000Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2140 QFixed left, right;-
2141 floatMargins(layoutStruct->y, layoutStruct, &left, &right);-
2142 if (left == layoutStruct->x_left
left == layoutStruct->x_leftDescription
TRUEnever evaluated
FALSEnever evaluated
&& right == layoutStruct->x_right
right == layoutStruct->x_rightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2143 QCheckPoint p;-
2144 p.y = layoutStruct->y;-
2145 p.frameY = layoutStruct->frameY;-
2146 p.positionInFrame = docPos;-
2147 p.minimumWidth = layoutStruct->minimumWidth;-
2148 p.maximumWidth = layoutStruct->maximumWidth;-
2149 p.contentsWidth = layoutStruct->contentsWidth;-
2150 checkPoints.append(p);-
2151-
2152 if (currentLazyLayoutPosition != -1
currentLazyLay...Position != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2153 && docPos > currentLazyLayoutPosition + lazyLayoutStepSize
docPos > curre...LayoutStepSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2154 break;
never executed: break;
0
2155-
2156 }
never executed: end of block
0
2157 }
never executed: end of block
0
2158 }
never executed: end of block
0
2159-
2160 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2161-
2162 QTextFrameData *cd = data(c);-
2163-
2164 QTextFrameFormat fformat = c->frameFormat();-
2165-
2166 if (fformat.position() == QTextFrameFormat::InFlow
fformat.positi...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2167 if (fformat.pageBreakPolicy() & QTextFormat::PageBreak_AlwaysBefore
fformat.pageBr...k_AlwaysBeforeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2168 layoutStruct->newPage();
never executed: layoutStruct->newPage();
0
2169-
2170 QFixed left, right;-
2171 floatMargins(layoutStruct->y, layoutStruct, &left, &right);-
2172 left = qMax(left, layoutStruct->x_left);-
2173 right = qMin(right, layoutStruct->x_right);-
2174-
2175 if (right - left < cd->size.width
right - left < cd->size.widthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2176 layoutStruct->y = findY(layoutStruct->y, layoutStruct, cd->size.width);-
2177 floatMargins(layoutStruct->y, layoutStruct, &left, &right);-
2178 }
never executed: end of block
0
2179-
2180 QFixedPoint pos(left, layoutStruct->y);-
2181-
2182 Qt::Alignment align = Qt::AlignLeft;-
2183-
2184 QTextTable *table = qobject_cast<QTextTable *>(c);-
2185-
2186 if (table
tableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2187 align = table->format().alignment() & Qt::AlignHorizontal_Mask;
never executed: align = table->format().alignment() & Qt::AlignHorizontal_Mask;
0
2188-
2189-
2190-
2191 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(align & Qt::AlignLeft)
!(align & Qt::AlignLeft)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2192 contentHasAlignment = true;
never executed: contentHasAlignment = true;
0
2193-
2194 cd->position = pos;-
2195-
2196 if (document->pageSize().height() > 0.0f
document->page...eight() > 0.0fDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2197 cd->sizeDirty = true;
never executed: cd->sizeDirty = true;
0
2198-
2199 if (cd->sizeDirty
cd->sizeDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2200 if (width != 0
width != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2201 layoutFrame(c, layoutFrom, layoutTo, width, -1, layoutStruct->frameY);
never executed: layoutFrame(c, layoutFrom, layoutTo, width, -1, layoutStruct->frameY);
0
2202 else-
2203 layoutFrame(c, layoutFrom, layoutTo, layoutStruct->frameY);
never executed: layoutFrame(c, layoutFrom, layoutTo, layoutStruct->frameY);
0
2204-
2205 QFixed absoluteChildPos = table
tableDescription
TRUEnever evaluated
FALSEnever evaluated
? pos.y + static_cast<QTextTableData *>(data(table))->rowPositions.at(0) : pos.y + firstChildPos(c);
0
2206 absoluteChildPos += layoutStruct->frameY;-
2207-
2208-
2209 if (absoluteChildPos > layoutStruct->pageBottom
absoluteChildP...ct->pageBottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2210 layoutStruct->newPage();-
2211 pos.y = layoutStruct->y;-
2212-
2213 cd->position = pos;-
2214 cd->sizeDirty = true;-
2215-
2216 if (width != 0
width != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2217 layoutFrame(c, layoutFrom, layoutTo, width, -1, layoutStruct->frameY);
never executed: layoutFrame(c, layoutFrom, layoutTo, width, -1, layoutStruct->frameY);
0
2218 else-
2219 layoutFrame(c, layoutFrom, layoutTo, layoutStruct->frameY);
never executed: layoutFrame(c, layoutFrom, layoutTo, layoutStruct->frameY);
0
2220 }-
2221 }
never executed: end of block
0
2222-
2223-
2224 if (right - left > cd->size.width
right - left > cd->size.widthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2225 if (align & Qt::AlignRight
align & Qt::AlignRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2226 pos.x += layoutStruct->x_right - cd->size.width;
never executed: pos.x += layoutStruct->x_right - cd->size.width;
0
2227 else if (align & Qt::AlignHCenter
align & Qt::AlignHCenterDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2228 pos.x += (layoutStruct->x_right - cd->size.width) / 2;
never executed: pos.x += (layoutStruct->x_right - cd->size.width) / 2;
0
2229 }
never executed: end of block
0
2230-
2231 cd->position = pos;-
2232-
2233 layoutStruct->y += cd->size.height;-
2234 const int page = layoutStruct->currentPage();-
2235 layoutStruct->pageBottom = (page + 1) * layoutStruct->pageHeight - layoutStruct->pageBottomMargin;-
2236-
2237 cd->layoutDirty = false;-
2238-
2239 if (c->frameFormat().pageBreakPolicy() & QTextFormat::PageBreak_AlwaysAfter
c->frameFormat...ak_AlwaysAfterDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2240 layoutStruct->newPage();
never executed: layoutStruct->newPage();
0
2241 }
never executed: end of block
else {
0
2242 QRectF oldFrameRect(cd->position.toPointF(), cd->size.toSizeF());-
2243 QRectF updateRect;-
2244-
2245 if (cd->sizeDirty
cd->sizeDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2246 updateRect = layoutFrame(c, layoutFrom, layoutTo);
never executed: updateRect = layoutFrame(c, layoutFrom, layoutTo);
0
2247-
2248 positionFloat(c);-
2249-
2250-
2251 if (cd->sizeDirty
cd->sizeDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2252 updateRect = layoutFrame(c, layoutFrom, layoutTo);
never executed: updateRect = layoutFrame(c, layoutFrom, layoutTo);
0
2253-
2254 QRectF frameRect(cd->position.toPointF(), cd->size.toSizeF());-
2255-
2256 if (frameRect == oldFrameRect
frameRect == oldFrameRectDescription
TRUEnever evaluated
FALSEnever evaluated
&& updateRect.isValid()
updateRect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2257 updateRect.translate(cd->position.toPointF());
never executed: updateRect.translate(cd->position.toPointF());
0
2258 else-
2259 updateRect = frameRect;
never executed: updateRect = frameRect;
0
2260-
2261 layoutStruct->addUpdateRectForFloat(updateRect);-
2262 if (oldFrameRect.isValid()
oldFrameRect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2263 layoutStruct->addUpdateRectForFloat(oldFrameRect);
never executed: layoutStruct->addUpdateRectForFloat(oldFrameRect);
0
2264 }
never executed: end of block
0
2265-
2266 layoutStruct->minimumWidth = qMax(layoutStruct->minimumWidth, cd->minimumWidth);-
2267 layoutStruct->maximumWidth = qMin(layoutStruct->maximumWidth, cd->maximumWidth);-
2268-
2269 previousIt = it;-
2270 ++it;-
2271 }
never executed: end of block
else {
0
2272 QTextFrame::Iterator lastIt;-
2273 if (!previousIt.atEnd()
!previousIt.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
&& previousIt != it
previousIt != itDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2274 lastIt = previousIt;
never executed: lastIt = previousIt;
0
2275 previousIt = it;-
2276 QTextBlock block = it.currentBlock();-
2277 ++it;-
2278-
2279 const QTextBlockFormat blockFormat = block.blockFormat();-
2280-
2281 if (blockFormat.pageBreakPolicy() & QTextFormat::PageBreak_AlwaysBefore
blockFormat.pa...k_AlwaysBeforeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2282 layoutStruct->newPage();
never executed: layoutStruct->newPage();
0
2283-
2284 const QFixed origY = layoutStruct->y;-
2285 const QFixed origPageBottom = layoutStruct->pageBottom;-
2286 const QFixed origMaximumWidth = layoutStruct->maximumWidth;-
2287 layoutStruct->maximumWidth = 0;-
2288-
2289 const QTextBlockFormat *previousBlockFormatPtr = 0;-
2290 if (lastIt.currentBlock().isValid()
lastIt.current...ck().isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2291 previousBlockFormatPtr = &previousBlockFormat;
never executed: previousBlockFormatPtr = &previousBlockFormat;
0
2292-
2293-
2294 layoutBlock(block, docPos, blockFormat, layoutStruct, layoutFrom, layoutTo, previousBlockFormatPtr);-
2295-
2296-
2297-
2298 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(block.layout()->textOption().alignment() & Qt::AlignLeft)
!(block.layout...Qt::AlignLeft)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2299 contentHasAlignment = true;
never executed: contentHasAlignment = true;
0
2300-
2301-
2302-
2303 if (isEmptyBlockBeforeTable(block, blockFormat, it)
isEmptyBlockBe...ockFormat, it)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2304 const QTextBlock lastBlock = lastIt.currentBlock();-
2305 const qreal lastBlockBottomMargin = lastBlock.isValid()
lastBlock.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
? lastBlock.blockFormat().bottomMargin() : 0.0f;
0
2306 layoutStruct->y = origY + QFixed::fromReal(qMax(lastBlockBottomMargin, block.blockFormat().topMargin()));-
2307 layoutStruct->pageBottom = origPageBottom;-
2308 }
never executed: end of block
else {
0
2309-
2310 if (isEmptyBlockAfterTable(block, lastIt.currentFrame())
isEmptyBlockAf...urrentFrame())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2311 QTextTableData *td = static_cast<QTextTableData *>(data(lastIt.currentFrame()));-
2312 QTextLayout *layout = block.layout();-
2313-
2314 QPointF pos((td->position.x + td->size.width).toReal(),-
2315 (td->position.y + td->size.height).toReal() - layout->boundingRect().height());-
2316-
2317 layout->setPosition(pos);-
2318 layoutStruct->y = origY;-
2319 layoutStruct->pageBottom = origPageBottom;-
2320 }
never executed: end of block
0
2321-
2322-
2323 if (isLineSeparatorBlockAfterTable(block, lastIt.currentFrame())
isLineSeparato...urrentFrame())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2324 QTextTableData *td = static_cast<QTextTableData *>(data(lastIt.currentFrame()));-
2325 QTextLayout *layout = block.layout();-
2326-
2327 QFixed height = QFixed::fromReal(layout->lineAt(0).height());-
2328-
2329 if (layoutStruct->pageBottom == origPageBottom
layoutStruct->...origPageBottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2330 layoutStruct->y -= height;-
2331 layout->setPosition(layout->position() - QPointF(0, height.toReal()));-
2332 }
never executed: end of block
else {
0
2333-
2334 layoutStruct->y = origY - height;-
2335 layoutStruct->pageBottom = origPageBottom;-
2336 layoutBlock(block, docPos, blockFormat, layoutStruct, layoutFrom, layoutTo, previousBlockFormatPtr);-
2337 }
never executed: end of block
0
2338-
2339 QPointF linePos((td->position.x + td->size.width).toReal(),-
2340 (td->position.y + td->size.height - height).toReal());-
2341-
2342 layout->lineAt(0).setPosition(linePos - layout->position());-
2343 }
never executed: end of block
0
2344-
2345 if (blockFormat.pageBreakPolicy() & QTextFormat::PageBreak_AlwaysAfter
blockFormat.pa...ak_AlwaysAfterDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2346 layoutStruct->newPage();
never executed: layoutStruct->newPage();
0
2347 }
never executed: end of block
0
2348-
2349 maximumBlockWidth = qMax(maximumBlockWidth, layoutStruct->maximumWidth);-
2350 layoutStruct->maximumWidth = origMaximumWidth;-
2351 previousBlockFormat = blockFormat;-
2352 }
never executed: end of block
0
2353 }-
2354 if (layoutStruct->maximumWidth == (2147483647/256)
layoutStruct->...147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
&& maximumBlockWidth > 0
maximumBlockWidth > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2355 layoutStruct->maximumWidth = maximumBlockWidth;
never executed: layoutStruct->maximumWidth = maximumBlockWidth;
0
2356 else-
2357 layoutStruct->maximumWidth = qMax(layoutStruct->maximumWidth, maximumBlockWidth);
never executed: layoutStruct->maximumWidth = qMax(layoutStruct->maximumWidth, maximumBlockWidth);
0
2358-
2359-
2360-
2361-
2362 if (!qobject_cast<QTextTable *>(layoutStruct->frame)
!qobject_cast<...Struct->frame)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2363 QList<QTextFrame *> children = layoutStruct->frame->childFrames();-
2364 for (int i = 0; i < children.count()
i < children.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2365 QTextFrameData *fd = data(children.at(i));-
2366 if (!fd->layoutDirty
!fd->layoutDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
&& children.at(i)->frameFormat().position() != QTextFrameFormat::InFlow
children.at(i)...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2367 layoutStruct->y = qMax(layoutStruct->y, fd->position.y + fd->size.height);
never executed: layoutStruct->y = qMax(layoutStruct->y, fd->position.y + fd->size.height);
0
2368 }
never executed: end of block
0
2369 }
never executed: end of block
0
2370-
2371 if (inRootFrame
inRootFrameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2372-
2373-
2374 if (!fd->floats.isEmpty()
!fd->floats.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2375 contentHasAlignment = true;
never executed: contentHasAlignment = true;
0
2376-
2377 if (it.atEnd()
it.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2378-
2379 currentLazyLayoutPosition = -1;-
2380 QCheckPoint cp;-
2381 cp.y = layoutStruct->y;-
2382 cp.positionInFrame = docPrivate->length();-
2383 cp.minimumWidth = layoutStruct->minimumWidth;-
2384 cp.maximumWidth = layoutStruct->maximumWidth;-
2385 cp.contentsWidth = layoutStruct->contentsWidth;-
2386 checkPoints.append(cp);-
2387 checkPoints.reserve(checkPoints.size());-
2388 }
never executed: end of block
else {
0
2389 currentLazyLayoutPosition = checkPoints.constLast().positionInFrame;-
2390-
2391-
2392 }
never executed: end of block
0
2393 }-
2394-
2395-
2396 fd->currentLayoutStruct = 0;-
2397}
never executed: end of block
0
2398-
2399static inline void getLineHeightParams(const QTextBlockFormat &blockFormat, const QTextLine &line, qreal scaling,-
2400 QFixed *lineAdjustment, QFixed *lineBreakHeight, QFixed *lineHeight)-
2401{-
2402 *lineHeight = QFixed::fromReal(blockFormat.lineHeight(line.height(), scaling));-
2403-
2404 if (blockFormat.lineHeightType() == QTextBlockFormat::FixedHeight
blockFormat.li...t::FixedHeightDescription
TRUEnever evaluated
FALSEnever evaluated
|| blockFormat.lineHeightType() == QTextBlockFormat::MinimumHeight
blockFormat.li...:MinimumHeightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2405 *lineBreakHeight = *lineHeight;-
2406 if (blockFormat.lineHeightType() == QTextBlockFormat::FixedHeight
blockFormat.li...t::FixedHeightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2407 *
never executed: *lineAdjustment = QFixed::fromReal(line.ascent() + qMax(line.leading(), qreal(0.0))) - ((*lineHeight * 4) / 5);
lineAdjustment = QFixed::fromReal(line.ascent() + qMax(line.leading(), qreal(0.0))) - ((*lineHeight * 4) / 5);
never executed: *lineAdjustment = QFixed::fromReal(line.ascent() + qMax(line.leading(), qreal(0.0))) - ((*lineHeight * 4) / 5);
0
2408 else-
2409 *
never executed: *lineAdjustment = QFixed::fromReal(line.height()) - *lineHeight;
lineAdjustment = QFixed::fromReal(line.height()) - *lineHeight;
never executed: *lineAdjustment = QFixed::fromReal(line.height()) - *lineHeight;
0
2410 }-
2411 else {-
2412 *lineBreakHeight = QFixed::fromReal(line.height());-
2413 *lineAdjustment = 0;-
2414 }
never executed: end of block
0
2415}-
2416-
2417void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosition, const QTextBlockFormat &blockFormat,-
2418 QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat)-
2419{-
2420 QTextDocumentLayout * const q = q_func();-
2421 if (!bl.isVisible()
!bl.isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2422 return;
never executed: return;
0
2423-
2424 QTextLayout *tl = bl.layout();-
2425 const int blockLength = bl.length();-
2426-
2427 if(0) QMessageLogger(__FILE__, 2595, __PRETTY_FUNCTION__).debug() << "layoutBlock from=" << layoutFrom << "to=" << layoutTo;
dead code: QMessageLogger(__FILE__, 2595, __PRETTY_FUNCTION__).debug() << "layoutBlock from=" << layoutFrom << "to=" << layoutTo;
-
2428-
2429-
2430-
2431 if (previousBlockFormat
previousBlockFormatDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2432 qreal margin = qMax(blockFormat.topMargin(), previousBlockFormat->bottomMargin());-
2433 if (margin > 0
margin > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& q->paintDevice()
q->paintDevice()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2434 margin *= qreal(q->paintDevice()->logicalDpiY()) / qreal(qt_defaultDpi());-
2435 }
never executed: end of block
0
2436 layoutStruct->y += QFixed::fromReal(margin);-
2437 }
never executed: end of block
0
2438-
2439-
2440-
2441 Qt::LayoutDirection dir = bl.textDirection();-
2442-
2443 QFixed extraMargin;-
2444 if (docPrivate->defaultTextOption.flags() & QTextOption::AddSpaceForLineAndParagraphSeparators
docPrivate->de...raphSeparatorsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2445 QFontMetricsF fm(bl.charFormat().font());-
2446 extraMargin = QFixed::fromReal(fm.width(QChar(QChar(0x21B5))));-
2447 }
never executed: end of block
0
2448-
2449 const QFixed indent = this->blockIndent(blockFormat);-
2450 const QFixed totalLeftMargin = QFixed::fromReal(blockFormat.leftMargin()) + (dir == Qt::RightToLeft
dir == Qt::RightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
? extraMargin : indent);
0
2451 const QFixed totalRightMargin = QFixed::fromReal(blockFormat.rightMargin()) + (dir == Qt::RightToLeft
dir == Qt::RightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
? indent : extraMargin);
0
2452-
2453 const QPointF oldPosition = tl->position();-
2454 tl->setPosition(QPointF(layoutStruct->x_left.toReal(), layoutStruct->y.toReal()));-
2455-
2456 if (layoutStruct->fullLayout
layoutStruct->fullLayoutDescription
TRUEnever evaluated
FALSEnever evaluated
0
2457 || (blockPosition + blockLength > layoutFrom
blockPosition ...h > layoutFromDescription
TRUEnever evaluated
FALSEnever evaluated
&& blockPosition <= layoutTo
blockPosition <= layoutToDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2458-
2459 || (layoutStruct->pageHeight != (2147483647/256)
layoutStruct->...147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
&& layoutStruct->absoluteY() + QFixed::fromReal(tl->boundingRect().height()) > layoutStruct->pageBottom
layoutStruct->...ct->pageBottomDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2460-
2461 if(0) QMessageLogger(__FILE__, 2629, __PRETTY_FUNCTION__).debug() << " do layout";
dead code: QMessageLogger(__FILE__, 2629, __PRETTY_FUNCTION__).debug() << " do layout";
-
2462 QTextOption option = docPrivate->defaultTextOption;-
2463 option.setTextDirection(dir);-
2464 option.setTabs( blockFormat.tabPositions() );-
2465-
2466 Qt::Alignment align = docPrivate->defaultTextOption.alignment();-
2467 if (blockFormat.hasProperty(QTextFormat::BlockAlignment)
blockFormat.ha...lockAlignment)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2468 align = blockFormat.alignment();
never executed: align = blockFormat.alignment();
0
2469 option.setAlignment(QGuiApplicationPrivate::visualAlignment(dir, align));-
2470-
2471 if (blockFormat.nonBreakableLines()
blockFormat.no...eakableLines()Description
TRUEnever evaluated
FALSEnever evaluated
|| document->pageSize().width() < 0
document->page...().width() < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2472 option.setWrapMode(QTextOption::ManualWrap);-
2473 }
never executed: end of block
0
2474-
2475 tl->setTextOption(option);-
2476-
2477 const bool haveWordOrAnyWrapMode = (option.wrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);-
2478-
2479-
2480 const QFixed cy = layoutStruct->y;-
2481 const QFixed l = layoutStruct->x_left + totalLeftMargin;-
2482 const QFixed r = layoutStruct->x_right - totalRightMargin;-
2483-
2484 tl->beginLayout();-
2485 bool firstLine = true;-
2486 while (1) {-
2487 QTextLine line = tl->createLine();-
2488 if (!line.isValid()
!line.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2489 break;
never executed: break;
0
2490 line.setLeadingIncluded(true);-
2491-
2492 QFixed left, right;-
2493 floatMargins(layoutStruct->y, layoutStruct, &left, &right);-
2494 left = qMax(left, l);-
2495 right = qMin(right, r);-
2496 QFixed text_indent;-
2497 if (firstLine
firstLineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2498 text_indent = QFixed::fromReal(blockFormat.textIndent());-
2499 if (dir == Qt::LeftToRight
dir == Qt::LeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2500 left += text_indent;
never executed: left += text_indent;
0
2501 else-
2502 right -= text_indent;
never executed: right -= text_indent;
0
2503 firstLine = false;-
2504 }
never executed: end of block
0
2505-
2506-
2507 if (fixedColumnWidth != -1
fixedColumnWidth != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2508 line.setNumColumns(fixedColumnWidth, (right - left).toReal());
never executed: line.setNumColumns(fixedColumnWidth, (right - left).toReal());
0
2509 else-
2510 line.setLineWidth((right - left).toReal());
never executed: line.setLineWidth((right - left).toReal());
0
2511-
2512-
2513 floatMargins(layoutStruct->y, layoutStruct, &left, &right);-
2514 left = qMax(left, l);-
2515 right = qMin(right, r);-
2516 if (dir == Qt::LeftToRight
dir == Qt::LeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2517 left += text_indent;
never executed: left += text_indent;
0
2518 else-
2519 right -= text_indent;
never executed: right -= text_indent;
0
2520-
2521 if (fixedColumnWidth == -1
fixedColumnWidth == -1Description
TRUEnever evaluated
FALSEnever evaluated
&& QFixed::fromReal(line.naturalTextWidth()) > right-left
QFixed::fromRe...) > right-leftDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2522-
2523 layoutStruct->pendingFloats.clear();-
2524-
2525 line.setLineWidth((right-left).toReal());-
2526 if (QFixed::fromReal(line.naturalTextWidth()) > right-left
QFixed::fromRe...) > right-leftDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2527 if (haveWordOrAnyWrapMode
haveWordOrAnyWrapModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2528 option.setWrapMode(QTextOption::WrapAnywhere);-
2529 tl->setTextOption(option);-
2530 }
never executed: end of block
0
2531-
2532 layoutStruct->pendingFloats.clear();-
2533-
2534 layoutStruct->y = findY(layoutStruct->y, layoutStruct, QFixed::fromReal(line.naturalTextWidth()));-
2535 floatMargins(layoutStruct->y, layoutStruct, &left, &right);-
2536 left = qMax(left, l);-
2537 right = qMin(right, r);-
2538 if (dir == Qt::LeftToRight
dir == Qt::LeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2539 left += text_indent;
never executed: left += text_indent;
0
2540 else-
2541 right -= text_indent;
never executed: right -= text_indent;
0
2542 line.setLineWidth(qMax<qreal>(line.naturalTextWidth(), (right-left).toReal()));-
2543-
2544 if (haveWordOrAnyWrapMode
haveWordOrAnyWrapModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2545 option.setWrapMode(QTextOption::WordWrap);-
2546 tl->setTextOption(option);-
2547 }
never executed: end of block
0
2548 }
never executed: end of block
0
2549-
2550 }
never executed: end of block
0
2551-
2552 QFixed lineBreakHeight, lineHeight, lineAdjustment;-
2553 qreal scaling = (q->paintDevice()
q->paintDevice()Description
TRUEnever evaluated
FALSEnever evaluated
&& q->paintDevice()->logicalDpiY() != qt_defaultDpi()
q->paintDevice...t_defaultDpi()Description
TRUEnever evaluated
FALSEnever evaluated
) ?
0
2554 qreal(q->paintDevice()->logicalDpiY()) / qreal(qt_defaultDpi()) : 1;-
2555 getLineHeightParams(blockFormat, line, scaling, &lineAdjustment, &lineBreakHeight, &lineHeight);-
2556-
2557 if (layoutStruct->pageHeight > 0
layoutStruct->pageHeight > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& layoutStruct->absoluteY() + lineBreakHeight > layoutStruct->pageBottom
layoutStruct->...ct->pageBottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2558 layoutStruct->newPage();-
2559-
2560 floatMargins(layoutStruct->y, layoutStruct, &left, &right);-
2561 left = qMax(left, l);-
2562 right = qMin(right, r);-
2563 if (dir == Qt::LeftToRight
dir == Qt::LeftToRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2564 left += text_indent;
never executed: left += text_indent;
0
2565 else-
2566 right -= text_indent;
never executed: right -= text_indent;
0
2567 }-
2568-
2569 line.setPosition(QPointF((left - layoutStruct->x_left).toReal(), (layoutStruct->y - cy - lineAdjustment).toReal()));-
2570 layoutStruct->y += lineHeight;-
2571 layoutStruct->contentsWidth-
2572 = qMax<QFixed>(layoutStruct->contentsWidth, QFixed::fromReal(line.x() + line.naturalTextWidth()) + totalRightMargin);-
2573-
2574-
2575 for (int i = 0; i < layoutStruct->pendingFloats.size()
i < layoutStru...gFloats.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2576 QTextFrame *f = layoutStruct->pendingFloats.at(i);-
2577 positionFloat(f);-
2578 }
never executed: end of block
0
2579 layoutStruct->pendingFloats.clear();-
2580 }
never executed: end of block
0
2581 tl->endLayout();-
2582 }
never executed: end of block
else {
0
2583 const int cnt = tl->lineCount();-
2584 for (int i = 0; i < cnt
i < cntDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2585 if(0) QMessageLogger(__FILE__, 2753, __PRETTY_FUNCTION__).debug() << "going to move text line" << i;
dead code: QMessageLogger(__FILE__, 2753, __PRETTY_FUNCTION__).debug() << "going to move text line" << i;
-
2586 QTextLine line = tl->lineAt(i);-
2587 layoutStruct->contentsWidth-
2588 = qMax(layoutStruct->contentsWidth, QFixed::fromReal(line.x() + tl->lineAt(i).naturalTextWidth()) + totalRightMargin);-
2589-
2590 QFixed lineBreakHeight, lineHeight, lineAdjustment;-
2591 qreal scaling = (q->paintDevice()
q->paintDevice()Description
TRUEnever evaluated
FALSEnever evaluated
&& q->paintDevice()->logicalDpiY() != qt_defaultDpi()
q->paintDevice...t_defaultDpi()Description
TRUEnever evaluated
FALSEnever evaluated
) ?
0
2592 qreal(q->paintDevice()->logicalDpiY()) / qreal(qt_defaultDpi()) : 1;-
2593 getLineHeightParams(blockFormat, line, scaling, &lineAdjustment, &lineBreakHeight, &lineHeight);-
2594-
2595 if (layoutStruct->pageHeight != (2147483647/256)
layoutStruct->...147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2596 if (layoutStruct->absoluteY() + lineBreakHeight > layoutStruct->pageBottom
layoutStruct->...ct->pageBottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2597 layoutStruct->newPage();
never executed: layoutStruct->newPage();
0
2598 line.setPosition(QPointF(line.position().x(), (layoutStruct->y - lineAdjustment).toReal() - tl->position().y()));-
2599 }
never executed: end of block
0
2600 layoutStruct->y += lineHeight;-
2601 }
never executed: end of block
0
2602 if (layoutStruct->updateRect.isValid()
layoutStruct->...Rect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
2603 && blockLength > 1
blockLength > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2604 if (layoutFrom >= blockPosition + blockLength
layoutFrom >= ... + blockLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2605-
2606-
2607-
2608 layoutStruct->updateRect.setTop(qMax(layoutStruct->updateRect.top(), layoutStruct->y.toReal()));-
2609 }
never executed: end of block
else if (layoutTo < blockPosition
layoutTo < blockPositionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2610 if (oldPosition == tl->position()
oldPosition == tl->position()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2611-
2612-
2613-
2614-
2615 layoutStruct->updateRect.setBottom(qMin(layoutStruct->updateRect.bottom(), tl->position().y()));
never executed: layoutStruct->updateRect.setBottom(qMin(layoutStruct->updateRect.bottom(), tl->position().y()));
0
2616 else-
2617 layoutStruct->updateRect.setBottom(qreal(2147483647));
never executed: layoutStruct->updateRect.setBottom(qreal(2147483647));
0
2618 }-
2619 }
never executed: end of block
0
2620 }
never executed: end of block
0
2621-
2622-
2623 const QFixed margins = totalLeftMargin + totalRightMargin;-
2624 layoutStruct->minimumWidth = qMax(layoutStruct->minimumWidth, QFixed::fromReal(tl->minimumWidth()) + margins);-
2625-
2626 const QFixed maxW = QFixed::fromReal(tl->maximumWidth()) + margins;-
2627-
2628 if (maxW > 0
maxW > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2629 if (layoutStruct->maximumWidth == (2147483647/256)
layoutStruct->...147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2630 layoutStruct->maximumWidth = maxW;
never executed: layoutStruct->maximumWidth = maxW;
0
2631 else-
2632 layoutStruct->maximumWidth = qMax(layoutStruct->maximumWidth, maxW);
never executed: layoutStruct->maximumWidth = qMax(layoutStruct->maximumWidth, maxW);
0
2633 }-
2634}
never executed: end of block
0
2635-
2636void QTextDocumentLayoutPrivate::floatMargins(const QFixed &y, const QTextLayoutStruct *layoutStruct,-
2637 QFixed *left, QFixed *right) const-
2638{-
2639-
2640 *left = layoutStruct->x_left;-
2641 *right = layoutStruct->x_right;-
2642 QTextFrameData *lfd = data(layoutStruct->frame);-
2643 for (int i = 0; i < lfd->floats.size()
i < lfd->floats.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2644 QTextFrameData *fd = data(lfd->floats.at(i));-
2645 if (!fd->layoutDirty
!fd->layoutDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2646 if (fd->position.y <= y
fd->position.y <= yDescription
TRUEnever evaluated
FALSEnever evaluated
&& fd->position.y + fd->size.height > y
fd->position.y...ize.height > yDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2647-
2648 if (lfd->floats.at(i)->frameFormat().position() == QTextFrameFormat::FloatLeft
lfd->floats.at...mat::FloatLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2649 *
never executed: *left = qMax(*left, fd->position.x + fd->size.width);
left = qMax(*left, fd->position.x + fd->size.width);
never executed: *left = qMax(*left, fd->position.x + fd->size.width);
0
2650 else-
2651 *
never executed: *right = qMin(*right, fd->position.x);
right = qMin(*right, fd->position.x);
never executed: *right = qMin(*right, fd->position.x);
0
2652 }-
2653 }
never executed: end of block
0
2654 }
never executed: end of block
0
2655-
2656}
never executed: end of block
0
2657-
2658QFixed QTextDocumentLayoutPrivate::findY(QFixed yFrom, const QTextLayoutStruct *layoutStruct, QFixed requiredWidth) const-
2659{-
2660 QFixed right, left;-
2661 requiredWidth = qMin(requiredWidth, layoutStruct->x_right - layoutStruct->x_left);-
2662-
2663-
2664 while (1) {-
2665 floatMargins(yFrom, layoutStruct, &left, &right);-
2666-
2667 if (right-left >= requiredWidth
right-left >= requiredWidthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2668 break;
never executed: break;
0
2669-
2670-
2671 QFixed newY = (2147483647/256);-
2672 QTextFrameData *lfd = data(layoutStruct->frame);-
2673 for (int i = 0; i < lfd->floats.size()
i < lfd->floats.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2674 QTextFrameData *fd = data(lfd->floats.at(i));-
2675 if (!fd->layoutDirty
!fd->layoutDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2676 if (fd->position.y <= yFrom
fd->position.y <= yFromDescription
TRUEnever evaluated
FALSEnever evaluated
&& fd->position.y + fd->size.height > yFrom
fd->position.y...height > yFromDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2677 newY = qMin(newY, fd->position.y + fd->size.height);
never executed: newY = qMin(newY, fd->position.y + fd->size.height);
0
2678 }
never executed: end of block
0
2679 }
never executed: end of block
0
2680 if (newY == (2147483647/256)
newY == (2147483647/256)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2681 break;
never executed: break;
0
2682 yFrom = newY;-
2683 }
never executed: end of block
0
2684 return
never executed: return yFrom;
yFrom;
never executed: return yFrom;
0
2685}-
2686-
2687QTextDocumentLayout::QTextDocumentLayout(QTextDocument *doc)-
2688 : QAbstractTextDocumentLayout(*new QTextDocumentLayoutPrivate, doc)-
2689{-
2690 registerHandler(QTextFormat::ImageObject, new QTextImageHandler(this));-
2691}
never executed: end of block
0
2692-
2693-
2694void QTextDocumentLayout::draw(QPainter *painter, const PaintContext &context)-
2695{-
2696 QTextDocumentLayoutPrivate * const d = d_func();-
2697 QTextFrame *frame = d->document->rootFrame();-
2698 QTextFrameData *fd = data(frame);-
2699-
2700 if(fd->sizeDirty
fd->sizeDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2701 return;
never executed: return;
0
2702-
2703 if (context.clip.isValid()
context.clip.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2704 d->ensureLayouted(QFixed::fromReal(context.clip.bottom()));-
2705 }
never executed: end of block
else {
0
2706 d->ensureLayoutFinished();-
2707 }
never executed: end of block
0
2708-
2709 QFixed width = fd->size.width;-
2710 if (d->document->pageSize().width() == 0
d->document->p...).width() == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& d->viewportRect.isValid()
d->viewportRect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2711-
2712-
2713 fd->size.width = qMax(width, QFixed::fromReal(d->viewportRect.right()));-
2714 }
never executed: end of block
0
2715-
2716-
2717 d->clipRect = QRectF(fd->position.toPointF(), fd->size.toSizeF()).adjusted(fd->leftMargin.toReal(), 0, -fd->rightMargin.toReal(), 0);-
2718 d->drawFrame(QPointF(), painter, context, frame);-
2719 fd->size.width = width;-
2720}
never executed: end of block
0
2721-
2722void QTextDocumentLayout::setViewport(const QRectF &viewport)-
2723{-
2724 QTextDocumentLayoutPrivate * const d = d_func();-
2725 d->viewportRect = viewport;-
2726}
never executed: end of block
0
2727-
2728static void markFrames(QTextFrame *current, int from, int oldLength, int length)-
2729{-
2730 int end = qMax(oldLength, length) + from;-
2731-
2732 if (current->firstPosition() >= end
current->first...ition() >= endDescription
TRUEnever evaluated
FALSEnever evaluated
|| current->lastPosition() < from
current->lastPosition() < fromDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2733 return;
never executed: return;
0
2734-
2735 QTextFrameData *fd = data(current);-
2736-
2737 QTextFrame *null = nullptr;-
2738-
2739-
2740 fd->floats.erase(std::remove(fd->floats.begin(), fd->floats.end(), null),-
2741 fd->floats.end());-
2742-
2743 fd->layoutDirty = true;-
2744 fd->sizeDirty = true;-
2745-
2746-
2747 QList<QTextFrame *> children = current->childFrames();-
2748 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2749 markFrames(children.at(i), from, oldLength, length);
never executed: markFrames(children.at(i), from, oldLength, length);
0
2750}
never executed: end of block
0
2751-
2752void QTextDocumentLayout::documentChanged(int from, int oldLength, int length)-
2753{-
2754 QTextDocumentLayoutPrivate * const d = d_func();-
2755-
2756 QTextBlock startIt = document()->findBlock(from);-
2757 QTextBlock endIt = document()->findBlock(qMax(0, from + length - 1));-
2758 if (endIt.isValid()
endIt.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2759 endIt = endIt.next();
never executed: endIt = endIt.next();
0
2760 for (QTextBlock blockIt = startIt; blockIt.isValid()
blockIt.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& blockIt != endIt
blockIt != endItDescription
TRUEnever evaluated
FALSEnever evaluated
; blockIt = blockIt.next())
0
2761 blockIt.clearLayout();
never executed: blockIt.clearLayout();
0
2762-
2763 if (d->docPrivate->pageSize.isNull()
d->docPrivate-...eSize.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2764 return;
never executed: return;
0
2765-
2766 QRectF updateRect;-
2767-
2768 d->lazyLayoutStepSize = 1000;-
2769 d->sizeChangedTimer.stop();-
2770 d->insideDocumentChange = true;-
2771-
2772 const int documentLength = d->docPrivate->length();-
2773 const bool fullLayout = (oldLength == 0
oldLength == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& length == documentLength
length == documentLengthDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
2774 const bool smallChange = documentLength > 0
documentLength > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2775 && (
(qMax(length, ...entLength) < 5Description
TRUEnever evaluated
FALSEnever evaluated
qMax(length, oldLength) * 100 / documentLength) < 5
(qMax(length, ...entLength) < 5Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2776-
2777-
2778-
2779-
2780-
2781 if (smallChange
smallChangeDescription
TRUEnever evaluated
FALSEnever evaluated
0
2782 && (d->currentLazyLayoutPosition == -1
d->currentLazy...Position == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| d->showLayoutProgress == false
d->showLayoutProgress == falseDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
2783 d->showLayoutProgress = false;
never executed: d->showLayoutProgress = false;
0
2784 else-
2785 d->showLayoutProgress = true;
never executed: d->showLayoutProgress = true;
0
2786-
2787 if (fullLayout
fullLayoutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2788 d->contentHasAlignment = false;-
2789 d->currentLazyLayoutPosition = 0;-
2790 d->checkPoints.clear();-
2791 d->layoutStep();-
2792 }
never executed: end of block
else {
0
2793 d->ensureLayoutedByPosition(from);-
2794 updateRect = doLayout(from, oldLength, length);-
2795 }
never executed: end of block
0
2796-
2797 if (!d->layoutTimer.isActive()
!d->layoutTimer.isActive()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->currentLazyLayoutPosition != -1
d->currentLazy...Position != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2798 d->layoutTimer.start(10, this);
never executed: d->layoutTimer.start(10, this);
0
2799-
2800 d->insideDocumentChange = false;-
2801-
2802 for (QTextBlock blockIt = startIt; blockIt.isValid()
blockIt.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& blockIt != endIt
blockIt != endItDescription
TRUEnever evaluated
FALSEnever evaluated
; blockIt = blockIt.next())
0
2803 updateBlock(blockIt);
never executed: updateBlock(blockIt);
0
2804-
2805 if (d->showLayoutProgress
d->showLayoutProgressDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2806 const QSizeF newSize = dynamicDocumentSize();-
2807 if (newSize != d->lastReportedSize
newSize != d->lastReportedSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2808 d->lastReportedSize = newSize;-
2809 documentSizeChanged(newSize);-
2810 }
never executed: end of block
0
2811 }
never executed: end of block
0
2812-
2813 if (!updateRect.isValid()
!updateRect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2814-
2815 updateRect = QRectF(QPointF(0, 0), QSizeF(qreal(2147483647), qreal(2147483647)));-
2816 }
never executed: end of block
0
2817-
2818 update(updateRect);-
2819}
never executed: end of block
0
2820-
2821QRectF QTextDocumentLayout::doLayout(int from, int oldLength, int length)-
2822{-
2823 QTextDocumentLayoutPrivate * const d = d_func();-
2824-
2825-
2826-
2827-
2828 markFrames(d->docPrivate->rootFrame(), from, oldLength, length);-
2829-
2830 QRectF updateRect;-
2831-
2832 QTextFrame *root = d->docPrivate->rootFrame();-
2833 if(data(root)->sizeDirty
data(root)->sizeDirtyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2834 updateRect = d->layoutFrame(root, from, from + length);
never executed: updateRect = d->layoutFrame(root, from, from + length);
0
2835 data(root)->layoutDirty = false;-
2836-
2837 if (d->currentLazyLayoutPosition == -1
d->currentLazy...Position == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2838 layoutFinished();
never executed: layoutFinished();
0
2839 else if (d->showLayoutProgress
d->showLayoutProgressDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2840 d->sizeChangedTimer.start(0, this);
never executed: d->sizeChangedTimer.start(0, this);
0
2841-
2842 return
never executed: return updateRect;
updateRect;
never executed: return updateRect;
0
2843}-
2844-
2845int QTextDocumentLayout::hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const-
2846{-
2847 const QTextDocumentLayoutPrivate * const d = d_func();-
2848 d->ensureLayouted(QFixed::fromReal(point.y()));-
2849 QTextFrame *f = d->docPrivate->rootFrame();-
2850 int position = 0;-
2851 QTextLayout *l = 0;-
2852 QFixedPoint pointf;-
2853 pointf.x = QFixed::fromReal(point.x());-
2854 pointf.y = QFixed::fromReal(point.y());-
2855 QTextDocumentLayoutPrivate::HitPoint p = d->hitTest(f, pointf, &position, &l, accuracy);-
2856 if (accuracy == Qt::ExactHit
accuracy == Qt::ExactHitDescription
TRUEnever evaluated
FALSEnever evaluated
&& p < QTextDocumentLayoutPrivate::PointExact
p < QTextDocum...te::PointExactDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2857 return
never executed: return -1;
-1;
never executed: return -1;
0
2858-
2859-
2860 int lastPos = f->lastPosition();-
2861 if (l
lDescription
TRUEnever evaluated
FALSEnever evaluated
&& !l->preeditAreaText().isEmpty()
!l->preeditAre...xt().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2862 lastPos += l->preeditAreaText().length();
never executed: lastPos += l->preeditAreaText().length();
0
2863 if (position > lastPos
position > lastPosDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2864 position = lastPos;
never executed: position = lastPos;
0
2865 else if (position < 0
position < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2866 position = 0;
never executed: position = 0;
0
2867-
2868 return
never executed: return position;
position;
never executed: return position;
0
2869}-
2870-
2871void QTextDocumentLayout::resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format)-
2872{-
2873 QTextDocumentLayoutPrivate * const d = d_func();-
2874 QTextCharFormat f = format.toCharFormat();-
2875 ((!(f.isValid())) ? qt_assert("f.isValid()",__FILE__,3043) : qt_noop());-
2876 QTextObjectHandler handler = d->handlers.value(f.objectType());-
2877 if (!handler.component
!handler.componentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2878 return;
never executed: return;
0
2879-
2880 QSizeF intrinsic = handler.iface->intrinsicSize(d->document, posInDocument, format);-
2881-
2882 QTextFrameFormat::Position pos = QTextFrameFormat::InFlow;-
2883 QTextFrame *frame = qobject_cast<QTextFrame *>(d->document->objectForFormat(f));-
2884 if (frame
frameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2885 pos = frame->frameFormat().position();-
2886 QTextFrameData *fd = data(frame);-
2887 fd->sizeDirty = false;-
2888 fd->size = QFixedSize::fromSizeF(intrinsic);-
2889 fd->minimumWidth = fd->maximumWidth = fd->size.width;-
2890 }
never executed: end of block
0
2891-
2892 QSizeF inlineSize = (pos == QTextFrameFormat::InFlow
pos == QTextFr...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
? intrinsic : QSizeF(0, 0));
0
2893 item.setWidth(inlineSize.width());-
2894-
2895 QFontMetrics m(f.font());-
2896 switch (f.verticalAlignment())-
2897 {-
2898 case
never executed: case QTextCharFormat::AlignMiddle:
QTextCharFormat::AlignMiddle:
never executed: case QTextCharFormat::AlignMiddle:
0
2899 item.setDescent(inlineSize.height() / 2);-
2900 item.setAscent(inlineSize.height() / 2);-
2901 break;
never executed: break;
0
2902 case
never executed: case QTextCharFormat::AlignBaseline:
QTextCharFormat::AlignBaseline:
never executed: case QTextCharFormat::AlignBaseline:
0
2903 item.setDescent(m.descent());-
2904 item.setAscent(inlineSize.height() - m.descent());-
2905 break;
never executed: break;
0
2906 default
never executed: default:
:
never executed: default:
0
2907 item.setDescent(0);-
2908 item.setAscent(inlineSize.height());-
2909 }
never executed: end of block
0
2910}-
2911-
2912void QTextDocumentLayout::positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format)-
2913{-
2914 QTextDocumentLayoutPrivate * const d = d_func();-
2915 (void)posInDocument;;-
2916 if (item.width() != 0
item.width() != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2917-
2918 return;
never executed: return;
0
2919-
2920 QTextCharFormat f = format.toCharFormat();-
2921 ((!(f.isValid())) ? qt_assert("f.isValid()",__FILE__,3089) : qt_noop());-
2922 QTextObjectHandler handler = d->handlers.value(f.objectType());-
2923 if (!handler.component
!handler.componentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2924 return;
never executed: return;
0
2925-
2926 QTextFrame *frame = qobject_cast<QTextFrame *>(d->document->objectForFormat(f));-
2927 if (!frame
!frameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2928 return;
never executed: return;
0
2929-
2930 QTextBlock b = d->document->findBlock(frame->firstPosition());-
2931 QTextLine line;-
2932 if (b.position() <= frame->firstPosition()
b.position() <...irstPosition()Description
TRUEnever evaluated
FALSEnever evaluated
&& b.position() + b.length() > frame->lastPosition()
b.position() +...lastPosition()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2933 line = b.layout()->lineAt(b.layout()->lineCount()-1);
never executed: line = b.layout()->lineAt(b.layout()->lineCount()-1);
0
2934-
2935-
2936 d->positionFloat(frame, line.isValid() ? &line : 0);-
2937}
never executed: end of block
0
2938-
2939void QTextDocumentLayout::drawInlineObject(QPainter *p, const QRectF &rect, QTextInlineObject item,-
2940 int posInDocument, const QTextFormat &format)-
2941{-
2942 QTextDocumentLayoutPrivate * const d = d_func();-
2943 QTextCharFormat f = format.toCharFormat();-
2944 ((!(f.isValid())) ? qt_assert("f.isValid()",__FILE__,3112) : qt_noop());-
2945 QTextFrame *frame = qobject_cast<QTextFrame *>(d->document->objectForFormat(f));-
2946 if (frame
frameDescription
TRUEnever evaluated
FALSEnever evaluated
&& frame->frameFormat().position() != QTextFrameFormat::InFlow
frame->frameFo...Format::InFlowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2947 return;
never executed: return;
0
2948-
2949-
2950 QAbstractTextDocumentLayout::drawInlineObject(p, rect, item, posInDocument, format);-
2951}
never executed: end of block
0
2952-
2953int QTextDocumentLayout::dynamicPageCount() const-
2954{-
2955 const QTextDocumentLayoutPrivate * const d = d_func();-
2956 const QSizeF pgSize = d->document->pageSize();-
2957 if (pgSize.height() < 0
pgSize.height() < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2958 return
never executed: return 1;
1;
never executed: return 1;
0
2959 return
never executed: return qCeil(dynamicDocumentSize().height() / pgSize.height());
qCeil(dynamicDocumentSize().height() / pgSize.height());
never executed: return qCeil(dynamicDocumentSize().height() / pgSize.height());
0
2960}-
2961-
2962QSizeF QTextDocumentLayout::dynamicDocumentSize() const-
2963{-
2964 const QTextDocumentLayoutPrivate * const d = d_func();-
2965 return
never executed: return data(d->docPrivate->rootFrame())->size.toSizeF();
data(d->docPrivate->rootFrame())->size.toSizeF();
never executed: return data(d->docPrivate->rootFrame())->size.toSizeF();
0
2966}-
2967-
2968int QTextDocumentLayout::pageCount() const-
2969{-
2970 const QTextDocumentLayoutPrivate * const d = d_func();-
2971 d->ensureLayoutFinished();-
2972 return
never executed: return dynamicPageCount();
dynamicPageCount();
never executed: return dynamicPageCount();
0
2973}-
2974-
2975QSizeF QTextDocumentLayout::documentSize() const-
2976{-
2977 const QTextDocumentLayoutPrivate * const d = d_func();-
2978 d->ensureLayoutFinished();-
2979 return
never executed: return dynamicDocumentSize();
dynamicDocumentSize();
never executed: return dynamicDocumentSize();
0
2980}-
2981-
2982void QTextDocumentLayoutPrivate::ensureLayouted(QFixed y) const-
2983{-
2984 const QTextDocumentLayout * const q = q_func();-
2985 if (currentLazyLayoutPosition == -1
currentLazyLay...Position == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2986 return;
never executed: return;
0
2987 const QSizeF oldSize = q->dynamicDocumentSize();-
2988 (void)oldSize;;-
2989-
2990 if (checkPoints.isEmpty()
checkPoints.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2991 layoutStep();
never executed: layoutStep();
0
2992-
2993 while (currentLazyLayoutPosition != -1
currentLazyLay...Position != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
2994 && checkPoints.last().y < y
checkPoints.last().y < yDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2995 layoutStep();
never executed: layoutStep();
0
2996}
never executed: end of block
0
2997-
2998void QTextDocumentLayoutPrivate::ensureLayoutedByPosition(int position) const-
2999{-
3000 if (currentLazyLayoutPosition == -1
currentLazyLay...Position == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3001 return;
never executed: return;
0
3002 if (position < currentLazyLayoutPosition
position < cur...LayoutPositionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3003 return;
never executed: return;
0
3004 while (currentLazyLayoutPosition != -1
currentLazyLay...Position != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
3005 && currentLazyLayoutPosition < position
currentLazyLay...ion < positionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3006 const_cast<QTextDocumentLayout *>(q_func())->doLayout(currentLazyLayoutPosition, 0, 2147483647 - currentLazyLayoutPosition);-
3007 }
never executed: end of block
0
3008}
never executed: end of block
0
3009-
3010void QTextDocumentLayoutPrivate::layoutStep() const-
3011{-
3012 ensureLayoutedByPosition(currentLazyLayoutPosition + lazyLayoutStepSize);-
3013 lazyLayoutStepSize = qMin(200000, lazyLayoutStepSize * 2);-
3014}
never executed: end of block
0
3015-
3016void QTextDocumentLayout::setCursorWidth(int width)-
3017{-
3018 QTextDocumentLayoutPrivate * const d = d_func();-
3019 d->cursorWidth = width;-
3020}
never executed: end of block
0
3021-
3022int QTextDocumentLayout::cursorWidth() const-
3023{-
3024 const QTextDocumentLayoutPrivate * const d = d_func();-
3025 return
never executed: return d->cursorWidth;
d->cursorWidth;
never executed: return d->cursorWidth;
0
3026}-
3027-
3028void QTextDocumentLayout::setFixedColumnWidth(int width)-
3029{-
3030 QTextDocumentLayoutPrivate * const d = d_func();-
3031 d->fixedColumnWidth = width;-
3032}
never executed: end of block
0
3033-
3034QRectF QTextDocumentLayout::tableCellBoundingRect(QTextTable *table, const QTextTableCell &cell) const-
3035{-
3036 if (!cell.isValid()
!cell.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3037 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
3038-
3039 QTextTableData *td = static_cast<QTextTableData *>(data(table));-
3040-
3041 QRectF tableRect = tableBoundingRect(table);-
3042 QRectF cellRect = td->cellRect(cell);-
3043-
3044 return
never executed: return cellRect.translated(tableRect.topLeft());
cellRect.translated(tableRect.topLeft());
never executed: return cellRect.translated(tableRect.topLeft());
0
3045}-
3046-
3047QRectF QTextDocumentLayout::tableBoundingRect(QTextTable *table) const-
3048{-
3049 const QTextDocumentLayoutPrivate * const d = d_func();-
3050 if (d->docPrivate->pageSize.isNull()
d->docPrivate-...eSize.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3051 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
3052 d->ensureLayoutFinished();-
3053-
3054 QPointF pos;-
3055 const int framePos = table->firstPosition();-
3056 QTextFrame *f = table;-
3057 while (f
fDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3058 QTextFrameData *fd = data(f);-
3059 pos += fd->position.toPointF();-
3060-
3061 if (f != table
f != tableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3062 if (QTextTable *table = qobject_cast<QTextTable *>(f)
QTextTable *ta...extTable *>(f)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3063 QTextTableCell cell = table->cellAt(framePos);-
3064 if (cell.isValid()
cell.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3065 pos += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
never executed: pos += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
0
3066 }
never executed: end of block
0
3067 }
never executed: end of block
0
3068-
3069 f = f->parentFrame();-
3070 }
never executed: end of block
0
3071 return
never executed: return QRectF(pos, data(table)->size.toSizeF());
QRectF(pos, data(table)->size.toSizeF());
never executed: return QRectF(pos, data(table)->size.toSizeF());
0
3072}-
3073-
3074QRectF QTextDocumentLayout::frameBoundingRect(QTextFrame *frame) const-
3075{-
3076 const QTextDocumentLayoutPrivate * const d = d_func();-
3077 if (d->docPrivate->pageSize.isNull()
d->docPrivate-...eSize.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3078 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
3079 d->ensureLayoutFinished();-
3080 return
never executed: return d->frameBoundingRectInternal(frame);
d->frameBoundingRectInternal(frame);
never executed: return d->frameBoundingRectInternal(frame);
0
3081}-
3082-
3083QRectF QTextDocumentLayoutPrivate::frameBoundingRectInternal(QTextFrame *frame) const-
3084{-
3085 QPointF pos;-
3086 const int framePos = frame->firstPosition();-
3087 QTextFrame *f = frame;-
3088 while (f
fDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3089 QTextFrameData *fd = data(f);-
3090 pos += fd->position.toPointF();-
3091-
3092 if (QTextTable *table = qobject_cast<QTextTable *>(f)
QTextTable *ta...extTable *>(f)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3093 QTextTableCell cell = table->cellAt(framePos);-
3094 if (cell.isValid()
cell.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3095 pos += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
never executed: pos += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
0
3096 }
never executed: end of block
0
3097-
3098 f = f->parentFrame();-
3099 }
never executed: end of block
0
3100 return
never executed: return QRectF(pos, data(frame)->size.toSizeF());
QRectF(pos, data(frame)->size.toSizeF());
never executed: return QRectF(pos, data(frame)->size.toSizeF());
0
3101}-
3102-
3103QRectF QTextDocumentLayout::blockBoundingRect(const QTextBlock &block) const-
3104{-
3105 const QTextDocumentLayoutPrivate * const d = d_func();-
3106 if (d->docPrivate->pageSize.isNull()
d->docPrivate-...eSize.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
|| !block.isValid()
!block.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| !block.isVisible()
!block.isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3107 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
3108 d->ensureLayoutedByPosition(block.position() + block.length());-
3109 QTextFrame *frame = d->document->frameAt(block.position());-
3110 QPointF offset;-
3111 const int blockPos = block.position();-
3112-
3113 while (frame
frameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3114 QTextFrameData *fd = data(frame);-
3115 offset += fd->position.toPointF();-
3116-
3117 if (QTextTable *table = qobject_cast<QTextTable *>(frame)
QTextTable *ta...able *>(frame)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3118 QTextTableCell cell = table->cellAt(blockPos);-
3119 if (cell.isValid()
cell.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3120 offset += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
never executed: offset += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
0
3121 }
never executed: end of block
0
3122-
3123 frame = frame->parentFrame();-
3124 }
never executed: end of block
0
3125-
3126 const QTextLayout *layout = block.layout();-
3127 QRectF rect = layout->boundingRect();-
3128 rect.moveTopLeft(layout->position() + offset);-
3129 return
never executed: return rect;
rect;
never executed: return rect;
0
3130}-
3131-
3132int QTextDocumentLayout::layoutStatus() const-
3133{-
3134 const QTextDocumentLayoutPrivate * const d = d_func();-
3135 int pos = d->currentLazyLayoutPosition;-
3136 if (pos == -1
pos == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3137 return
never executed: return 100;
100;
never executed: return 100;
0
3138 return
never executed: return pos * 100 / d->document->docHandle()->length();
pos * 100 / d->document->docHandle()->length();
never executed: return pos * 100 / d->document->docHandle()->length();
0
3139}-
3140-
3141void QTextDocumentLayout::timerEvent(QTimerEvent *e)-
3142{-
3143 QTextDocumentLayoutPrivate * const d = d_func();-
3144 if (e->timerId() == d->layoutTimer.timerId()
e->timerId() =...imer.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3145 if (d->currentLazyLayoutPosition != -1
d->currentLazy...Position != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3146 d->layoutStep();
never executed: d->layoutStep();
0
3147 }
never executed: end of block
else if (e->timerId() == d->sizeChangedTimer.timerId()
e->timerId() =...imer.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3148 d->lastReportedSize = dynamicDocumentSize();-
3149 documentSizeChanged(d->lastReportedSize);-
3150 d->sizeChangedTimer.stop();-
3151-
3152 if (d->currentLazyLayoutPosition == -1
d->currentLazy...Position == -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3153 const int newCount = dynamicPageCount();-
3154 if (newCount != d->lastPageCount
newCount != d->lastPageCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3155 d->lastPageCount = newCount;-
3156 pageCountChanged(newCount);-
3157 }
never executed: end of block
0
3158 }
never executed: end of block
0
3159 }
never executed: end of block
else {
0
3160 QAbstractTextDocumentLayout::timerEvent(e);-
3161 }
never executed: end of block
0
3162}-
3163-
3164void QTextDocumentLayout::layoutFinished()-
3165{-
3166 QTextDocumentLayoutPrivate * const d = d_func();-
3167 d->layoutTimer.stop();-
3168 if (!d->insideDocumentChange
!d->insideDocumentChangeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3169 d->sizeChangedTimer.start(0, this);
never executed: d->sizeChangedTimer.start(0, this);
0
3170-
3171 d->showLayoutProgress = true;-
3172}
never executed: end of block
0
3173-
3174void QTextDocumentLayout::ensureLayouted(qreal y)-
3175{-
3176 d_func()->ensureLayouted(QFixed::fromReal(y));-
3177}
never executed: end of block
0
3178-
3179qreal QTextDocumentLayout::idealWidth() const-
3180{-
3181 const QTextDocumentLayoutPrivate * const d = d_func();-
3182 d->ensureLayoutFinished();-
3183 return
never executed: return d->idealWidth;
d->idealWidth;
never executed: return d->idealWidth;
0
3184}-
3185-
3186bool QTextDocumentLayout::contentHasAlignment() const-
3187{-
3188 const QTextDocumentLayoutPrivate * const d = d_func();-
3189 return
never executed: return d->contentHasAlignment;
d->contentHasAlignment;
never executed: return d->contentHasAlignment;
0
3190}-
3191-
3192qreal QTextDocumentLayoutPrivate::scaleToDevice(qreal value) const-
3193{-
3194 if (!paintDevice
!paintDeviceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3195 return
never executed: return value;
value;
never executed: return value;
0
3196 return
never executed: return value * paintDevice->logicalDpiY() / qreal(qt_defaultDpi());
value * paintDevice->logicalDpiY() / qreal(qt_defaultDpi());
never executed: return value * paintDevice->logicalDpiY() / qreal(qt_defaultDpi());
0
3197}-
3198-
3199QFixed QTextDocumentLayoutPrivate::scaleToDevice(QFixed value) const-
3200{-
3201 if (!paintDevice
!paintDeviceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3202 return
never executed: return value;
value;
never executed: return value;
0
3203 return
never executed: return value * QFixed(paintDevice->logicalDpiY()) / QFixed(qt_defaultDpi());
value * QFixed(paintDevice->logicalDpiY()) / QFixed(qt_defaultDpi());
never executed: return value * QFixed(paintDevice->logicalDpiY()) / QFixed(qt_defaultDpi());
0
3204}-
3205-
3206-
3207-
Switch to Source codePreprocessed file

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