]> git.lyx.org Git - lyx.git/blobdiff - src/Row.cpp
Account for old versions of Pygments
[lyx.git] / src / Row.cpp
index d6ea7275ba4174753a3a7a1911d62c2730b19c16..8d89f64e1c06f17af0e315faecbab718889f4da3 100644 (file)
@@ -95,7 +95,7 @@ double Row::Element::pos2x(pos_type const i) const
 }
 
 
-pos_type Row::Element::x2pos(int &x, bool const select) const
+pos_type Row::Element::x2pos(int &x) const
 {
        //lyxerr << "x2pos: x=" << x << " w=" << width() << " " << *this;
        size_t i = 0;
@@ -112,11 +112,10 @@ pos_type Row::Element::x2pos(int &x, bool const select) const
                x = isRTL() ? int(full_width()) : 0;
                break;
        case INSET:
-       case SPACE: {
-               double const boundary = select ? (full_width() + 1) / 2 : full_width();
+       case SPACE:
                // those elements contain only one position. Round to
                // the closest side.
-               if (x > boundary) {
+               if (x > (full_width() + 1) / 2) {
                        x = int(full_width());
                        i = !isRTL();
                } else {
@@ -124,7 +123,6 @@ pos_type Row::Element::x2pos(int &x, bool const select) const
                        i = isRTL();
                }
        }
-       }
        //lyxerr << "=> p=" << pos + i << " x=" << x << endl;
        return pos + i;
 }