X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBidi.cpp;h=a85f3eaddd26d4c64b035293e8abf9b448e953db;hb=a84a98b54561044b5902dfce39bc31082877fec1;hp=d00b8eb72dada03a17df1f93f148deb2d4ba2bd6;hpb=a8cd9a4b8fd325b00c75f601c66c6d618ba276db;p=lyx.git diff --git a/src/Bidi.cpp b/src/Bidi.cpp index d00b8eb72d..a85f3eaddd 100644 --- a/src/Bidi.cpp +++ b/src/Bidi.cpp @@ -46,6 +46,7 @@ bool Bidi::inRange(pos_type pos) const return start_ == -1 || (start_ <= pos && pos <= end_); } + bool Bidi::same_direction() const { return same_direction_; @@ -61,7 +62,7 @@ void Bidi::computeTables(Paragraph const & par, return; } - if (par.ownerCode() == ERT_CODE || par.ownerCode() == LISTINGS_CODE) { + if (par.inInset().forceLTR()) { start_ = -1; return; } @@ -109,17 +110,18 @@ void Bidi::computeTables(Paragraph const & par, !par.isLineSeparator(lpos + 1) && !par.isNewline(lpos + 1)) ? lpos + 1 : lpos; - Font font = par.getFontSettings(bufparams, pos); - if (pos != lpos && 0 < lpos && rtl0 && font.isRightToLeft() && - font.fontInfo().number() == FONT_ON && + + Font const * font = &(par.getFontSettings(bufparams, pos)); + if (pos != lpos && 0 < lpos && rtl0 && font->isRightToLeft() && + font->fontInfo().number() == FONT_ON && par.getFontSettings(bufparams, lpos - 1).fontInfo().number() == FONT_ON) { - font = par.getFontSettings(bufparams, lpos); + font = &(par.getFontSettings(bufparams, lpos)); is_space = false; } + bool new_rtl = font->isVisibleRightToLeft(); + bool new_rtl0 = font->isRightToLeft(); - bool new_rtl = font.isVisibleRightToLeft(); - bool new_rtl0 = font.isRightToLeft(); int new_level; if (lpos == body_pos - 1