diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt43.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt43.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt43.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt43.cpp index 137b7c97a..45bf05d49 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt43.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt43.cpp @@ -105,9 +105,9 @@ static int generateComponents(Vector<TextRunComponent, 1024>* components, const offset += add + letterSpacing + components->last().width; start = 1; // qDebug() << "space at 0" << offset; - } else if (smallCaps) { + } else if (smallCaps) f = (QChar::category(run[0]) == QChar::Letter_Lowercase ? &font.scFont() : &font.font()); - } + for (int i = 1; i < run.length(); ++i) { uint ch = run[i]; if (QChar(ch).isHighSurrogate() && QChar(run[i-1]).isLowSurrogate()) @@ -263,7 +263,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool if (!l.isValid()) return offset; - l.setLineWidth(INT_MAX/256); + l.setLineWidth(INT_MAX / 256); layout.endLayout(); if (position - xs >= l.width()) @@ -272,9 +272,8 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool if (cursor > 1) --cursor; return offset + cursor; - } else { + } else offset += components.at(i).string.length() - 1; - } } } else { for (int i = 0; i < components.size(); ++i) { @@ -287,7 +286,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool if (!l.isValid()) return offset; - l.setLineWidth(INT_MAX/256); + l.setLineWidth(INT_MAX / 256); layout.endLayout(); if (position - xs >= l.width()) @@ -296,9 +295,8 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool if (cursor > 1) --cursor; return offset + cursor; - } else { + } else offset += components.at(i).string.length() - 1; - } } } return run.length(); @@ -321,7 +319,7 @@ static float cursorToX(const Vector<TextRunComponent, 1024>& components, int wid if (!l.isValid()) return 0; - l.setLineWidth(INT_MAX/256); + l.setLineWidth(INT_MAX / 256); layout.endLayout(); return xs + l.cursorToX(cursor - start + 1); |