diff options
-rw-r--r-- | Source/WebCore/platform/graphics/qt/FontQt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/qt/FontQt.cpp b/Source/WebCore/platform/graphics/qt/FontQt.cpp index 96db55c92..3afbb3528 100644 --- a/Source/WebCore/platform/graphics/qt/FontQt.cpp +++ b/Source/WebCore/platform/graphics/qt/FontQt.cpp @@ -252,8 +252,8 @@ void Font::initFormatForTextLayout(QTextLayout* layout, const TextRun& run) cons // To avoid word-spacing on any leading spaces, we exclude them from FormatRange which // word-spacing along with other options would be applied to. This is safe since the other // formatting options does not affect spaces. - unsigned length = layout->text().length(); - for (range.start = 0; treatAsSpace(run[range.start]) && range.start < length; ++range.start) { } + unsigned length = run.length(); + for (range.start = 0; range.start < length && treatAsSpace(run[range.start]); ++range.start) { } range.length = length - range.start; if (m_wordSpacing) |