adium 3337:6f007c55cebe: Fix RTL detection for Arabic (among oth...

commits at adium.im commits at adium.im
Sat Sep 25 02:48:42 UTC 2010


details:	http://hg.adium.im/adium/rev/6f007c55cebe
revision:	3337:6f007c55cebe
author:		Zachary West <zacw at adium.im>
date:		Fri Sep 24 22:47:10 2010 -0400

Fix RTL detection for Arabic (among others).

We can't just compare a bitmask with a static value; Arabic has the FRIBIDI_MASK_ARABIC (for example) applied, which makes FRIBIDI_TYPE_RTL not validate.

Just check for the presence of RTL, now.

Fixes #13612.
(transplanted from f4c2dffc9723340b447eaedc3c80c04c6966feaa)

diffs (19 lines):

diff -r 8f85c11928e6 -r 6f007c55cebe Frameworks/FriBidi Framework/NSString-FBAdditions.m
--- a/Frameworks/FriBidi Framework/NSString-FBAdditions.m	Sat Sep 25 03:41:04 2010 +0200
+++ b/Frameworks/FriBidi Framework/NSString-FBAdditions.m	Fri Sep 24 22:47:10 2010 -0400
@@ -47,13 +47,13 @@
 			type = fribidi_get_type(fch);
 			
 			// LTR char?
-			if (type == FRIBIDI_TYPE_LTR) {
+			if (!(type & FRIBIDI_MASK_RTL)) {
 				dir = NSWritingDirectionLeftToRight;
 				break;
 			}
 			
 			// RTL char?
-			if (type == FRIBIDI_TYPE_RTL) {
+			if (type & FRIBIDI_MASK_RTL) {
 				dir = NSWritingDirectionRightToLeft;
 				break;
 			}




More information about the commits mailing list