X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBidi.cpp;h=b9d1222931d83f0459b0fc527fb90bf1270e7a6f;hb=dba4f28b6269c0ebd7a4e70a82ca10cf6c4a6ff8;hp=d00b8eb72dada03a17df1f93f148deb2d4ba2bd6;hpb=a8cd9a4b8fd325b00c75f601c66c6d618ba276db;p=lyx.git diff --git a/src/Bidi.cpp b/src/Bidi.cpp index d00b8eb72d..b9d1222931 100644 --- a/src/Bidi.cpp +++ b/src/Bidi.cpp @@ -61,7 +61,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 +109,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