summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocumentlayout.cpp
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2011-02-07 17:23:42 +1000
committerYann Bodson <yann.bodson@nokia.com>2011-02-09 10:20:47 +1000
commitccd1b7dd5c8e6b1c4bf5b21354f7b9acaf881b00 (patch)
tree70fff5170c32335a78e9b4fb3856cdf60b78f5cd /src/gui/text/qtextdocumentlayout.cpp
parentf7e789710568d263816f50bd5782cc7adec41249 (diff)
Use same values for Text.lineHeightMode and QTextBlock::lineHeightMode from master.
- MultiplyHeight becomes ProportionalHeight - PixelHeight becomes FixedHeight Change-Id: I2a1ebc6ff9db7e62f513919f19773f985b08f8d7 Reviewed-by: Michael Brasser
Diffstat (limited to 'src/gui/text/qtextdocumentlayout.cpp')
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index c1c3768585..a1dcb634cc 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -525,7 +525,7 @@ QTextDocumentLayoutPrivate::QTextDocumentLayoutPrivate()
lazyLayoutStepSize(1000),
lastPageCount(-1),
lineH(1),
- lineHeightMode(QTextDocumentLayout::MultiplyHeight)
+ lineHeightMode(QTextDocumentLayout::ProportionalHeight)
{
showLayoutProgress = true;
insideDocumentChange = false;
@@ -2644,7 +2644,9 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
}
- QFixed lineHeight = (lineHeightMode == QTextDocumentLayout::PixelHeight) ? QFixed::fromReal(lineH) : QFixed::fromReal(line.height() * lineH);
+ // TODO: replace with proper line height support in 4.8
+ QFixed lineHeight = (lineHeightMode == QTextDocumentLayout::FixedHeight)
+ ? QFixed::fromReal(lineH) : QFixed::fromReal(line.height() * lineH);
if (layoutStruct->pageHeight > 0 && layoutStruct->absoluteY() + lineHeight > layoutStruct->pageBottom) {
layoutStruct->newPage();
@@ -2720,7 +2722,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
}
}
-void QTextDocumentLayout::setLineHeight(qreal lineH, QTextDocumentLayout::LineHeightMode mode = QTextDocumentLayout::MultiplyHeight)
+void QTextDocumentLayout::setLineHeight(qreal lineH, QTextDocumentLayout::LineHeightMode mode = QTextDocumentLayout::ProportionalHeight)
{
Q_D(QTextDocumentLayout);
d->lineH = lineH;