From: Jiang Jiang Date: Thu, 14 Jul 2011 07:40:12 +0000 (+0200) Subject: Apply 57993ba7 properly to 4.8 X-Git-Tag: qt-v5.0.0-alpha1~3991 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=042cffd601fd5b7e9ef176531893337a917cf455;p=profile%2Fivi%2Fqtbase.git Apply 57993ba7 properly to 4.8 Because we have moved alignLine from qtextlayout.cpp to QTextEngine, this patch has to be applied manually. Reviewed-by: TrustMe (cherry picked from commit 705416cdc8ee91ac88d80298dbe2971a9384c196) Change-Id: Ibd657a52da1c510c839623738d49602b5c4a0824 Reviewed-on: http://codereview.qt.nokia.com/1640 Reviewed-by: Jiang Jiang Reviewed-by: Qt Sanity Bot --- diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 5cb0bfe..176393d 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2790,7 +2790,7 @@ QFixed QTextEngine::alignLine(const QScriptLine &line) if (align & Qt::AlignRight) x = line.width - (line.textAdvance + leadingSpaceWidth(line)); else if (align & Qt::AlignHCenter) - x = (line.width - (line.textAdvance + leadingSpaceWidth(line)))/2; + x = (line.width - line.textAdvance)/2 - leadingSpaceWidth(line); } return x; }