Changeset 846 for trunk/src/gui/text/qtextdocumentlayout.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/text/qtextdocumentlayout.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 80 80 // ################ should probably add frameFormatChange notification! 81 81 82 struct Q LayoutStruct;82 struct QTextLayoutStruct; 83 83 84 84 class QTextFrameData : public QTextFrameLayoutData … … 110 110 QFixed maximumWidth; 111 111 112 Q LayoutStruct *currentLayoutStruct;112 QTextLayoutStruct *currentLayoutStruct; 113 113 114 114 bool sizeDirty; … … 124 124 } 125 125 126 struct Q LayoutStruct {127 Q LayoutStruct() : maximumWidth(QFIXED_MAX), fullLayout(false)126 struct QTextLayoutStruct { 127 QTextLayoutStruct() : maximumWidth(QFIXED_MAX), fullLayout(false) 128 128 {} 129 129 QTextFrame *frame; … … 328 328 /* 329 329 330 Optimi sation strategies:330 Optimization strategies: 331 331 332 332 HTML layout: … … 478 478 HitPoint hitTest(QTextBlock bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const; 479 479 480 Q LayoutStruct layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,481 int layoutFrom, int layoutTo, QTextTableData *tableData, QFixed absoluteTableY,482 bool withPageBreaks);480 QTextLayoutStruct layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width, 481 int layoutFrom, int layoutTo, QTextTableData *tableData, QFixed absoluteTableY, 482 bool withPageBreaks); 483 483 void setCellPosition(QTextTable *t, const QTextTableCell &cell, const QPointF &pos); 484 484 QRectF layoutTable(QTextTable *t, int layoutFrom, int layoutTo, QFixed parentY); … … 491 491 492 492 void layoutBlock(const QTextBlock &bl, int blockPosition, const QTextBlockFormat &blockFormat, 493 Q LayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat);494 void layoutFlow(QTextFrame::Iterator it, Q LayoutStruct *layoutStruct, int layoutFrom, int layoutTo, QFixed width = 0);495 void pageBreakInsideTable(QTextTable *table, Q LayoutStruct *layoutStruct);496 497 498 void floatMargins(const QFixed &y, const Q LayoutStruct *layoutStruct, QFixed *left, QFixed *right) const;499 QFixed findY(QFixed yFrom, const Q LayoutStruct *layoutStruct, QFixed requiredWidth) const;493 QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat); 494 void layoutFlow(QTextFrame::Iterator it, QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, QFixed width = 0); 495 void pageBreakInsideTable(QTextTable *table, QTextLayoutStruct *layoutStruct); 496 497 498 void floatMargins(const QFixed &y, const QTextLayoutStruct *layoutStruct, QFixed *left, QFixed *right) const; 499 QFixed findY(QFixed yFrom, const QTextLayoutStruct *layoutStruct, QFixed requiredWidth) const; 500 500 501 501 QVector<QCheckPoint> checkPoints; … … 1370 1370 Q_ASSERT(firstLine.isValid()); 1371 1371 QPointF pos = (offset + layout->position()).toPoint(); 1372 Qt::LayoutDirection dir = docPrivate->defaultTextOption.textDirection(); 1373 if (blockFormat.hasProperty(QTextFormat::LayoutDirection)) 1374 dir = blockFormat.layoutDirection(); 1372 Qt::LayoutDirection dir = bl.textDirection(); 1375 1373 { 1376 1374 QRectF textRect = firstLine.naturalTextRect(); … … 1488 1486 } 1489 1487 1490 Q LayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,1491 int layoutFrom, int layoutTo, QTextTableData *td,1492 QFixed absoluteTableY, bool withPageBreaks)1488 QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width, 1489 int layoutFrom, int layoutTo, QTextTableData *td, 1490 QFixed absoluteTableY, bool withPageBreaks) 1493 1491 { 1494 1492 LDEBUG << "layoutCell"; 1495 Q LayoutStruct layoutStruct;1493 QTextLayoutStruct layoutStruct; 1496 1494 layoutStruct.frame = t; 1497 1495 layoutStruct.minimumWidth = 0; … … 1642 1640 // maximum width. otherwise the maxwidth calculation sometimes 1643 1641 // returns wrong values 1644 Q LayoutStruct layoutStruct = layoutCell(table, cell, QFIXED_MAX, layoutFrom,1645 layoutTo, td, absoluteTableY,1646 /*withPageBreaks =*/false);1642 QTextLayoutStruct layoutStruct = layoutCell(table, cell, QFIXED_MAX, layoutFrom, 1643 layoutTo, td, absoluteTableY, 1644 /*withPageBreaks =*/false); 1647 1645 1648 1646 // distribute the minimum width over all columns the cell spans … … 1869 1867 1870 1868 const QFixed width = td->cellWidth(c, cspan) - widthPadding; 1871 Q LayoutStruct layoutStruct = layoutCell(table, cell, width,1872 layoutFrom, layoutTo,1873 td, absoluteTableY,1874 /*withPageBreaks =*/true);1869 QTextLayoutStruct layoutStruct = layoutCell(table, cell, width, 1870 layoutFrom, layoutTo, 1871 td, absoluteTableY, 1872 /*withPageBreaks =*/true); 1875 1873 1876 1874 const QFixed height = layoutStruct.y + bottomPadding + topPadding; … … 1977 1975 Q_ASSERT(pd && pd->currentLayoutStruct); 1978 1976 1979 Q LayoutStruct *layoutStruct = pd->currentLayoutStruct;1977 QTextLayoutStruct *layoutStruct = pd->currentLayoutStruct; 1980 1978 1981 1979 if (!pd->floats.contains(frame)) … … 2117 2115 fd->contentsWidth = newContentsWidth; 2118 2116 2119 Q LayoutStruct layoutStruct;2117 QTextLayoutStruct layoutStruct; 2120 2118 layoutStruct.frame = f; 2121 2119 layoutStruct.x_left = fd->leftMargin + fd->border + fd->padding; … … 2180 2178 } 2181 2179 2182 void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, Q LayoutStruct *layoutStruct,2180 void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayoutStruct *layoutStruct, 2183 2181 int layoutFrom, int layoutTo, QFixed width) 2184 2182 { … … 2510 2508 2511 2509 void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosition, const QTextBlockFormat &blockFormat, 2512 Q LayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat)2510 QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat) 2513 2511 { 2514 2512 Q_Q(QTextDocumentLayout); … … 2531 2529 //QTextFrameData *fd = data(layoutStruct->frame); 2532 2530 2533 Qt::LayoutDirection dir = docPrivate->defaultTextOption.textDirection(); 2534 if (blockFormat.hasProperty(QTextFormat::LayoutDirection)) 2535 dir = blockFormat.layoutDirection(); 2531 Qt::LayoutDirection dir = bl.textDirection(); 2536 2532 2537 2533 QFixed extraMargin; … … 2719 2715 } 2720 2716 2721 void QTextDocumentLayoutPrivate::floatMargins(const QFixed &y, const Q LayoutStruct *layoutStruct,2717 void QTextDocumentLayoutPrivate::floatMargins(const QFixed &y, const QTextLayoutStruct *layoutStruct, 2722 2718 QFixed *left, QFixed *right) const 2723 2719 { … … 2741 2737 } 2742 2738 2743 QFixed QTextDocumentLayoutPrivate::findY(QFixed yFrom, const Q LayoutStruct *layoutStruct, QFixed requiredWidth) const2739 QFixed QTextDocumentLayoutPrivate::findY(QFixed yFrom, const QTextLayoutStruct *layoutStruct, QFixed requiredWidth) const 2744 2740 { 2745 2741 QFixed right, left;
Note:
See TracChangeset
for help on using the changeset viewer.