]> git.lyx.org Git - lyx.git/blobdiff - src/Row.cpp
Amend b280fed1: 3rdparty/dtl: Use preprocessor value on Windows
[lyx.git] / src / Row.cpp
index 63b7195af450fbed83cc55f5987070ff8979f88f..1e9e3eca2bc7fc74a0af3fcf5bc740d00441352b 100644 (file)
@@ -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