mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-24 09:04:48 +00:00
FindAdv: Expand the list for handled latin characters
This commit is contained in:
parent
d50923d48a
commit
b21c8b214d
@ -1248,25 +1248,30 @@ void Intervall::addIntervall(int low, int upper)
|
|||||||
typedef map<string, string> AccentsMap;
|
typedef map<string, string> AccentsMap;
|
||||||
static AccentsMap accents = map<string, string>();
|
static AccentsMap accents = map<string, string>();
|
||||||
|
|
||||||
static void buildaccent(string name, string param, string values)
|
static void buildaccent(string n, string param, string values)
|
||||||
{
|
{
|
||||||
size_t start = 0;
|
stringstream s(n);
|
||||||
for (size_t i = 0; i < param.size(); i++) {
|
string name;
|
||||||
string key = name + "{" + param[i] + "}";
|
const char delim = '|';
|
||||||
// get the corresponding utf8-value
|
while (getline(s, name, delim)) {
|
||||||
if ((values[start] & 0xc0) != 0xc0) {
|
size_t start = 0;
|
||||||
// should not happen, utf8 encoding starts at least with 11xxxxxx
|
for (size_t i = 0; i < param.size(); i++) {
|
||||||
start++;
|
string key = name + "{" + param[i] + "}";
|
||||||
continue;
|
// get the corresponding utf8-value
|
||||||
}
|
if ((values[start] & 0xc0) != 0xc0) {
|
||||||
for (int j = 1; ;j++) {
|
// should not happen, utf8 encoding starts at least with 11xxxxxx
|
||||||
if (start + j >= values.size())
|
start++;
|
||||||
break;
|
continue;
|
||||||
if ((values[start+j] & 0xc0) == 0xc0) {
|
}
|
||||||
// This is the first byte of following utf8 char
|
for (int j = 1; ;j++) {
|
||||||
accents[key] = values.substr(start, j);
|
if (start + j >= values.size())
|
||||||
start += j;
|
break;
|
||||||
break;
|
if ((values[start+j] & 0xc0) == 0xc0) {
|
||||||
|
// This is the first byte of following utf8 char
|
||||||
|
accents[key] = values.substr(start, j);
|
||||||
|
start += j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1277,19 +1282,22 @@ static void buildAccentsMap()
|
|||||||
accents["imath"] = "ı";
|
accents["imath"] = "ı";
|
||||||
accents["ddot{\\imath}"] = "ï";
|
accents["ddot{\\imath}"] = "ï";
|
||||||
accents["acute{\\imath}"] = "í";
|
accents["acute{\\imath}"] = "í";
|
||||||
|
accents["tilde{\\imath}"] = "ĩ";
|
||||||
|
accents["jmath"] = "ȷ";
|
||||||
|
accents["hat{\\jmath}"] = "ĵ";
|
||||||
accents["lyxmathsym{ß}"] = "ß";
|
accents["lyxmathsym{ß}"] = "ß";
|
||||||
buildaccent("ddot", "aeouyAEOUY", "äëöüÿÄËÖÜŸ");
|
buildaccent("ddot", "aeouyAEOUY", "äëöüÿÄËÖÜŸ"); // umlaut
|
||||||
buildaccent("dot", "aeoyzAEOYZ", "ȧėȯẏżȦĖȮẎŻ");
|
buildaccent("dot", "aeoyzAEOYZ", "ȧėȯẏżȦĖȮẎŻ");
|
||||||
buildaccent("acute", "aeouyAEOUY", "äëöüÿÄËÖÜŸ");
|
buildaccent("acute", "aAcCeElLoOnNrRsSuUyYzZI", "áÁćĆéÉĺĹóÓńŃŕŔśŚúÚýÝźŹÍ");
|
||||||
/*
|
/*
|
||||||
buildaccent("dacute", "oOuU", "őŐűŰ");
|
buildaccent("dacute", "oOuU", "őŐűŰ");
|
||||||
buildaccent("H", "oOuU", "őŐűŰ"); // dacute in text
|
buildaccent("H", "oOuU", "őŐűŰ"); // dacute in text
|
||||||
*/
|
*/
|
||||||
buildaccent("mathring", "uU", "ůŮ");
|
buildaccent("mathring|r", "uU", "ůŮ");
|
||||||
buildaccent("r", "uU", "ůŮ"); //mathring in text
|
buildaccent("check", "cCdDeElLnNrRsSTzZ", "čČďĎěĚľĽňŇřŘšŠŤžŽ"); // caron
|
||||||
buildaccent("check", "cdnrszCDNRSZ", "čďřňšžČĎŘŇŠŽ");
|
buildaccent("hat", "cCgGhHJsSwWyYoOgG", "ĉĈĝĜĥĤĴŝŜŵŴŷŶôÔĝĜ"); // circ
|
||||||
buildaccent("hat", "cCoOgGhHsS", "ĉĈôÔĝĜĥĤŝŜ");
|
buildaccent("bar|=", "aAeEoOuU", "āĀēĒōŌūŪ"); // macron
|
||||||
buildaccent("bar", "aAeE", "āĀēĒ");
|
buildaccent("tilde", "I", "Ĩ"); // macron
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1300,7 +1308,7 @@ void Intervall::removeAccents()
|
|||||||
{
|
{
|
||||||
if (accents.empty())
|
if (accents.empty())
|
||||||
buildAccentsMap();
|
buildAccentsMap();
|
||||||
static regex const accre("\\\\((lyxmathsym|ddot|dot|acute|mathring|r|check|check|hat|bar)\\{[^\\{\\}]+\\}|imath)");
|
static regex const accre("\\\\((lyxmathsym|ddot|dot|acute|mathring|r|check|check|hat|bar|=)\\{[^\\{\\}]+\\}|imath|jmath)");
|
||||||
smatch sub;
|
smatch sub;
|
||||||
for (sregex_iterator itacc(par.begin(), par.end(), accre), end; itacc != end; ++itacc) {
|
for (sregex_iterator itacc(par.begin(), par.end(), accre), end; itacc != end; ++itacc) {
|
||||||
sub = *itacc;
|
sub = *itacc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user