X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FRow.cpp;h=1e9e3eca2bc7fc74a0af3fcf5bc740d00441352b;hb=bcde3d00165789db1e1ef183fab968c091faab8c;hp=63b7195af450fbed83cc55f5987070ff8979f88f;hpb=26c2811cc474f7e3be953f73bf6e9d79f14022cd;p=lyx.git diff --git a/src/Row.cpp b/src/Row.cpp index 63b7195af4..1e9e3eca2b 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -392,6 +392,7 @@ void Row::add(pos_type const pos, Inset const * ins, Dimension const & dim, e.dim = dim; elements_.push_back(e); dim_.wid += dim.wid; + changebar_ |= ins->isChanged(); } @@ -492,13 +493,10 @@ bool Row::shortenIfNeeded(pos_type const keep, int const w, int const next_width * FIXME: hardcoding languages is bad. Put this information in * `languages' file. */ - string const lang = brk.font.language()->lang(); - bool force = lang == "chinese-simplified" - || lang == "chinese-traditional" - || lang == "japanese" - || lang == "korean"; - // FIXME: is it important to check for separators? - if ((!force && brk.countSeparators() == 0) || brk.pos < keep) + bool const word_wrap = brk.font.language()->wordWrap(); + // When there is text before the body part (think description + // environment), do not try to break. + if (brk.pos < keep) continue; /* We have found a suitable separable element. This is the common case. * Try to break it cleanly (at word boundary) at a length that is both @@ -506,7 +504,7 @@ bool Row::shortenIfNeeded(pos_type const keep, int const w, int const next_width * - shorter than the natural width of the element, in order to enforce * break-up. */ - if (brk.breakAt(min(w - wid_brk, brk.dim.wid - 2), force)) { + if (brk.breakAt(min(w - wid_brk, brk.dim.wid - 2), !word_wrap)) { /* if this element originally did not cause a row overflow * in itself, and the remainder of the row would still be * too large after breaking, then we will have issues in