diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-06-28 13:39:59 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-06-28 13:39:59 (GMT) |
commit | e82cb13fdc4b0c779e1d8232b0254f92208d2372 (patch) | |
tree | b28efe5a4a3ea6a79c88a62bee59de797837c7f5 /src/gui/text/qtextlayout.cpp | |
parent | a80b43baa153e55fe40562604d45f25aad81ab2e (diff) | |
download | Qt-e82cb13fdc4b0c779e1d8232b0254f92208d2372.zip Qt-e82cb13fdc4b0c779e1d8232b0254f92208d2372.tar.gz Qt-e82cb13fdc4b0c779e1d8232b0254f92208d2372.tar.bz2 |
nano optimizations
Merge-request: 685
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index eed10d2..d8db625 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1769,7 +1769,8 @@ static inline void addNextCluster(int &pos, int end, QScriptLine &line, int &gly ++line.length; } while (pos < end && logClusters[pos] == glyphPosition); do { // calculate the textWidth for the rest of the current cluster. - line.textWidth += glyphs.advances_x[glyphPosition] * !glyphs.attributes[glyphPosition].dontPrint; + if (!glyphs.attributes[glyphPosition].dontPrint) + line.textWidth += glyphs.advances_x[glyphPosition]; ++glyphPosition; } while (glyphPosition < current.num_glyphs && !glyphs.attributes[glyphPosition].clusterStart); @@ -1999,9 +2000,10 @@ found: eng->maxWidth += lbh.spaceData.textWidth; if (eng->option.flags() & QTextOption::IncludeTrailingSpaces) line.textWidth += lbh.spaceData.textWidth; - line.length += lbh.spaceData.length; - if (lbh.spaceData.length) + if (lbh.spaceData.length) { + line.length += lbh.spaceData.length; line.hasTrailingSpaces = true; + } line.justified = false; line.gridfitted = false; |