]> git.lyx.org Git - features.git/commitdiff
Indicate that this rtl variable is only valid on the last row
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Apr 2012 20:46:49 +0000 (22:46 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Apr 2012 20:49:30 +0000 (22:49 +0200)
Otherwise the variable might be used incorrectly as in [0a137e31/lyxgit].

src/TextMetrics.cpp

index 6c32ee4dc6d19de91f3da3a6b8fb06cce8f26d05..a60d4de31bb26d13b3bdf92b00fdee9e8a7cbc79 100644 (file)
@@ -1231,7 +1231,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
 
        // If lastrow is false, we don't need to compute
        // the value of rtl.
-       bool const rtl = lastrow ? text_->isRTL(par) : false;
+       bool const rtl_on_lastrow = lastrow ? text_->isRTL(par) : false;
 
        // if the first character is a separator, and we are in RTL
        // text, this character will not be painted on screen
@@ -1267,8 +1267,8 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
        boundary = false;
 
        if (lastrow &&
-           ((rtl  &&  left_side && vc == row.pos() && x < tmpx - 5) ||
-            (!rtl && !left_side && vc == end  && x > tmpx + 5))) {
+           ((rtl_on_lastrow  &&  left_side && vc == row.pos() && x < tmpx - 5) ||
+            (!rtl_on_lastrow && !left_side && vc == end  && x > tmpx + 5))) {
                if (!par.isNewline(end - 1))
                        c = end;
        } else if (vc == row.pos()) {