]> git.lyx.org Git - features.git/commitdiff
Fix horizontal scrolling in full-width collapsable insets
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 22 Apr 2016 10:11:00 +0000 (12:11 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 22 Apr 2016 13:31:40 +0000 (15:31 +0200)
While a one paragraph large collapsable inset (containing for example a tabular) could be very wide and trigger horizontal scrolling, the code that makes collapsable insets wide when they contain several paragraphs would actually make them narrower in this case.

Typical example is a wide tabular and a caption in a table float, where horizontal scrolling would not trigger.

(cherry picked from commit 8c7ace4b on 2.3.0-staging)

src/TextMetrics.cpp
status.22x

index 810b21a584fcedbf6b59d3ea06ad22b1749a4f93..816f4bacd6115d741dce60cee8a3b7dee569900c 100644 (file)
@@ -448,7 +448,7 @@ bool TextMetrics::redoParagraph(pit_type const pit)
                setRowHeight(row, pit);
                row.setChanged(false);
                if (row_index || row.endpos() < par.size()
-                       || (row.right_boundary() && par.inInset().lyxCode() != CELL_CODE))
+                   || (row.right_boundary() && par.inInset().lyxCode() != CELL_CODE)) {
                        /* If there is more than one row or the row has been
                         * broken by a display inset or a newline, expand the text
                         * to the full allowable width. This setting here is
@@ -458,7 +458,9 @@ bool TextMetrics::redoParagraph(pit_type const pit)
                         * that, and it triggers when using a caption in a
                         * longtable (see bugs #9945 and #9757).
                         */
-                       dim_.wid = max_width_;
+                       if (dim_.wid < max_width_)
+                               dim_.wid = max_width_;
+               }
                int const max_row_width = max(dim_.wid, row.width());
                computeRowMetrics(pit, row, max_row_width);
                first = row.endpos();
index d05694fa14cf7ca4ae046e0210839958b5b4753f..eb6625a91bfa732051168651226cba877307822b 100644 (file)
@@ -54,6 +54,9 @@ What's new
 - Display the correct column alignment and a better column spacing in AMS
   environments (bugs 1861, 9908).
 
+- Fix horizontal scrolling feature when inside a collapsable inset
+  with several paragraphs.
+
 - Fix display of collapsable insets when the same document is shown in
   two views with different width (bug 9756).