* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
Encodings encodings;
-static
+namespace {
+
Uchar tab_iso8859_1[256] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
};
#ifdef USE_UNICODE_FOR_SYMBOLS
-static
Uchar tab_symbol[256] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
#endif
-static
unsigned char arabic_table2[63][4] = {
{0x41, 0x41, 0x41, 0x41}, // 0xc1 = hamza
{0x42, 0xa1, 0x42, 0x42}, // 0xc2 = ligature madda on alef
};
-static
unsigned char arabic_table[63][2] = {
{0xc1, 0xc1}, // 0xc1 = hamza
{0xc2, 0xc2}, // 0xc2 = ligature madda on alef
};
+unsigned char const arabic_start = 0xc1;
+
+} // namespace anon
+
+
bool Encodings::IsComposeChar_hebrew(unsigned char c)
{
return c <= 0xd2 && c >= 0xc0 &&
}
-static
-unsigned char const arabic_start = 0xc1;
-
-
bool Encodings::is_arabic(unsigned char c)
{
return c >= arabic_start && arabic_table[c-arabic_start][0];
if (!is_arabic(c))
return c;
- if (lyxrc.font_norm == "iso10646-1")
+ if (lyxrc.font_norm_type == LyXRC::ISO_10646_1)
return arabic_table2[c-arabic_start][form];
else
return arabic_table[c-arabic_start][form >> 1];
{
EncodingList::const_iterator it = encodinglist.find(encoding);
if (it != encodinglist.end())
- return &(*it).second;
+ return &it->second;
else
return 0;
}
LyXLex lex(encodingtags, et_last - 1);
lex.setFile(filename);
- while (lex.IsOK()) {
+ while (lex.isOK()) {
switch (lex.lex()) {
case et_encoding:
{
lex.next();
- string name = lex.GetString();
+ string const name = lex.getString();
lex.next();
- string latexname = lex.GetString();
+ string const latexname = lex.getString();
lyxerr[Debug::INIT] << "Reading encoding " << name << endl;
Uchar table[256];
for (unsigned int i = 0; i < 256; ++i) {
lex.next();
- string tmp = lex.GetString();
+ string const tmp = lex.getString();
table[i] = ::strtol(tmp.c_str(), 0 , 16);
}
encodinglist[name] = Encoding(name, latexname, table);
case et_end:
lex.printError("Encodings::read: Misplaced end");
break;
+ case LyXLex::LEX_FEOF:
+ break;
default:
lex.printError("Encodings::read: "
"Unknown tag: `$$Token'");