mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Fix arabic character transformation by Mostafa Vahedi:
The old code in the method "Paragraph::transformChar" had a bug, when the prev_char is a COMPOSE character (such as FATHA) and the previous BASE character is a SPECIAL character (such as ALEF). In this case the current character (such as BAA) gets the medial form and gets connected to the previous SPECIAL character which is not correct. The correct way to handle this situation is that, similar to the next_char, the first previous non-COMPOSE character should be assigned to the prev_char if exists. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18065 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b2df7383a0
commit
2409b887af
@ -2518,9 +2518,17 @@ char_type Paragraph::transformChar(char_type c, pos_type pos) const
|
||||
if (!Encodings::is_arabic(c))
|
||||
return c;
|
||||
|
||||
value_type const prev_char = pos > 0 ? getChar(pos - 1) : ' ';
|
||||
value_type prev_char = ' ';
|
||||
value_type next_char = ' ';
|
||||
|
||||
for (pos_type i = pos - 1; i >= 0; --i) {
|
||||
value_type const par_char = getChar(i);
|
||||
if (!Encodings::isComposeChar_arabic(par_char)) {
|
||||
prev_char = par_char;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (pos_type i = pos + 1, end = size(); i < end; ++i) {
|
||||
value_type const par_char = getChar(i);
|
||||
if (!Encodings::isComposeChar_arabic(par_char)) {
|
||||
|
Loading…
Reference in New Issue
Block a user