From kde-commits Sun Feb 03 23:42:32 2008 From: Charles Samuels Date: Sun, 03 Feb 2008 23:42:32 +0000 To: kde-commits Subject: KDE/kdelibs/khtml/rendering Message-Id: <1202082152.184256.14552.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120208216503287 SVN commit 770550 by charles: support bidirectional override in both directions. Duh M +9 -6 font.cpp --- trunk/KDE/kdelibs/khtml/rendering/font.cpp #770549:770550 @@ -69,14 +69,17 @@ int x, int y, const QString &str) { QString qs = str; - if (d == Qt::RightToLeft) + // Qt doesn't have a function to force a direction, + // so we have to use a the unicode "RTO" character to + // (no, setLayoutDirection isn't enough) + if (d == Qt::RightToLeft && str[0].direction() == QChar::DirL) { - // Qt doesn't have a function to force a direction, - // so we have to use a the unicode "RTO" character to - // (no, setLayoutDirection isn't enough) - if (str[0].direction() == QChar::DirL) - qs.prepend(QChar(0x202E)); + qs.prepend(QChar(0x202E)); // RIGHT-TO-LEFT OVERRIDE } + else if (d == Qt::LeftToRight && str[0].direction() == QChar::DirR) + { + qs.prepend(QChar(0x202D)); // LEFT-TO-RIGHT OVERRIDE + } Qt::LayoutDirection saveDir = p->layoutDirection(); p->setLayoutDirection(d);