mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Fix display of parenthesis in arabic
Actually the workaround that is used to show parenthesis in the right direction is not needed any more, since this is part of the unicode bidi writing algorithm. This fixes at the same time the use of [] or as delimiters in arabic, which was wrong on screen. Note that there is a problem with hebrew, but this will require a fileformat change.
This commit is contained in:
parent
f4fc035cf6
commit
3599285019
@ -47,3 +47,5 @@ What is done:
|
||||
rely on Qt to do handle complex scripts.
|
||||
|
||||
* Get rid of LyXRC::rtl_support, which does not have a real use case.
|
||||
|
||||
* Fix display of [] and {} delimiters in Arabic scripts.
|
||||
|
@ -166,24 +166,9 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font)
|
||||
pos_type pos = bidi_.vis2log(vpos);
|
||||
pos_type start_pos = pos;
|
||||
// first character
|
||||
char_type c = par_.getChar(pos);
|
||||
docstring str;
|
||||
str.reserve(100);
|
||||
|
||||
// special case for arabic
|
||||
string const & lang = font.language()->lang();
|
||||
bool const swap_paren = lang == "arabic_arabtex"
|
||||
|| lang == "arabic_arabi"
|
||||
|| lang == "farsi";
|
||||
|
||||
// FIXME: Why only round brackets and why the difference to
|
||||
// Hebrew? See also Paragraph::getUChar
|
||||
if (swap_paren) {
|
||||
if (c == '(')
|
||||
c = ')';
|
||||
else if (c == ')')
|
||||
c = '(';
|
||||
}
|
||||
char_type const c = par_.getChar(pos);
|
||||
str.push_back(c);
|
||||
|
||||
FontSpan const font_span = par_.fontSpan(pos);
|
||||
@ -212,7 +197,7 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font)
|
||||
// Track change type or author has changed.
|
||||
break;
|
||||
|
||||
char_type c = par_.getChar(pos);
|
||||
char_type const c = par_.getChar(pos);
|
||||
|
||||
if (c == '\t')
|
||||
break;
|
||||
@ -220,15 +205,6 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font)
|
||||
if (!isPrintableNonspace(c))
|
||||
break;
|
||||
|
||||
// FIXME: Why only round brackets and why the difference to
|
||||
// Hebrew? See also Paragraph::getUChar
|
||||
if (swap_paren) {
|
||||
if (c == '(')
|
||||
c = ')';
|
||||
else if (c == ')')
|
||||
c = '(';
|
||||
}
|
||||
|
||||
str.push_back(c);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user