summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-02-05 21:25:31 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-02-05 21:26:33 +0100
commitd065dfd454890c332482a6109ed34a989e50809b (patch)
tree0d3e9c5367c1fad7d089d368182374e8d1d46ca1 /src/gui/text/qtextlayout.cpp
parent632840cb0f5ad355d87fc040b015d04af86371ec (diff)
parent9f54846d951838361f4188b423e7aa7c7b9a9540 (diff)
Merge remote-tracking branch 'gerrit/master' into containers
Conflicts: src/corelib/tools/qstring.cpp Change-Id: I23d214bf33c2badfae1876da3cc7d6d8f6e635fb
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r--src/gui/text/qtextlayout.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 1e8cb9e478..ac92c4dd51 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -2228,9 +2228,12 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
int glyphsEnd = (relativeTo == eng->length(&si))
? si.num_glyphs - 1
: logClusters[relativeTo];
+ // the glyph index right next to the requested range
+ int nextGlyphIndex = relativeTo < eng->length(&si) - 1 ? logClusters[relativeTo + 1] : si.num_glyphs;
+ if (nextGlyphIndex - 1 > glyphsEnd)
+ glyphsEnd = nextGlyphIndex - 1;
bool startsInsideLigature = relativeFrom > 0 && logClusters[relativeFrom - 1] == glyphsStart;
- bool endsInsideLigature = relativeTo < eng->length(&si) - 1
- && logClusters[relativeTo + 1] == glyphsEnd;
+ bool endsInsideLigature = nextGlyphIndex == glyphsEnd;
int itemGlyphsStart = logClusters[iterator.itemStart - si.position];
int itemGlyphsEnd = logClusters[iterator.itemEnd - 1 - si.position];