Commit ef07087f authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Use the same BiDi direction table as usp10.

parent 01ebf1ad
......@@ -20,6 +20,7 @@ C_SRCS = \
dibdrv/objects.c \
dibdrv/opengl.c \
dibdrv/primitives.c \
direction.c \
driver.c \
enhmetafile.c \
enhmfdrv/bitblt.c \
......
......@@ -49,7 +49,6 @@
#include "wingdi.h"
#include "winnls.h"
#include "usp10.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "gdi_private.h"
......@@ -59,6 +58,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(bidi);
#define odd(x) ((x) & 1)
extern const unsigned short bidi_direction_table[] DECLSPEC_HIDDEN;
/*------------------------------------------------------------------------
Bidirectional Character Types
......@@ -100,52 +101,29 @@ enum directions
LRE,
PDF,
LRI, /* Isolate formatting characters new with 6.3 */
RLI,
FSI,
PDI,
/* resolved types, also resolved directions */
N = ON, /* alias, where ON, WS and S are treated the same */
NI = ON, /* alias, where ON, WS and S are treated the same */
};
/* HELPER FUNCTIONS */
static inline unsigned short get_table_entry(const unsigned short *table, WCHAR ch)
{
return table[table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)];
}
/* Convert the libwine information to the direction enum */
static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount)
{
static const enum directions dir_map[16] =
{
L, /* unassigned defaults to L */
L,
R,
EN,
ES,
ET,
AN,
CS,
B,
S,
WS,
ON,
AL,
NSM,
BN,
PDF /* also LRE, LRO, RLE, RLO */
};
unsigned i;
for (i = 0; i < uCount; ++i)
{
chartype[i] = dir_map[get_char_typeW(lpString[i]) >> 12];
if (chartype[i] == 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;
}
}
}
chartype[i] = get_table_entry( bidi_direction_table, lpString[i] );
}
/* Set a run of cval values at locations all prior to, but not including */
......@@ -264,6 +242,10 @@ static void resolveWhitespace(int baselevel, const WORD *pcls, BYTE *plevel, int
case LRO:
case RLO:
case PDF:
case LRI:
case RLI:
case FSI:
case PDI:
case BN:
plevel[ich] = oldlevel;
cchrun++;
......@@ -512,7 +494,7 @@ BOOL BIDI_Reorder(
case B:
case S:
case WS:
case ON: chartype[j] = N;
case ON: chartype[j] = NI;
default: continue;
}
......
......@@ -2881,6 +2881,7 @@ dump_sortkeys( "libs/port/collation.c", READ_SORTKEYS_FILE() );
dump_compose_table( "libs/port/compose.c" );
dump_decompose_table( "libs/port/decompose.c" );
dump_ctype_tables( "libs/port/wctype.c" );
dump_bidi_dir_table( "dlls/gdi32/direction.c" );
dump_bidi_dir_table( "dlls/usp10/direction.c" );
dump_bidi_dir_table( "dlls/dwrite/direction.c" );
dump_string_type_table( "dlls/kernel32/wctype.c" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment