More cosmetics.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22874 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-08 18:25:10 +00:00
parent 3253ee5feb
commit 1c265688d8

View File

@ -330,15 +330,15 @@ docstring const Encoding::latexChar(char_type c) const
if (c < start_encodable_) if (c < start_encodable_)
return docstring(1, c); return docstring(1, c);
if (encodable_.find(c) == encodable_.end()) { if (encodable_.find(c) != encodable_.end())
// c cannot be encoded in this encoding return docstring(1, c);
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (it == unicodesymbols.end()) // c cannot be encoded in this encoding
throw EncodingException(c); CharInfoMap::const_iterator const it = unicodesymbols.find(c);
else if (it == unicodesymbols.end())
return it->second.command; throw EncodingException(c);
} else
return docstring(1, c); return it->second.command;
} }
@ -375,8 +375,7 @@ void Encodings::validate(char_type c, LaTeXFeatures & features)
bool Encodings::isComposeChar_hebrew(char_type c) bool Encodings::isComposeChar_hebrew(char_type c)
{ {
return c <= 0x05c2 && c >= 0x05b0 && return c <= 0x05c2 && c >= 0x05b0 && c != 0x05be && c != 0x05c0;
c != 0x05be && c != 0x05c0;
} }
@ -386,11 +385,9 @@ bool Encodings::isComposeChar_hebrew(char_type c)
bool Encodings::is_arabic_special(char_type c) bool Encodings::is_arabic_special(char_type c)
{ {
return (c >= 0x0621 && c <= 0x0625) || return (c >= 0x0621 && c <= 0x0625) || (c >= 0x0630 && c <= 0x0632)
c == 0x0627 || c == 0x0629 || || c == 0x0627 || c == 0x0629 || c == 0x062f || c == 0x0648
c == 0x062f || c == 0x0648 || || c == 0x0649 || c == 0x0698;
(c >= 0x0630 && c <= 0x0632) ||
c == 0x0649 || c == 0x0698;
} }
@ -402,8 +399,8 @@ bool Encodings::isComposeChar_arabic(char_type c)
bool Encodings::is_arabic(char_type c) bool Encodings::is_arabic(char_type c)
{ {
return c >= arabic_start && c <= arabic_end && return c >= arabic_start && c <= arabic_end
arabic_table[c-arabic_start][0]; && arabic_table[c-arabic_start][0];
} }
@ -433,8 +430,7 @@ bool Encodings::isKnownScriptChar(char_type const c, string & preamble)
if (it == unicodesymbols.end()) if (it == unicodesymbols.end())
return false; return false;
if (it->second.preamble != "textgreek" && if (it->second.preamble != "textgreek" && it->second.preamble != "textcyr")
it->second.preamble != "textcyr")
return false; return false;
if (preamble.empty()) { if (preamble.empty()) {
@ -447,11 +443,8 @@ bool Encodings::isKnownScriptChar(char_type const c, string & preamble)
Encoding const * Encodings::getFromLyXName(string const & name) const Encoding const * Encodings::getFromLyXName(string const & name) const
{ {
EncodingList::const_iterator it = encodinglist.find(name); EncodingList::const_iterator const it = encodinglist.find(name);
if (it != encodinglist.end()) return it != encodinglist.end() ? &it->second : 0;
return &it->second;
else
return 0;
} }
@ -486,28 +479,26 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
CharInfo info; CharInfo info;
string flags; string flags;
if (symbolslex.next(true)) { if (!symbolslex.next(true))
istringstream is(symbolslex.getString());
// reading symbol directly does not work if
// char_type == wchar_t.
boost::uint32_t tmp;
if(!(is >> hex >> tmp))
break;
symbol = tmp;
} else
break; break;
if (symbolslex.next(true))
info.command = symbolslex.getDocString(); istringstream is(symbolslex.getString());
else // reading symbol directly does not work if
// char_type == wchar_t.
boost::uint32_t tmp;
if(!(is >> hex >> tmp))
break; break;
if (symbolslex.next(true)) symbol = tmp;
info.preamble = symbolslex.getString();
else if (!symbolslex.next(true))
break; break;
if (symbolslex.next(true)) info.command = symbolslex.getDocString();
flags = symbolslex.getString(); if (!symbolslex.next(true))
else
break; break;
info.preamble = symbolslex.getString();
if (!symbolslex.next(true))
break;
flags = symbolslex.getString();
info.combining = false; info.combining = false;
info.feature = false; info.feature = false;