adium-1.4 3063:f4c2dffc9723: Fix RTL detection for Arabic (among...

commits at adium.im commits at adium.im
Sat Sep 25 02:47:57 UTC 2010


details:	http://hg.adium.im/adium-1.4/rev/f4c2dffc9723
revision:	3063:f4c2dffc9723
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.

diffs (19 lines):

diff -r 187d84ab1088 -r f4c2dffc9723 Frameworks/FriBidi Framework/NSString-FBAdditions.m
--- a/Frameworks/FriBidi Framework/NSString-FBAdditions.m	Sat Sep 25 03:35:43 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