Fix flipping of Arabic text when pasted to clipboard. Bug 197375, r+sr=bzbarsky
authorsmontagu@smontagu.org
Thu, 28 Jun 2007 13:02:56 -0700
changeset 2927 afd6c6a1cf33a86e38694375b2ba2648f2c61cf7
parent 2926 a9f91f3e53da6b2ac457ce63a18bdeb3deb33591
child 2928 0a0168f2f92e4fea29854c4ad52560fa045b1e55
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs197375
milestone1.9a6pre
Fix flipping of Arabic text when pasted to clipboard. Bug 197375, r+sr=bzbarsky
intl/unicharutil/util/nsBidiUtils.h
--- a/intl/unicharutil/util/nsBidiUtils.h
+++ b/intl/unicharutil/util/nsBidiUtils.h
@@ -112,28 +112,26 @@
 //  If Pref values are to be changed
 //  in the XUL file of Prefs. the values
 //  Must be changed here too..
 //  ------------------
 //
 #define IBMBIDI_TEXTDIRECTION_STR       "bidi.direction"
 #define IBMBIDI_TEXTTYPE_STR            "bidi.texttype"
 #define IBMBIDI_CONTROLSTEXTMODE_STR    "bidi.controlstextmode"
-#define IBMBIDI_CLIPBOARDTEXTMODE_STR   "bidi.clipboardtextmode"
 #define IBMBIDI_NUMERAL_STR             "bidi.numeral"
 #define IBMBIDI_SUPPORTMODE_STR         "bidi.support"
 #define IBMBIDI_CHARSET_STR             "bidi.characterset"
 
 #define IBMBIDI_TEXTDIRECTION       1
 #define IBMBIDI_TEXTTYPE            2
 #define IBMBIDI_CONTROLSTEXTMODE    3
-#define IBMBIDI_CLIPBOARDTEXTMODE   4
-#define IBMBIDI_NUMERAL             5
-#define IBMBIDI_SUPPORTMODE         6
-#define IBMBIDI_CHARSET             7
+#define IBMBIDI_NUMERAL             4
+#define IBMBIDI_SUPPORTMODE         5
+#define IBMBIDI_CHARSET             6
 
 //  ------------------
 //  Text Direction
 //  ------------------
 //  bidi.direction
 #define IBMBIDI_TEXTDIRECTION_LTR     1 //  1 = directionLTRBidi *
 #define IBMBIDI_TEXTDIRECTION_RTL     2 //  2 = directionRTLBidi
 //  ------------------
@@ -146,23 +144,16 @@
 //  ------------------
 //  Controls Text Mode
 //  ------------------
 //  bidi.controlstextmode
 #define IBMBIDI_CONTROLSTEXTMODE_LOGICAL   1 //  1 = logicalcontrolstextmodeBidiCmd *
 #define IBMBIDI_CONTROLSTEXTMODE_VISUAL    2 //  2 = visualcontrolstextmodeBidi
 #define IBMBIDI_CONTROLSTEXTMODE_CONTAINER 3 //  3 = containercontrolstextmodeBidi
 //  ------------------
-//  Clipboard Text Mode
-//  ------------------
-//  bidi.clipboardtextmode
-#define IBMBIDI_CLIPBOARDTEXTMODE_LOGICAL 1 //  1 = logicalclipboardtextmodeBidi
-#define IBMBIDI_CLIPBOARDTEXTMODE_VISUAL  2 //  2 = visualclipboardtextmodeBidi
-#define IBMBIDI_CLIPBOARDTEXTMODE_SOURCE  3 //  3 = sourceclipboardtextmodeBidi *
-//  ------------------
 //  Numeral Style
 //  ------------------
 //  bidi.numeral
 #define IBMBIDI_NUMERAL_NOMINAL       0 //  0 = nominalnumeralBidi *
 #define IBMBIDI_NUMERAL_REGULAR       1 //  1 = regularcontextnumeralBidi
 #define IBMBIDI_NUMERAL_HINDICONTEXT  2 //  2 = hindicontextnumeralBidi
 #define IBMBIDI_NUMERAL_ARABIC        3 //  3 = arabicnumeralBidi
 #define IBMBIDI_NUMERAL_HINDI         4 //  4 = hindinumeralBidi
@@ -179,37 +170,34 @@
 //  bidi.characterset
 #define IBMBIDI_CHARSET_BIDI        1 //  1 = doccharactersetBidi *
 #define IBMBIDI_CHARSET_DEFAULT     2 //  2 = defaultcharactersetBidi
 
 #define IBMBIDI_DEFAULT_BIDI_OPTIONS              \
         ((IBMBIDI_TEXTDIRECTION_LTR<<0)         | \
          (IBMBIDI_TEXTTYPE_CHARSET<<4)          | \
          (IBMBIDI_CONTROLSTEXTMODE_LOGICAL<<8)  | \
-         (IBMBIDI_CLIPBOARDTEXTMODE_SOURCE<<12) | \
-         (IBMBIDI_NUMERAL_NOMINAL<<16)          | \
-         (IBMBIDI_SUPPORTMODE_MOZILLA<<20)      | \
-         (IBMBIDI_CHARSET_BIDI<<24))
+         (IBMBIDI_NUMERAL_NOMINAL<<12)          | \
+         (IBMBIDI_SUPPORTMODE_MOZILLA<<16)      | \
+         (IBMBIDI_CHARSET_BIDI<<20))
 
 
 #define GET_BIDI_OPTION_DIRECTION(bo) (((bo)>>0) & 0x0000000F) /* 4 bits for DIRECTION */
 #define GET_BIDI_OPTION_TEXTTYPE(bo) (((bo)>>4) & 0x0000000F) /* 4 bits for TEXTTYPE */
 #define GET_BIDI_OPTION_CONTROLSTEXTMODE(bo) (((bo)>>8) & 0x0000000F) /* 4 bits for CONTROLTEXTMODE */
-#define GET_BIDI_OPTION_CLIPBOARDTEXTMODE(bo) (((bo)>>12) & 0x0000000F) /* 4 bits for CLIPBOARDTEXTMODE */
-#define GET_BIDI_OPTION_NUMERAL(bo) (((bo)>>16) & 0x0000000F) /* 4 bits for NUMERAL */
-#define GET_BIDI_OPTION_SUPPORT(bo) (((bo)>>20) & 0x0000000F) /* 4 bits for SUPPORT */
-#define GET_BIDI_OPTION_CHARACTERSET(bo) (((bo)>>24) & 0x0000000F) /* 4 bits for CHARACTERSET */
+#define GET_BIDI_OPTION_NUMERAL(bo) (((bo)>>12) & 0x0000000F) /* 4 bits for NUMERAL */
+#define GET_BIDI_OPTION_SUPPORT(bo) (((bo)>>16) & 0x0000000F) /* 4 bits for SUPPORT */
+#define GET_BIDI_OPTION_CHARACTERSET(bo) (((bo)>>20) & 0x0000000F) /* 4 bits for CHARACTERSET */
 
 #define SET_BIDI_OPTION_DIRECTION(bo, dir) {(bo)=((bo) & 0xFFFFFFF0)|(((dir)& 0x0000000F)<<0);}
 #define SET_BIDI_OPTION_TEXTTYPE(bo, tt) {(bo)=((bo) & 0xFFFFFF0F)|(((tt)& 0x0000000F)<<4);}
 #define SET_BIDI_OPTION_CONTROLSTEXTMODE(bo, cotm) {(bo)=((bo) & 0xFFFFF0FF)|(((cotm)& 0x0000000F)<<8);}
-#define SET_BIDI_OPTION_CLIPBOARDTEXTMODE(bo, cltm) {(bo)=((bo) & 0xFFFF0FFF)|(((cltm)& 0x0000000F)<<12);}
-#define SET_BIDI_OPTION_NUMERAL(bo, num) {(bo)=((bo) & 0xFFF0FFFF)|(((num)& 0x0000000F)<<16);}
-#define SET_BIDI_OPTION_SUPPORT(bo, sup) {(bo)=((bo) & 0xFF0FFFFF)|(((sup)& 0x0000000F)<<20);}
-#define SET_BIDI_OPTION_CHARACTERSET(bo, cs) {(bo)=((bo) & 0xF0FFFFFF)|(((cs)& 0x0000000F)<<24);}
+#define SET_BIDI_OPTION_NUMERAL(bo, num) {(bo)=((bo) & 0xFFFF0FFF)|(((num)& 0x0000000F)<<12);}
+#define SET_BIDI_OPTION_SUPPORT(bo, sup) {(bo)=((bo) & 0xFFF0FFFF)|(((sup)& 0x0000000F)<<16);}
+#define SET_BIDI_OPTION_CHARACTERSET(bo, cs) {(bo)=((bo) & 0xFF0FFFFF)|(((cs)& 0x0000000F)<<20);}
 
 /* Constants related to the position of numerics in the codepage */
 #define START_HINDI_DIGITS              0x0660
 #define END_HINDI_DIGITS                0x0669
 #define START_ARABIC_DIGITS             0x0030
 #define END_ARABIC_DIGITS               0x0039
 #define START_FARSI_DIGITS              0x06f0
 #define END_FARSI_DIGITS                0x06f9