diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-21 16:29:53 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-21 16:29:53 (GMT) |
commit | b4334982c1cb6058f02a6633cdf3cacc334d8e51 (patch) | |
tree | 26a803837b7631de83a77f3490de66b9ed02db26 /src/gui/text | |
parent | 02c83c2adf0513041d9a3866d4e589ad79d61bda (diff) | |
parent | f5bab2bc74ed03fd1db99cba3830b6b21795a627 (diff) | |
download | Qt-b4334982c1cb6058f02a6633cdf3cacc334d8e51.zip Qt-b4334982c1cb6058f02a6633cdf3cacc334d8e51.tar.gz Qt-b4334982c1cb6058f02a6633cdf3cacc334d8e51.tar.bz2 |
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration:
Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to 5699175f55acbdfa4ac95ab6c727ebd4a201f3a2
Fixed device context leak in QGLWidget on Windows.
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( a13977ce2aba31808a046cddc082a84dc316d78b )
Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to 508b02a252b524d34f3ed970eef3bdb6350a2b77
Re-enable data structure packing in Harfbuzz for RVCT
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 85a48bdb52a81a9d18477a347fba5f6c930af416 )
Fixed memory lean in QImageVideoBuffer and QMemoryVideoBuffer.
QLocalSocket/Win: handle ERROR_MORE_DATA after read operation
Fix possible crash in QTextLayout for glyphless items
Attempt to stabilize tst_qtimeline::value
Attempt to stabilize tst_lconvert
Replace custom WAIT_FOR_CONDITION with semi-standard QTRY_COMPARE
Attempt to stabilize tst_qwidget::taskQTBUG_4055_sendSyntheticEnterLeave
Attempt to stabilize tst_qwidget::syntheticEnterLeave
Attempt to stabilize tst_qwidgetaction::visibilityUpdate
Attempt to stabilize tst_lupdate::good
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( aa3f786bdba4dc153620ae7f98e4b0e41770d1d1 )
Audio (osx); In pull mode emit readyRead() for each period received.
AudioInput example; disconnect from the built-in device when changing mode.
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index ddf9411..fec9ecc 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1661,7 +1661,7 @@ namespace { { LineBreakHelper() : glyphCount(0), maxGlyphs(0), currentPosition(0), fontEngine(0), logClusters(0), - manualWrap(false) + manualWrap(false), whiteSpaceOrObject(true) { } @@ -1684,6 +1684,7 @@ namespace { const unsigned short *logClusters; bool manualWrap; + bool whiteSpaceOrObject; bool checkFullOtherwiseExtend(QScriptLine &line); @@ -1693,8 +1694,10 @@ namespace { } inline glyph_t currentGlyph() const - { + { Q_ASSERT(currentPosition > 0); + Q_ASSERT(logClusters[currentPosition - 1] < glyphs.numGlyphs); + return glyphs.glyphs[logClusters[currentPosition - 1]]; } @@ -1829,6 +1832,7 @@ void QTextLine::layout_helper(int maxGlyphs) lbh.tmpData.descent = qMax(lbh.tmpData.descent, current.descent); if (current.analysis.flags == QScriptAnalysis::Tab && (alignment & (Qt::AlignLeft | Qt::AlignRight | Qt::AlignCenter | Qt::AlignJustify))) { + lbh.whiteSpaceOrObject = true; if (lbh.checkFullOtherwiseExtend(line)) goto found; @@ -1845,6 +1849,7 @@ void QTextLine::layout_helper(int maxGlyphs) if (lbh.checkFullOtherwiseExtend(line)) goto found; } else if (current.analysis.flags == QScriptAnalysis::LineOrParagraphSeparator) { + lbh.whiteSpaceOrObject = true; // if the line consists only of the line separator make sure // we have a sane height if (!line.length && !lbh.tmpData.length) @@ -1858,6 +1863,7 @@ void QTextLine::layout_helper(int maxGlyphs) line += lbh.tmpData; goto found; } else if (current.analysis.flags == QScriptAnalysis::Object) { + lbh.whiteSpaceOrObject = true; lbh.tmpData.length++; QTextFormat format = eng->formats()->format(eng->formatIndex(&eng->layoutData->items[item])); @@ -1871,6 +1877,7 @@ void QTextLine::layout_helper(int maxGlyphs) if (lbh.checkFullOtherwiseExtend(line)) goto found; } else if (attributes[lbh.currentPosition].whiteSpace) { + lbh.whiteSpaceOrObject = true; while (lbh.currentPosition < end && attributes[lbh.currentPosition].whiteSpace) addNextCluster(lbh.currentPosition, end, lbh.spaceData, lbh.glyphCount, current, lbh.logClusters, lbh.glyphs); @@ -1880,6 +1887,7 @@ void QTextLine::layout_helper(int maxGlyphs) goto found; } } else { + lbh.whiteSpaceOrObject = false; bool sb_or_ws = false; do { addNextCluster(lbh.currentPosition, end, lbh.tmpData, lbh.glyphCount, @@ -1941,7 +1949,7 @@ void QTextLine::layout_helper(int maxGlyphs) LB_DEBUG("reached end of line"); lbh.checkFullOtherwiseExtend(line); found: - if (lbh.rightBearing > 0) // If right bearing has not yet been adjusted + if (lbh.rightBearing > 0 && !lbh.whiteSpaceOrObject) // If right bearing has not yet been adjusted lbh.adjustRightBearing(); line.textAdvance = line.textWidth; line.textWidth -= qMin(QFixed(), lbh.rightBearing); |