]> git.lyx.org Git - lyx.git/blobdiff - src/Bidi.C
Fix bug 2029 (RtL space width)
[lyx.git] / src / Bidi.C
index 28e729ce0d03bf77b5ce5c78d79f4f5efe92680d..6899c0ab73786aa6a5b2e5dcca6af4b87ef77cc8 100644 (file)
@@ -8,10 +8,10 @@
  * Full author contact details are available in file CREDITS.
  */
 
+#include <config.h>
 
 #include "Bidi.h"
 #include "buffer.h"
-#include "insets/updatableinset.h"
 #include "lyxfont.h"
 #include "lyxrow.h"
 #include "lyxrow_funcs.h"
@@ -52,7 +52,7 @@ bool Bidi::same_direction() const
 
 
 void Bidi::computeTables(Paragraph const & par,
-       Buffer const & buf, Row & row)
+       Buffer const & buf, Row const & row)
 {
        same_direction_ = true;
        if (!lyxrc.rtl_support) {
@@ -60,15 +60,13 @@ void Bidi::computeTables(Paragraph const & par,
                return;
        }
 
-       InsetOld * inset = par.inInset();
-       if (inset && inset->owner() &&
-           inset->owner()->lyxCode() == InsetOld::ERT_CODE) {
+       if (par.ownerCode() == InsetBase::ERT_CODE) {
                start_ = -1;
                return;
        }
 
        start_ = row.pos();
-       end_ = lastPos(par, row);
+       end_ = row.endpos() - 1;
 
        if (start_ > end_) {
                start_ = -1;
@@ -94,7 +92,7 @@ void Bidi::computeTables(Paragraph const & par,
        int lev = 0;
        bool rtl = false;
        bool rtl0 = false;
-       pos_type const body_pos = par.beginningOfBody();
+       pos_type const body_pos = par.beginOfBody();
 
        for (pos_type lpos = start_; lpos <= end_; ++lpos) {
                bool is_space = par.isLineSeparator(lpos);