X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBidi.C;h=2721ef87ce06123911c1393dec059b0e05a674f7;hb=e5a46922e916a06ad1b958d5895cc3cfb4f13d2c;hp=6899c0ab73786aa6a5b2e5dcca6af4b87ef77cc8;hpb=aabd481ab63fd50606dd0d984c0b407e4b27e6a7;p=lyx.git diff --git a/src/Bidi.C b/src/Bidi.C index 6899c0ab73..2721ef87ce 100644 --- a/src/Bidi.C +++ b/src/Bidi.C @@ -14,33 +14,32 @@ #include "buffer.h" #include "lyxfont.h" #include "lyxrow.h" -#include "lyxrow_funcs.h" #include "lyxrc.h" #include "paragraph.h" -using lyx::pos_type; +namespace lyx { -lyx::pos_type Bidi::log2vis(lyx::pos_type pos) const +pos_type Bidi::log2vis(pos_type pos) const { return (start_ == -1) ? pos : log2vis_list_[pos - start_]; } -lyx::pos_type Bidi::vis2log(lyx::pos_type pos) const +pos_type Bidi::vis2log(pos_type pos) const { return (start_ == -1) ? pos : vis2log_list_[pos - start_]; } -lyx::pos_type Bidi::level(lyx::pos_type pos) const +pos_type Bidi::level(pos_type pos) const { return (start_ == -1) ? 0 : levels_[pos - start_]; } -bool Bidi::inRange(lyx::pos_type pos) const +bool Bidi::inRange(pos_type pos) const { return start_ == -1 || (start_ <= pos && pos <= end_); } @@ -138,7 +137,7 @@ void Bidi::computeTables(Paragraph const & par, log2vis_list_[lpos - start_] = rtl ? 1 : -1; } else if (lev < new_level) { log2vis_list_[lpos - start_] = rtl ? -1 : 1; - if (new_level > rtl_par) + if (new_level > 0 && !rtl_par) same_direction_ = false; } else log2vis_list_[lpos - start_] = new_rtl ? -1 : 1; @@ -208,3 +207,6 @@ bool Bidi::isBoundary(Buffer const & buf, Paragraph const & par, : par.isRightToLeftPar(buf.params()); return rtl != rtl2; } + + +} // namespace lyx