]> git.lyx.org Git - features.git/commitdiff
Pass a pit to Text::isRTL(), not a paragraph
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 2 Apr 2019 07:53:40 +0000 (09:53 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:23 +0000 (15:48 +0200)
src/Text.h
src/Text3.cpp
src/TextMetrics.cpp

index a177a8321794dd1bad0ded4692608a6bf1aebfca..f3cd8447f5685f85bd02fb9384a0b3b6fba51b62 100644 (file)
@@ -285,7 +285,7 @@ public:
        /// FIXME: replace Cursor with DocIterator.
        docstring getPossibleLabel(DocIterator const & cur) const;
        /// is this paragraph right-to-left?
-       bool isRTL(Paragraph const & par) const;
+       bool isRTL(pit_type pit) const;
 
        ///
        bool checkAndActivateInset(Cursor & cur, bool front);
index 7baf9a8eba4fc0e0f22544a72c9458b4892870d7..aa527d1c0545c3c06cfbb78d8dd4ce5c84e98d39 100644 (file)
@@ -562,10 +562,10 @@ void Text::number(Cursor & cur)
 }
 
 
-bool Text::isRTL(Paragraph const & par) const
+bool Text::isRTL(pit_type const pit) const
 {
        Buffer const & buffer = owner_->buffer();
-       return par.isRTL(buffer.params());
+       return pars_[pit].isRTL(buffer.params());
 }
 
 
index a29b4dca77edf74f8cd9917886cda721ca4a484b..9bb116d360d9182d270bcfe50a43d7dbcca22ec9 100644 (file)
@@ -889,7 +889,7 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
        pos_type const end = par.size();
        pos_type const pos = row.pos();
        pos_type const body_pos = par.beginOfBody();
-       bool const is_rtl = text_->isRTL(par);
+       bool const is_rtl = text_->isRTL(row.pit());
        bool need_new_row = false;
 
        row.clear();