return start_ == -1 || (start_ <= pos && pos <= end_);
}
+
bool Bidi::same_direction() const
{
return same_direction_;
Buffer const & buf, Row const & row)
{
same_direction_ = true;
- if (!lyxrc.rtl_support) {
- start_ = -1;
- return;
- }
- if (par.ownerCode() == ERT_CODE || par.ownerCode() == LISTINGS_CODE) {
+ if (par.inInset().forceLTR()) {
start_ = -1;
return;
}
pos_type const pos =
(is_space && lpos + 1 <= end_ &&
!par.isLineSeparator(lpos + 1) &&
+ !par.isEnvSeparator(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
bool Bidi::isBoundary(Buffer const & buf, Paragraph const & par,
pos_type pos) const
{
- if (!lyxrc.rtl_support || pos == 0)
+ if (pos == 0)
return false;
if (!inRange(pos - 1)) {
bool Bidi::isBoundary(Buffer const & buf, Paragraph const & par,
pos_type pos, Font const & font) const
{
- if (!lyxrc.rtl_support)
- return false; // This is just for speedup
-
bool const rtl = font.isVisibleRightToLeft();
bool const rtl2 = inRange(pos)
? level(pos) % 2