]> git.lyx.org Git - features.git/blobdiff - src/Row.cpp
Implement handling of row_flags for row breaking
[features.git] / src / Row.cpp
index 705a147389eec047f4516a0262e24e2936c3e55e..3bc8ef0d519f4462f7df692f68c39825ca8abb76 100644 (file)
@@ -370,8 +370,7 @@ void Row::finalizeLast()
        if (elt.change.changed())
                changebar_ = true;
 
-       if (elt.type == STRING) {
-               dim_.wid -= elt.dim.wid;
+       if (elt.type == STRING && elt.dim.wid == 0) {
                elt.dim.wid = theFontMetrics(elt.font).width(elt.str);
                dim_.wid += elt.dim.wid;
        }
@@ -401,16 +400,8 @@ void Row::add(pos_type const pos, char_type const c,
                e.row_flags = can_break ? CanBreakInside : Inline;
                elements_.push_back(e);
        }
-       if (back().str.length() % 30 == 0) {
-               dim_.wid -= back().dim.wid;
-               back().str += c;
-               back().endpos = pos + 1;
-               back().dim.wid = theFontMetrics(back().font).width(back().str);
-               dim_.wid += back().dim.wid;
-       } else {
-               back().str += c;
-               back().endpos = pos + 1;
-       }
+       back().str += c;
+       back().endpos = pos + 1;
 }