From c0136ace31e5473493b2e366847968e30f7490a2 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 16 Sep 2009 13:21:48 +0200 Subject: QFontMetrics::boundingRect(QString) returns incorrect width on Mac OS X This bug appears only in Carbon port (ATSUI font engine). While finding the character stops, this font engine relys on the RTL flags. As an optimization, for this particular version of boundingRect(), BIDI is ignored. So for this font engine, we will always use the correct RTL flags. Task-number: 213109 Done-with: Eskil Reviewed-by: Simon Hausmann --- src/gui/text/qtextengine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index b43bd06..81c9142 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1396,8 +1396,12 @@ void QTextEngine::itemize() const int length = layoutData->string.length(); if (!length) return; - +#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) + // ATSUI requires RTL flags to correctly identify the character stops. + bool ignore = false; +#else bool ignore = ignoreBidi; +#endif if (!ignore && option.textDirection() == Qt::LeftToRight) { ignore = true; const QChar *start = layoutData->string.unicode(); -- cgit v0.12