dlls/usp10/bidi.c
/* Convert the libwine information to the direction enum */
Convert the libwine information to the direction enum
Convert the libwine information to the direction enum
static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIPT_CONTROL *c)
{
    static const enum directions dir_map[16] =
    {
        L,  
        L,
        R,
        EN,
        ES,
        ET,
        AN,
        CS,
        B,
        S,
        WS,
        ON,
        AL,
        NSM,
        BN,
        PDF  
    };
    unsigned i;
    for (i = 0; i < uCount; ++i)
    {
        chartype[i] = dir_map[get_char_typeW(lpString[i]) >> 12];
        switch (chartype[i])
        {
        case ES:
            if (!c->fLegacyBidiClass) break;
            switch (lpString[i])
            {
            case '-':
            case '+': chartype[i] = N; break;
            case '/': chartype[i] = CS; break;
            }
            break;
        case PDF:
            switch (lpString[i])
            {
            case 0x202A: chartype[i] = LRE; break;
            case 0x202B: chartype[i] = RLE; break;
            case 0x202C: chartype[i] = PDF; break;
            case 0x202D: chartype[i] = LRO; break;
            case 0x202E: chartype[i] = RLO; break;
            }
            break;
        }
    }
}
static void classify ( LPCWSTR lpString , WORD * chartype , DWORD uCount , const SCRIPT_CONTROL * c ) { static const enum directions dir_map [ 16 ] = { L , L , R , EN , ES , ET , AN , CS , B , S , WS , ON , AL , NSM , BN , PDF } ; unsigned i ; for ( i = 0 ; i < uCount ; ++ i ) { chartype [ i ] = dir_map [ get_char_typeW ( lpString [ i ] ) >> 12 ] ; switch ( chartype [ i ] ) { case ES : if ( ! c -> fLegacyBidiClass ) break ; switch ( lpString [ i ] ) { case ' ' : case ' ' : chartype [ i ] = N ; break ; case ' ' : chartype [ i ] = CS ; break ; } break ; case PDF : switch ( lpString [ i ] ) { case 0x202A : chartype [ i ] = LRE ; break ; case 0x202B : chartype [ i ] = RLE ; break ; case 0x202C : chartype [ i ] = PDF ; break ; case 0x202D : chartype [ i ] = LRO ; break ; case 0x202E : chartype [ i ] = RLO ; break ; } break ; } } }
Convert the libwine information to the direction enum
Convert the libwine information to the direction enum
/* unassigned defaults to L */ /* also LRE, LRO, RLE, RLO */