]> git.lyx.org Git - lyx.git/blobdiff - src/Bidi.cpp
Also add support for URW Garamond math fonts (via newtx)
[lyx.git] / src / Bidi.cpp
index d00b8eb72dada03a17df1f93f148deb2d4ba2bd6..a85f3eaddd26d4c64b035293e8abf9b448e953db 100644 (file)
@@ -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