From: Alfredo Braunstein Date: Tue, 4 Sep 2007 10:27:55 +0000 (+0000) Subject: rename Paragraph::isRightToLeftPar -> isRTL for the sake of consistence X-Git-Tag: 1.6.10~8518 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a8ed1add4dcae9d44abf78eafc8fbe36e587db88;p=features.git rename Paragraph::isRightToLeftPar -> isRTL for the sake of consistence git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20031 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Bidi.cpp b/src/Bidi.cpp index 1688fca15a..02d0df8026 100644 --- a/src/Bidi.cpp +++ b/src/Bidi.cpp @@ -88,7 +88,7 @@ void Bidi::computeTables(Paragraph const & par, BufferParams const & bufparams = buf.params(); pos_type stack[2]; - bool const rtl_par = par.isRightToLeftPar(bufparams); + bool const rtl_par = par.isRTL(bufparams); int lev = 0; bool rtl = false; bool rtl0 = false; @@ -198,7 +198,7 @@ bool Bidi::isBoundary(Buffer const & buf, Paragraph const & par, bool const rtl = level(pos - 1) % 2; bool const rtl2 = inRange(pos) ? level(pos) % 2 - : par.isRightToLeftPar(buf.params()); + : par.isRTL(buf.params()); return rtl != rtl2; } @@ -212,7 +212,7 @@ bool Bidi::isBoundary(Buffer const & buf, Paragraph const & par, bool const rtl = font.isVisibleRightToLeft(); bool const rtl2 = inRange(pos) ? level(pos) % 2 - : par.isRightToLeftPar(buf.params()); + : par.isRTL(buf.params()); return rtl != rtl2; } @@ -226,15 +226,13 @@ bool reverseDirectionNeeded(Cursor const & cur) * within a paragraph, and thus avoid situations in which the * cursor gets stuck. */ - return cur.bottom().paragraph().isRightToLeftPar( - cur.bv().buffer().params()); + return cur.bottom().paragraph().isRTL(cur.bv().buffer().params()); } bool isWithinRtlParagraph(Cursor const & cur) { - return cur.innerParagraph().isRightToLeftPar( - cur.bv().buffer().params()); + return cur.innerParagraph().isRTL(cur.bv().buffer().params()); } } // namespace lyx diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index fc416bae2d..7f13475194 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -2394,7 +2394,7 @@ Paragraph::getParLanguage(BufferParams const & bparams) const } -bool Paragraph::isRightToLeftPar(BufferParams const & bparams) const +bool Paragraph::isRTL(BufferParams const & bparams) const { return lyxrc.rtl_support && getParLanguage(bparams)->rightToLeft() diff --git a/src/Paragraph.h b/src/Paragraph.h index 21a96719c9..ee61d83bcb 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -91,7 +91,7 @@ public: /// Language const * getParLanguage(BufferParams const &) const; /// - bool isRightToLeftPar(BufferParams const &) const; + bool isRTL(BufferParams const &) const; /// void changeLanguage(BufferParams const & bparams, Language const * from, Language const * to); diff --git a/src/Text.cpp b/src/Text.cpp index 9fde15b3a2..6ca5d485dc 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -521,7 +521,7 @@ void Text::insertChar(Cursor & cur, char_type c) // adjacent character whose direction is the paragraph's // direction; don't touch other properties of the font Language const * lang = - (pre_space_rtl == par.isRightToLeftPar(buffer.params())) ? + (pre_space_rtl == par.isRTL(buffer.params())) ? pre_space_font.language() : post_space_font.language(); Font space_font = tm.getDisplayFont(cur.pit(), cur.pos() - 1); diff --git a/src/Text3.cpp b/src/Text3.cpp index 1c0ceacfbb..d7dec77f53 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -247,7 +247,7 @@ void Text::number(Cursor & cur) bool Text::isRTL(Buffer const & buffer, Paragraph const & par) const { - return par.isRightToLeftPar(buffer.params()); + return par.isRTL(buffer.params()); } diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 322531df67..3acc85ad7b 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -286,7 +286,7 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos) const bool left = getDisplayFont(pit, pos - 1).isVisibleRightToLeft(); bool right; if (pos == par.size()) - right = par.isRightToLeftPar(bv_->buffer().params()); + right = par.isRTL(bv_->buffer().params()); else right = getDisplayFont(pit, pos).isVisibleRightToLeft(); return left != right; @@ -303,7 +303,7 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos, bool left = font.isVisibleRightToLeft(); bool right; if (pos == par.size()) - right = par.isRightToLeftPar(bv_->buffer().params()); + right = par.isRTL(bv_->buffer().params()); else right = getDisplayFont(pit, pos).isVisibleRightToLeft(); return left != right; diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index b7f1b49955..44c8b017aa 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -2282,7 +2282,7 @@ int Tabular::TeXRow(odocstream & os, row_type i, Buffer const & buf, shared_ptr inset = getCellInset(cell); Paragraph const & par = inset->paragraphs().front(); - bool rtl = par.isRightToLeftPar(buf.params()) + bool rtl = par.isRTL(buf.params()) && !par.empty() && getPWidth(cell).zero();